Python and SQLAlchemy error -pymysql.err.OperationalError(2006, “MySQL server has gone away …

After sitting for a few minutes and then attempting to reconnect to your database through the application (read, add, delete, or update functions) you receive the error: pymysql.err.OperationalError) (2006, “MySQL server has gone away (BrokenPipeError(32, ‘Broken pipe’) Insert the following app.config[‘SQLALCHEMY_ENGINE_OPTIONS’] = {“pool_pre_ping”: True, “pool_recycle”: 300,} https://medium.com/@heyjcmc/controlling-the-flask-sqlalchemy-engine-a0f8fae15b47   Insert the following into app.py, just after … Read more

WordPress permissions errors

Recursively change group ownership of the wp-content folder, keeping your ownership of the folder: chown YOURUSERNAME:www-data -R /var/www/html/wp-content/* Note: YOURUSERNAME is the Linux user you created in step E.   Recursively enable write permissions for the group on wp-content subfolders and also for files in the folder and subfolders: cd /var/www/html/wp-content find . -type d -exec … Read more

WordPress error: The response is not a valid JSON response.

If the error occurs when attempting to publish a post: Disable Gutenberg and return to using the classic editor (aka: TinyMCE) by installing the ‘Classic Editor’ plugin: https://wordpress.org/plugins/classic-editor/ When you activate the Classic Editor, it disables Gutenberg by default    

Remote access to a MySQL server running on Ubuntu 18

SSH into Ubuntu Allow MySQL service listen on the server IP address instead of 127.0.0.1 Under [msqld], change bind-address = 127.0.0.1 to the db_server_IP_address. Restart the MySQL server: Allow SQL traffic through the firewall: Create a new user with permissions: Update an existing database and user to allow remote access:

AM2302 (DTH22) on Adafruit Feather HUZZAH reporting via Wi-Fi (step 4)

Next we’ll connect the Feather to Wi-Fi and report the temperature and humidity data to a cloud MySQL database server through a web page. Using the MAC address for the Feather you found in step 2, register the Feather on Devicenet. Paste the is sketch and make necessary edits (indicated with //TODO): // https://github.com/openhomeautomation/esp8266-cloud/blob/master/cloud_data_logger/cloud_data_logger.ino // … Read more

Categories IoT

Testing AM2302 (DTH22) on Adafruit Feather HUZZAH (step 3)

For this, I purchased: solderless breadboard (3 pack) – $9.99 eachhttps://www.amazon.com/gp/product/B01EV6LJ7G Adafruit AM2302 temperature & humidity sensor – $15 eachhttps://www.adafruit.com/product/393   Connect the AM2302 sensor to the Feather using the breadboard: Download the DHT-sensor-library from Adafruit’s Github Unzip and place the folder in On a PC:   /Program Files (x86)/Arduino/libraries/DHT-sensor-master-library On a Mac:   /Documents/Arduino/libraries/DHT-sensor-master-library Sketch –> … Read more

Categories IoT

Get the MAC address of an Adafruit Feather Huzzah Arduino board (step 2)

Create a new sketch with the following code and upload it: #include “ESP8266WiFi.h” void setup(){ Serial.begin(115200); delay(500); Serial.println(); Serial.print(“MAC: “); Serial.println(WiFi.macAddress()); } void loop(){} Open the serial monitor (magnifying glass). Press the reset button on your Feather. You should then see the MAC address associate with the wireless Ethernet radio on your Feather appear in … Read more

Categories IoT

Connecting to an Arduino Feather Huzzah and Testing (step 1)

For this project I purchased an Arduino Feather Huzzah Adafruit 2821 Feather HUZZAH with ESP8266 Wi-Fihttps://www.adafruit.com/product/2821 Mac installation: Following the instructions on the Feather Huzzah page, I downloaded the latest Arduino IDE:Arduino IDE.Next, I downloaded and installed the Legacy CP2104 USB driver for my Mac from here.   Windows installation: I downloaded the Windows installer (.exe) … Read more

Categories IoT