-
Notifications
You must be signed in to change notification settings - Fork 836
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
ESP Crashing after upgrading to latest version 2.3 #430
Comments
From the readme.md for Async Webserver:
"You can not use yield or delay or any function that uses them inside the
callbacks"
As of V2, there are delay() calls in most protocols send() routines.
Depending on what you're trying to do, you've got a few workarounds. Either
change the LG end of message gap to zero, or change the threshold in
https://github.com/markszabo/IRremoteESP8266/blob/master/src/IRsend.cpp#L155
to stop delay() calls.
The better approach is to not do the send in the callback. Eg. Set a flag
or add to a queue for the send request, and do the send(s) in the main loop.
…On Tue., 13 Mar. 2018, 9:39 pm arihant daga, ***@***.***> wrote:
Version/revison of the library used
2.3.3
Expected behavior
Version 1 of library was working fine. Today i updated to v 2.3.3 and i
checked ir firing and my esp is crashing everytime it fires a code (right
after firing the code i think).
I am firing this with AsyncWebserver and not in the main loop. So i fire
IR Code in the callback function after recieving http request.
I know that there is a possibility that esp crashes if delay() is very
long. But it was working fine in previous version(Version 1 i guess, in
library.json no version is mentioned).
And i also added this code for safety
ESP.wdtDisable();
irsend.sendLG((unsigned long)actCode,length);
ESP.wdtFeed();
ESP.wdtEnable(5000);
Can anybody point out to me whats wrong here.. ?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#430>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AMInDB8QmNFeX70X8i850QtA2R0Ziv_lks5td7AFgaJpZM4Soh4K>
.
|
Now that I can see the stack trace, this reads more like a language use error/problem. I can't suggest anything more without seeing the real code etc. TL;DR: I think you've got a coding problem based on that stack trace, not a WDT error etc. The delay thing might be a red-herring. Try reducing your code to as simple as possible that still causes the issue, and post that code here. That process may help you see the cause of the error along the way. |
How are you going with this? |
@crankyoldgit Thank you for explaining this.. I dint get a chance to work on it again, so for now i just rolled back to the previous version, But i'll check this soon.. |
Friendly ping. How did you go? |
Still caught up in other things. Will get back to it as soon as possible. :) |
@crankyoldgit I changed the _delayMicroSeconds() function a little bit. So i updated this code
to this one.
Its working fine right now. I tested it with both sendRaw() and Other Protocol based Functions. |
An issue/feature request is probably best. Also, probably best to use a modulus that is much higher than 1000, as each iteration through that loop may lose microseconds with the while/decrement statements. |
Per Issue #430, the use of delay() calls is incompatible with the AsyncWebserver library. Give users of the library a way to send IR messages without the delay() calls which cause it to break the callbacks of AsyncWebserver. This is not without risk as the delay() calls feed the WDT. No delay() calls means the user can easily cause the WDT to reset the ESP8266. Thus the default is to use delay() calls where possible, and make this a compile-time option to try to limit people shooting themselves in the foot.
@arihantdaga Can you please try out the new branch https://github.com/markszabo/IRremoteESP8266/tree/asyncweb-support and let me know if it fixes your issue? I've just added what I think will support what you want to do w.r.t. AsyncWebserver etc. Per the new comments in |
Nice.. Thank you.
…On Fri 4 May, 2018, 8:06 PM David Conran, ***@***.***> wrote:
@arihantdaga <https://github.com/arihantdaga> Can you please try out the
new branch
https://github.com/markszabo/IRremoteESP8266/tree/asyncweb-support and
let me know if it fixes your issue? I've just added what I think will
support what you want to do w.r.t. AsyncWebserver etc.
Per the new comments in IRremoteESP8266.h you'll need to set PREFER_DELAY
to false for your situation.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#430 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEvvTPIVH1wpxFzLbotEzYLcltfTMYufks5tvGdjgaJpZM4Soh4K>
.
|
Did the changes I made work for you? |
Yeah. Working great.
…On Mon, May 7, 2018 at 11:19 AM David Conran ***@***.***> wrote:
Did the changes I made work for you?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#430 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEvvTIkvAO1WBr_Hw4Gg4DCfaSk4CCd6ks5tv-BagaJpZM4Soh4K>
.
--
Regards
Daga Arihant
+91-9052110871
*"Never let anybody tell you, you can't do something. "*
|
Excellent. I'll mark this closed when the PR is merged in. |
Per Issue #430, the use of delay() calls is incompatible with the AsyncWebserver library. Give users of the library a way to send IR messages without the delay() calls which cause it to break the callbacks of AsyncWebserver. This is not without risk as the delay() calls feed the WDT. No delay() calls means the user can easily cause the WDT to reset the ESP8266. Thus the default is to use delay() calls where possible, and make this a compile-time option to try to limit people shooting themselves in the foot.
Merged in to the master branch. Closing this now. |
FYI, the fix was included in the latest offical release of the library. (v2.4.1) |
Version/revison of the library used
2.3.3
Expected behavior
Version 1 of library was working fine. Today i updated to v 2.3.3 and i checked ir firing and my esp is crashing everytime it fires a code (right after firing the code i think).
I am firing this with AsyncWebserver and not in the main loop. So i fire IR Code in the callback function after recieving http request.
I know that there is a possibility that esp crashes if delay() is very long. But it was working fine in previous version(Version 1 i guess, in library.json no version is mentioned).
And i also added this code for safety
Can anybody point out to me whats wrong here.. ?
I am also adding stack trace from esp exception decoder
The text was updated successfully, but these errors were encountered: