Hello,
i am trying to program an ESP8266 using Arduino IDE, my goal is the access a mysql database running on my main pc using xampp.
I came up with the following code:
#include <Adafruit_SSD1306.h>
#include <Adafruit_GFX.h>
#include <ESP8266WiFi.h>
#include <MySQL_Connection.h>
#include <MySQL_Cursor.h>
#include <WiFiClientSecure.h>
#include <UniversalTelegramBot.h>
#include <ArduinoJson.h>
#include <time.h>
// W-lan Anmeldedaten
const char* ssid = "(....)";
const char* password = "(....)";
byte mac[6];
WiFiServer server(80);
IPAddress ip(192, 168, 178, 33);
IPAddress gateway(192, 168, 178, 1);
IPAddress subnet(255, 255, 255, 0);
//Connection Daten für mysql datenbank
IPAddress server_addr(192,168,178,67); // IP of the MySQL server here
char user[] = "myuser"; // MySQL user login username
char passwordDb[] = "mypassword"; // MySQL user login password
WiFiClient dbClient;
MySQL_Connection conn((Client *)&dbClient);
//-----------------------------------------------------------------------------
void setup() {
Serial.begin(9600);
configTime(0, 0, "pool.ntp.org"); // die UTC zeit vom NTP(Network Time Protocol)
client.setTrustAnchors(&cert); // Add root certificate for api.telegram.org
// mit dem W-Lan verbinden
WiFi.mode(WIFI_STA);
WiFi.config(ip,gateway,subnet);
WiFi.begin(ssid, password);
// Beim Verbinden Status ausgeben
while (WiFi.status() != WL_CONNECTED) {
delay(1000);
Serial.println("Connecting to WiFi..");
}
// Die Locale IP Adresse vom ESP ausgeben
Serial.println(WiFi.localIP());
WiFi.macAddress(mac);
server.begin();
while (conn.connect(server_addr, 3306, user, passwordDb) != true) {
delay(200);
Serial.print ( "." );
}
Serial.println("");
Serial.println("Connected to SQL Server!");
}
This is followed by a loop statement of course which a left out to make my posting short.
But I receive the somewhat cryptic error message, when trying to connect to the mysql database:
23:08:43.670 -> --------------- CUT HERE FOR EXCEPTION DECODER ---------------
23:08:43.717 ->
23:08:43.717 -> Exception (28):
23:08:43.717 -> epc1=0x40206f00 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000049 depc=0x00000000
23:08:43.822 ->
23:08:43.822 -> >>>stack>>>
23:08:43.822 ->
23:08:43.822 -> ctx: cont
23:08:43.857 -> sp: 3ffffc20 end: 3fffffc0 offset: 0190
23:08:43.904 -> 3ffffdb0: 000008ed 3fffc6fc 126037d0 00000000
23:08:43.949 -> 3ffffdc0: 00f81c03 00000001 00000001 40206f53
23:08:43.994 -> 3ffffdd0: 40230000 00000000 3ffe8630 40206f40
23:08:44.087 -> 3ffffde0: 3fff3030 3fff018c 3fff2f30 4020fcd8
23:08:44.087 -> 3ffffdf0: fffffffc 3fffc200 00000022 40240bfc
23:08:44.182 -> 3ffffe00: 00000014 3fff2f2c 000000ff 3ffef770
23:08:44.182 -> 3ffffe10: 4020fca4 3ffe8630 3ffefb90 4020a990
23:08:44.277 -> 3ffffe20: 3fff2fec 3ffefb90 00000000 4020a9b4
23:08:44.323 -> 3ffffe30: 3fff2fec 3ffefb90 3ffefb90 4020aa44
23:08:44.371 -> 3ffffe40: 3fff018c 00000000 00000000 40207307
23:08:44.418 -> 3ffffe50: 40204d16 40204d0e 40100929 4022150a
23:08:44.465 -> 3ffffe60: 000005e2 000005e2 3ffe868c 40100ec3
23:08:44.559 -> 3ffffe70: 00000000 4bc6a7f0 3a5e353f 00000001
23:08:44.559 -> 3ffffe80: 3fff355c 00000020 3fff355c 401010a2
23:08:44.654 -> 3ffffe90: 3ffef2d0 00000000 00000000 40100a5c
23:08:44.654 -> 3ffffea0: 000040b0 3fff0060 0000012c 40221f7c
23:08:44.748 -> 3ffffeb0: 00000534 00000534 3ffe868c 40100ec3
23:08:44.748 -> 3ffffec0: 3ffe8630 00000000 3fff3394 3ffe8630
23:08:44.844 -> 3ffffed0: 00000000 0000002b 00000020 3ffe8630
23:08:44.892 -> 3ffffee0: 00000000 0000002b 3ffef770 4020744a
23:08:44.939 -> 3ffffef0: 00000006 3fff2fec 3ffef770 402071be
23:08:44.986 -> 3fffff00: 00000059 00000000 00000001 00000003
23:08:45.034 -> 3fffff10: 00000001 3ffefc68 3ffef770 40206d7e
23:08:45.081 -> 3fffff20: 402104d0 43b2a8c0 3ffef908 4021ac5f
23:08:45.128 -> 3fffff30: 3fffff70 00000cea 3ffe863b 3ffe8630
23:08:45.224 -> 3fffff40: 00000000 402055c0 3ffefc68 40206b83
23:08:45.272 -> 3fffff50: 40204b25 3ffef92c 3ffefb72 3ffefd04
23:08:45.320 -> 3fffff60: 402104d0 3ffefb72 3ffefc68 4020160c
23:08:45.368 -> 3fffff70: 402104d0 43b2a8c0 402104d0 00000000
23:08:45.416 -> 3fffff80: 402104d0 00ffffff 402104d0 01b2a8c0
23:08:45.462 -> 3fffff90: 402104d0 21b2a8c0 feefeffe feefeffe
23:08:45.510 -> 3fffffa0: 3fffdad0 00000000 3ffefcf0 4020be20
23:08:45.558 -> 3fffffb0: feefeffe feefeffe 3ffe8688 4010135d
23:08:45.606 -> <<<stack<<<
23:08:45.654 ->
23:08:45.654 -> --------------- CUT HERE FOR EXCEPTION DECODER ---------------
What does the error mean and how can I fix this?