Repository navigation
ESP8266 Reboot on connection #171
Description
Hi
I'm using this library since last two years and work fine until today.
Normally i use this library in some devices at home. I have all my home automation based in MariaDB since last two year without any problem.
Now am trying to make some changes on my code and after upload the code to esp8266 the reboots begin.
So back to the original example of this library(only change the user/pass of wireless and database) and the problem persist.
he reboot happen on the line below. I only test this with nodemcu.
if (conn.connect(server_addr, 3306, user, password))
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x4010f000, len 3460, room 16
tail 4
chksum 0xcc
load 0x3fff20b8, len 40, room 4
tail 4
chksum 0xc9
csum 0xc9
v00044b90
~ld
Connecting to Glammies...........
Connected to network
My IP address is: 192.168.1.76
Connecting to SQL... ...trying...
Uded code:
#include <ESP8266WiFi.h> // Use this for WiFi instead of Ethernet.h
#include <MySQL_Connection.h>
#include <MySQL_Cursor.h>
IPAddress server_addr(192,168,1,219); // IP of the MySQL server here
char user[] = ""; // MySQL user login username
char password[] = ""; // MySQL user login password
// Sample query
char INSERT_SQL[] = "INSERT INTO test_arduino.hello_arduino (message) VALUES ('Hello, Arduino!')";
// WiFi card example
char ssid[] = ""; // your SSID
char pass[] = ""; // your SSID Password
WiFiClient client; // Use this for WiFi instead of EthernetClient
MySQL_Connection conn(&client);
MySQL_Cursor* cursor;
void setup()
{
Serial.begin(115200);
while (!Serial); // wait for serial port to connect. Needed for Leonardo only
// Begin WiFi section
Serial.printf("\nConnecting to %s", ssid);
WiFi.begin(ssid, pass);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
// print out info about the connection:
Serial.println("\nConnected to network");
Serial.print("My IP address is: ");
Serial.println(WiFi.localIP());
Serial.print("Connecting to SQL... ");
if (conn.connect(server_addr, 3306, user, password))
Serial.println("OK.");
else
Serial.println("FAILED.");
// create MySQL cursor object
cursor = new MySQL_Cursor(&conn);
}
void loop()
{
// if (conn.connected())
// cursor->execute(INSERT_SQL);
//
// delay(5000);
}
Activity
ChuckBell commentedon May 24, 2021
Hello. First, you should determine what has changed to suddenly cause this failure. Identifying what changed is the best path forward. Was it an upgrade to your system, database, hardware, etc.? Identify the change(s) and revert them to the point where the problem is resolved.
Also, please understand that the connector was written for Oracle MySQL. Any other variant is not guaranteed to work. Some do, most don't. I would suggest if the database system was changed or upgraded, you try Oracle's MySQL to see if the problem goes away. If you must use a non-Oracle release, I will try to help, but I may not be able to completely solve any incompatibilities.
All that said, reboots typically happen due to memory problems or errors in the script (often related to memory too). If you cannot determine what changed or if you confirm nothing has changed, I would suggest you may have a hardware issue, but I suspect you will find something that has changed - an OS update, DB update, etc.
Finally, I would also suggest using a different board as a test - like an Arduino Uno or similar that is known to work well with the connector.
renandamaia commentedon May 28, 2021
I am also having the same problem with ESP8266, after updating the board to version 3.0 in the Arduino IDE, ESP is no longer able to establish a connection with MySQL.
woeperbe commentedon May 28, 2021
ChuckBell commentedon May 28, 2021
renandamaia commentedon May 29, 2021
ESP8266 (LOLIN WeMos) D1 R1;
Board version By ESP8266 Community version 3.0.0;
Lib MySQL Connector 1.2.0;
MySQL:
Server version: 5.5.25-log - MySQL Community Server (GPL)
Protocol version: 10
woeperbe commentedon May 29, 2021
ChuckBell commentedon May 29, 2021
woeperbe commentedon May 29, 2021
I have a lot exceptions 9 due to misalignment errors. I think to stay away from ESP8266 3.0.0 until other versions are available.
ChuckBell commentedon Jun 7, 2021
I have confirmed this is a bug in the ESP8266 v3.0 hardware code. You can revert to 2.7.4 and it will work again. Just uninstall the 3.0.0 and install the 2.7.4.
Glammies commentedon Jun 7, 2021
Thanks for your help :)
ChinaBurn commentedon Jul 29, 2021
Can you solve this problem? thanks...
ChuckBell commentedon Jul 29, 2021
d-a-v commentedon Oct 13, 2021
@ChuckBell
Before we can track this inside the esp8266 Arduino core, can you please fix this coding issue identified in your library by @mcspr and @Pablo2048 ?
esp8266/Arduino#8335 (comment)
#176 (comment)