Closed
Description
Currently we poll Telegram every 10 s. However, the default timeout for SSL connection is currently hardcoded in ESP Core to 15 s. Due to this, if there is a temporary problem with connection to Telegram, polls might become overlapping (because called via Ticker) and piling up, eventually leading to a crash. The solution would be to make timeout 20 s instead of 10. In this application it is not critical to have fast response from a Telegram bot.
Note that there is a fix in Core esp8266/Arduino#8889 making the timeout configurable. If that would be available, one can keep polling period at 10 s and make timeout something like 5 s instead of 15 s. A healthy Telegram poll takes about 2 s.