shurillu / CTBot

A simple (and easy to use) Arduino Telegram BOT Library for ESP8266/ESP32
MIT License
147 stars 34 forks source link

Blocking when Internet connection drops #33

Closed ElVasquito closed 4 years ago

ElVasquito commented 4 years ago

I don't know if this is because of WiFiClientSecure, or if it happens inside the while (telegramServer.isconnected()) loop: when the Internet connection (not Wifi!) drops, the ESP locks up. If the connection returns within a few seconds, it gets back to normal, but if it takes more than 1 minute to return, it will not get back and stay blocked until the ESP is manually restarted. I tried adding a telegramServer.setTimeout(1000); before the connection is made by the Bot, but nothing changes, it blocks the same. Is it possible to avoid this?

ElVasquito commented 4 years ago

Solved. Apparently, it was WiFiClientSecure. I updated to the latest code, and now it always unlocks after less than 15 seconds of lost connection. Anyway, I added a 15 second watchdog to my loop(), just in case something bad happens :)

shurillu commented 4 years ago

Hi ElVasquito, thanks for the feedback, it could be very useful for the community! Cheers

Stefano