cotestatnt / AsyncTelegram2

Powerful, flexible and secure Arduino Telegram BOT library. Hardware independent, it can be used with any MCU capable of handling an SSL connection.
MIT License
83 stars 25 forks source link

Improved main loop blocking with no internet connection #68

Closed muhaos closed 2 years ago

muhaos commented 2 years ago

Fixed (improved) main loop blocking while calling myBot.getNewMessage without internet connection (e.g cable unplugged from the WAN port of a router, but Wi-Fi still presented).

There is till some blocking around 16 secs of duration each 10*m_minUpdateTime because of invoking reset(); but at least not each loop() iteration :) The 16 sec block is caused by WiFiClientSecure::connect function, which also seems to be known issue https://github.com/espressif/arduino-esp32/pull/5418

Tested on esp8266 but perhaps should be similar behavior on esp32.