ChuckBell / MySQL_Connector_Arduino

Database connector library for using MySQL with your Arduino projects.
331 stars 132 forks source link

Program Freeze #109

Closed emhatek closed 5 years ago

emhatek commented 5 years ago

Hi Dr Bells, i'm using nodemcu to sent the database to mysql server. the process is good and success. but the problem if server down but in wifi still connect, the program freeze.

can you advice me.

thanks Mansur. H

ChuckBell commented 5 years ago

Hi. The connector is not designed to retry connections that drop or are affected by latency.

However, you handle the situation more effectively by connecting and disconnecting before and after your query. This will ensure the connection is not held open too long.

Also, you may want to consider implementing a watchdog or timer in your code to reboot the device if network fails.

These two techniques seem to help a great deal for wonky connections.