Skip to content

ESP8266 Reboot on connection #171

Open

Description

@Glammies

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

  1. ChuckBell commented on May 24, 2021

    @ChuckBell
    Owner

    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.

  2. renandamaia commented on May 28, 2021

    @renandamaia

    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.

  3. woeperbe commented on May 28, 2021

    @woeperbe
  4. ChuckBell commented on May 28, 2021

    @ChuckBell
    Owner
  5. renandamaia commented on May 29, 2021

    @renandamaia

    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

  6. woeperbe commented on May 29, 2021

    @woeperbe
  7. ChuckBell commented on May 29, 2021

    @ChuckBell
    Owner
  8. woeperbe commented on May 29, 2021

    @woeperbe

    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.

  9. ChuckBell commented on Jun 7, 2021

    @ChuckBell
    Owner

    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.

  10. Glammies commented on Jun 7, 2021

    @Glammies
    Author

    Thanks for your help :)

  11. ChinaBurn commented on Jul 29, 2021

    @ChinaBurn

    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.

    Can you solve this problem? thanks...

  12. ChuckBell commented on Jul 29, 2021

    @ChuckBell
    Owner
  13. d-a-v commented on Oct 13, 2021

    @d-a-v

    @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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions