ChuckBell / MySQL_Connector_Arduino

Database connector library for using MySQL with your Arduino projects.
333 stars 133 forks source link

Getting Exception 28 while connecting #145

Open beicnet opened 4 years ago

beicnet commented 4 years ago

Hi there,

I'm trying to use this library for the first time to connect to my MariaDB database, all compiling just fine, but I'm getting continuous reset loop with Exception code 28.

My setup is Arduino IDE v1.8.2, ESP8266 Core v2.3.0 and MySQL Connector v1.2.0, only WeMos D1 mini attached nothing else.

All connection and database parameters are configured correctly, because I using them on daily level.

Any help would be highly appreciated!

Kind regards, Viktor

Output:

Connecting to Wifi
...
WiFi connected
IP address: 
192.168.0.28
Connecting...
...trying...

Exception (28):
epc1=0x402022dd epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000020 depc=0x00000000

ctx: cont 
sp: 3ffef4d0 end: 3ffef700 offset: 01a0

>>>stack>>>
3ffef670:  00000000 3ffee6a0 3ffee460 402022d5  
3ffef680:  3ffe8474 0000000d 3ffee6a0 40202df5  
3ffef690:  3ffef6d0 00000ceb 3ffe8354 3ffe834c  
3ffef6a0:  00000000 3ffee4fc 3ffee6a0 40202e20  
3ffef6b0:  1c00a8c0 00ffffff 3ffee6a0 3ffee6cc  
3ffef6c0:  3ffe8474 3ffee460 3ffee6a0 40201cec  
3ffef6d0:  3ffe8718 f200a8c0 feefeffe feefeffe  
3ffef6e0:  3fffdad0 00000000 3ffee6c4 40203274  
3ffef6f0:  feefeffe feefeffe 3ffee6e0 40100718  
<<<stack<<<

Sketch what I'm using:

#include "ESP8266WiFi.h"
#include "ESP8266HTTPClient.h"
#include "MySQL_Connection.h"
#include "MySQL_Cursor.h"

const char* ssid  = "YourWifiSsid";
const char* pass  = "YourWifiPassword";

IPAddress db_addr(192, 168, 0, 242);
int db_port = 3307;
char db_usr[] = "YourDbUsername";
char db_pwd[] = "YourDbPassword";
char db_name[] = "YourDbName";

HTTPClient client;
MySQL_Connection db((Client *)&client);

void setup()
{
  Serial.begin(9600);

  delay(100);

  Serial.println();
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);

  WiFi.begin(ssid, pass);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }

  Serial.println("");
  Serial.println("WiFi connected");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());

  Serial.println("Connecting...");

  if (db.connect(db_addr, db_port, db_usr, db_pwd, db_name)) {
    delay(1000);
  } else {
    Serial.println("Connection failed.");
    db.close();
  }

}

void loop()
{
}
ChuckBell commented 4 years ago

Try a different ESP WiFi library. It’s most likely an incompatibility with the library.

On Jun 19, 2020, at 7:06 AM, beic notifications@github.com wrote:

Hi there,

I'm trying to use this library for the first time to connect to my MariaDB database, all compiling just fine, but I'm getting continuous reset loop with Exception code 28.

My setup is Arduino IDE v1.8.2, ESP8266 Core v2.3.0 and MySQL Connector v1.2.0, only WeMos D1 mini attached nothing else.

All connection and database parameters are configured correctly, because I using them on daily level.

Any help would be highly appreciated!

Kind regards, Viktor

Output:

Connecting to Wifi ... WiFi connected IP address: 192.168.0.28 Connecting... ...trying...

Exception (28): epc1=0x402022dd epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000020 depc=0x00000000

ctx: cont sp: 3ffef4d0 end: 3ffef700 offset: 01a0

stack>>> 3ffef670: 00000000 3ffee6a0 3ffee460 402022d5
3ffef680: 3ffe8474 0000000d 3ffee6a0 40202df5
3ffef690: 3ffef6d0 00000ceb 3ffe8354 3ffe834c
3ffef6a0: 00000000 3ffee4fc 3ffee6a0 40202e20
3ffef6b0: 1c00a8c0 00ffffff 3ffee6a0 3ffee6cc
3ffef6c0: 3ffe8474 3ffee460 3ffee6a0 40201cec
3ffef6d0: 3ffe8718 f200a8c0 feefeffe feefeffe
3ffef6e0: 3fffdad0 00000000 3ffee6c4 40203274
3ffef6f0: feefeffe feefeffe 3ffee6e0 40100718
<<<stack<<< Sketch what I'm using:

include "ESP8266WiFi.h"

include "ESP8266HTTPClient.h"

include "MySQL_Connection.h"

include "MySQL_Cursor.h"

const char ssid = "YourWifiSsid"; const char pass = "YourWifiPassword";

IPAddress db_addr(192, 168, 0, 242); int db_port = 3307; char db_usr[] = "YourDbUsername"; char db_pwd[] = "YourDbPassword"; char db_name[] = "YourDbName";

HTTPClient client; MySQL_Connection db((Client *)&client);

void setup() { Serial.begin(9600);

delay(100);

Serial.println(); Serial.println(); Serial.print("Connecting to "); Serial.println(ssid);

WiFi.begin(ssid, pass);

while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); }

Serial.println(""); Serial.println("WiFi connected"); Serial.println("IP address: "); Serial.println(WiFi.localIP());

Serial.println("Connecting...");

if (db.connect(db_addr, db_port, db_usr, db_pwd, db_name)) { delay(1000); } else { Serial.println("Connection failed."); db.close(); }

}

void loop() { } — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/145, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6SHYFLHOM2BZM6BTNZOEDRXNBE3ANCNFSM4OCUDAPQ.

beicnet commented 4 years ago

@ChuckBell But, is it compatible with MariaDB or only just with MySQL?

ChuckBell commented 4 years ago

The connector was written for MySQL from Oracle. Any other variant is not supported, but some are known to work, others not so much.

On Jun 21, 2020, at 11:18 AM, beic notifications@github.com wrote:

 @ChuckBell But, is it compatible with MariaDB or only just with MySQL?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.