JAndrassy / WiFiEspAT

Arduino networking library. Standard Arduino WiFi networking API over ESP8266 or ESP32 AT commands.
GNU Lesser General Public License v2.1
271 stars 44 forks source link

Stop client.connect() from blocking #67

Closed bobemoe closed 2 years ago

bobemoe commented 2 years ago

I'm trying to make my code more robust on an unreliable internet connection.

If the wifi is connected but the internet is not available, client.connect() can block for 15 seconds.

Is it possible to set a custom timeout? Similar to what was done here https://github.com/espressif/arduino-esp32/pull/2606

Or use a callback maybe so other code can continue to execute?

JAndrassy commented 2 years ago

AT firmware doesn't support timeout for AT+CIPSTART and no other command can be run until the current AT command finishes. the library must wait for the response to the AT command.

bobemoe commented 2 years ago

Damn! Well, thanks for confirming.