Open miguelfernando55 opened 11 months ago
Hi @miguelfernando55 . Which microcontroller is it?
esp32-s2-saola.
Here what it is happenning
When it is unable, it delays the normal functionality of the rest of the system.
As you may check in the image, I have an interval to send new info. When it happens "unable ... ", it is much longer
Thanks for your feedback, I will try to check after 20th August because I am going on vacation from next weekend
Ok. Nice holidays. Hope you may upgrade the functionality.
Is it able to use a flag that warns when the "unable to connect to server" happens? Or does bool checkConnection(); is enough?
It would be good if we could question the telegram server if he is able to start a connection. Before really starting one.
Hi @miguelfernando55 Regarding your issue, it is not clear to me if the failed connection to the Telegram server happens even if the esp32 is correctly connected to the internet.
If you don't have an active internet connection, you should avoid calling the getNewMessage()
method (and more generally the other library methods) because an attempt to connect to the server will still be made and this step is blocking (you can set a timeout eventually).
Checking the internet connection cannot be "internal" to the library because it is strictly linked to the hardware interface (WiFi, Ethernet, GPRS etctec).
You are right. The esp32 may be connected to the router, but the router lost internet connection. It was because of this situation that the "unable to ...." happenned. I am blocking and not able to design a way to avoid this situation.
Are you able to provide me a status variable when the connection is hanging?
When it is not connected to the server, the uC hangs. It also should be async.