Skip to content

ESP8266 Reboot on connection #171

@Glammies

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);
}

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