Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AsyncTelegram2 hangs the uC, when "unable to connect to server" #118

Open
miguelfernando55 opened this issue Aug 9, 2023 · 8 comments
Open

Comments

@miguelfernando55
Copy link

When it is not connected to the server, the uC hangs. It also should be async.

@cotestatnt
Copy link
Owner

Hi @miguelfernando55 .
Which microcontroller is it?

@miguelfernando55
Copy link
Author

esp32-s2-saola.
Here what it is happenning
image
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

@cotestatnt
Copy link
Owner

Thanks for your feedback, I will try to check after 20th August because I am going on vacation from next weekend

@miguelfernando55
Copy link
Author

Ok. Nice holidays. Hope you may upgrade the functionality.

@miguelfernando55
Copy link
Author

miguelfernando55 commented Aug 10, 2023

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.

@cotestatnt
Copy link
Owner

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).

@miguelfernando55
Copy link
Author

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.

@miguelfernando55
Copy link
Author

Are you able to provide me a status variable when the connection is hanging?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants