-
Notifications
You must be signed in to change notification settings - Fork 314
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
Longpoll - non blocking version #143
Comments
I explain it in this video
https://youtu.be/-IC-Z78aTOs
Basically it's good if the trigger for your code to activate is telegram
and not something external like a sensor or button
…On Thu, 13 Feb 2020, 18:25 Fabio Marzocca, ***@***.***> wrote:
My ESP will receive no more than 5 or 6 commands from Telegram in 24
hours, but in such a case, I need a fast response, action and notification.
I have some doubt about using Longpoll. Who can give me Pros & Cons on
Longpoll?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#143?email_source=notifications&email_token=AAL5PQR64HQGDCYFXXI7XRLRCWGCXA5CNFSM4KUYKL3KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4INLHCMA>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAL5PQSNJLAFFB4SXL36GYDRCWGCXANCNFSM4KUYKL3A>
.
|
Thank you Brian,
and I am noticing that everything is slowed down (until timeout) if I use longPoll. On the other hand, without a longPoll, my ESP8266 is constantly sending/receiving bits (the blue led is almost always on). (I have edited my first post) |
Longpool is implemented using busy wait in this library. Attached is modified library. |
@RomanLut , do you mean that with your modified library I could set longPoll freely, without blocking other activities in the loop (such as ArduinoOTA.handle() or server.handleClient()? |
Do not change longPool memeber, it is private now and set to 50 seconds. BTW I have tried to implement bot based on ESPAsyncTCP, but it does not work because TLS 1.2 is not supported by ESPAsyncTCP. api.telegram.org requires TLS 1.2 now. |
OK. I will give it a try and report back here. Should I have just to replace the .cpp and .h library files with yours? |
I got this compiler error:
|
Please double check that you use files from archive above. sendMessage() is properly declared(): |
Yes, I have looked at your code and I have seen it correctly declares the function. |
Fixed. I had to refresh the libry cache |
Tested. Thank you very much, you should issue a Pull Request or fork this library with yours! |
What is the use of disable_notification in sendMessage()? |
You can pass true to disable notification sound. |
Thanks |
Note that this update does not solve all problems. |
Ok, I can accept that short block (<5sec) for my purposes. I hope not to have connection problems (the extender AP is close to the device) and I don't need to send long messages. |
No, I do not have repo and there will be no more updates from me because I will not be using this library (I can not accept any blocking in my device). |
Maybe Brian @witnessmenow can include your mods into the official library... |
@RomanLut I noticed a little delay in responses (about 4-5 seconds). Is it normal or there is a way to expedite it? |
Library maintains single connection because esp8266 does not have enough memory for two secured connections. |
Ok. Could ESP32 be an option to keep 2 connections alive?
|
I do not have experience with ESP32. |
@RomanLut It's a month that I am using your modified library in my device. Once a week it happens that the device gets blocked: it is pingable, but it does not respond to Telegram or send messages. I have tried with FW 2.6.1 and 2.5.3, but it's the same. I have to recycle power. Do you have any idea? |
@RomanLut since today Telegram servers has changed something and the library is not working anymore. I have seen that Brian release v.1.20. Do you have modified your code too? Thanks |
I'm not sure what the current status of this is, is it still worth looking into? |
Yes, I believe it is. I am currently working with Roman's patch.
…On Thu, Oct 1, 2020 at 1:27 AM Brian Lough ***@***.***> wrote:
I'm not sure what the current status of this is, is it still worth looking
into?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#143 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACBCQ3Q64FNMULC523REJCTSIO5FNANCNFSM4KUYKL3A>
.
|
@witnessmenow Brian, is there a chance to embed this mod into the latest library update? The library is generating 25GB of traffic/month with LongPoll=0 and I need to use a non-blocking LongPoll. |
that would be the best, as the roman patch doesn't work with the latest release 1.3.0 and I don't want to lose the benefits of the latest version:
|
My ESP will receive no more than 5 or 6 commands from Telegram in 24 hours, but in such a case, I need a fast response, action and notification.
I have some doubt about using Longpoll. Who can give me Pros & Cons on Longpoll?
In addition, would Long poll in some way delay the execution of other commands in the loop?
I am asking this question because I have noticed that when I set longPoll = 60, my device does not answer anymore to OTA, due to a timeout.
The text was updated successfully, but these errors were encountered: