ChuckBell / MySQL_Connector_Arduino

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

code stop after timeout #52

Closed fgaliazzo closed 6 years ago

fgaliazzo commented 6 years ago

Hi,

i´m using a arduino uno with wifiesp.

sometimes when I open a connection, i have a timeout response and the code stop.

to get back to work I need to turn the Arduino off and on again, until the next timeout error.

[WiFiEsp] Connecting to xxx.xxx.xxx.xxx

startClient xxx.xxx.xxx.xxx 3306

AT+CIPSTART=3,"TCP","xxx.xxx.xxx.xxx",3306 3,CONNECT Data packet 3 11 Connected to server version 5.5.5-10.1.29 getClientState 3

AT+CIPSTATUS STATUS:3 +CIPSTATUS:3,"TCP","xx.xxx.xxx.xxx",3306,37110,0

OK ---------------------------------------------- > "TCP"⸮J⸮⸮⸮⸮⸮⸮⸮ ⸮⸮hĖ⸮⸮-

Data packet 3 99 [WiFiEsp] TIMEOUT: 23 ERROR: Timeout waiting for client.

-- bool mysqlConnect(){

if (conn.connect(server_addr, 3306, user, password)) { MySQL_Cursor *cur_mem = new MySQL_Cursor(&conn); cur_mem->execute(db); delete cur_mem; return true; } else { conn.close(); checkErrors(); return false; }

}

i think the problem is conn.close();

tks