-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
esp32 heap corruption (caused by brightness calculation?) #734
Comments
backtrace decoded :
|
Still get reboots after erased flash. "Lake" effect seems to speed up crash. |
I have compiled without the file server option and it seems to be stable for now, will report back if it crashes. |
I´m experiencing reboots with the provide esp32 binary since release 0.9.1. I had no such issues with 0.9 b1. |
Still crashed even with file server disabled. Just took a little longer. |
@sansillusion sorry for the issue! Are you using MQTT or the Alexa integration? Sometimes the "Enable MQTT" checkbox in Sync settings is active even though no server is configured. For Alexa, changing the Invocation name from "Light" to something else may help. If you don't use it, I would even recommend completely disabling it. |
None of these settings are activated. I only use sync to sync the esp8266. I will compile a version with everything disabled just to see but I do plan on using other functionality in the future. |
I now tested with MQTT disabled: Same issue, it reboots after 3-10h. I even reboots when it is switchedd to "off" in the GUI. Not sure, if it processes the animations in this case at all. |
If you want to replicate the issue: The time until reboot seems to depend on the effect chosen. When I run the "Pride 2015", it reboots after 1-2h. When I use other, less resource intensive effects, it takes much longer. |
Still crarshes even when all features disabled in compile time. Just take a little longer. Looks like a potential memory leak or maybe multitasking issue. I am just an amateur so I can't really help except by testing. |
I find it funny that my esp8266 is not crashing even with more features enabled. |
I'll have to do some serious debugging to do on this one.... |
I will have to check once I get back home. |
The esp8266 is still going strong without crashes but the esp32 in unstable unfortunately. Current esp32 core version : v3.3.1-61-g367c3c09c |
I have tried multiple different configuration options and it always crashes. |
I also got these in the console : |
These seem to have appeared when I enabled NTP time server. |
Impressive, looks to me you identified the root cause. I disabled the NTP option and have now 10h uptime with continous usage. That was not possible before. I´ll keep you posted how this develops further on. |
Interesting, my ESP32 testing device has 26 days uptime with NTP disabled. Just enabled it and it synced the time successfully. Now we'll see if it reboots. |
I tried disabling NTP yesterday, it did last much longer before a crash but
still crashed 24h later. Much better than before but still a heap issue. I
have done some digging and only found a closed bug report (that was never
fixed) where esp32 Asynchronous web server was found to create a heap
corruption. Someone found that lwip for eap32 is not meant for multi
process, and that a complete rewrite of lwip and many libraries using it
would be necessary. The only solution provided was to expect a heap
corruption after usage. Does not look good to me.
Le jeu. 19 mars 2020 1 h 19 p.m., Aircoookie <notifications@github.com> a
écrit :
… Interesting, my ESP32 testing device has 26 days uptime with NTP disabled.
Just enabled it and it synced the time successfully. Now we'll see if it
reboots.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#734 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHBFDCVSKHSQRY6YF2FNSRTRIJH3PANCNFSM4K5GFO6Q>
.
|
@sansillusion you are right. After enabling NTP yesterday it did not crash for 14 more hours. However I noticed that the free heap was 177776 so I rebooted and right after rebooting the heap was reported as 202028, a 24kB difference that can only be explained with a memory leak. Can you send me the link to that closed issue? |
That is what I found...
espressif/arduino-esp32#1101
|
I see, we´re not yet there. My esp32 rebootet after about 26h (with NTP disabled). |
It looks to me like the issue is partially gone with 0.10! As I don´t need the ntp server, I´m more than happy personally! @Aircoookie: Thanks a lot again for your great work! |
Ok I think I finally found what was my problem. Up till recently they where still crashing regularly. When I changed router to see if it was the issue I also changed some settings in one of my wled device but not the second one. Well turns out deactivating "Auto brightness adjustment" fixed my issue. No more reboot or hang in more than a week after these changes. I just changed the setting in my second device since it was still crashing/rebooting often. Will report back in a while to see if it worked on the second one too this would confirm that for me. |
The only side effect that gives me (it's not a problem at all) is that home assistant reports a current usage of 0ma. Now even running Hyperion for a week it still respond all the time. Btw thanks for your great work again ! You have made such a complete solution for lighting i love it ! |
Thank you for finding a link to the brightness limiter and awesome that you seem to be able to get rid of the problem! |
Go in settings/led preferences and uncheck "Enable automatic brightness limiter" I am noe at over a week without rebooting/hanging. |
@Aircoookie I had it set at 7000 since my power supply is 8A (kept it safe) but realised that with only 61 LED's I could run it at full brightness without risking going over. I decided to turn it off to try to maximize cpu cycles so Hyperion would run as smoothly as possible. Now no more reboot/hang and Hyperion is smooth as f%#&. |
Yep ! I have not had any crash with none of my esp32's ! So it does seem that the feature that calculate the current consumption is part of the issue. If you think you get the issue fixed just let me know I'll give it a test. But I am now extremely happy with WLED ! It's such a complete solution ! And now that I can have home assistant and Hyperion working without a single issue I can keep improving my setup and add more controllers to the mix ! Thanks a lot for your great work. Will do another donation soon. (Next month) |
This is really strange. I don't understand how a simple current calculation can cause a crash. I've been having some crash and WiFi drop problems too so nevertheless, I decided to try this. Sadly, it didn't make any difference for me but what did was turning off Alexa and/or making sure the MCU is properly cleared prior to a clean upload of WLED. More research needed I think. |
I fully agree with @Legsmaniac: My reboot issues are gone since I disabled the "send to Alexa" and "send to hue". I still have the current calculation active all the time and have now uptimes of 20+ days. I also experienced the situation that I had reboot issues even with Alexa disabled after changing and saving some settings. Simply changes something -> changing back -> saving again, solved that issue. My personal conclusions:
Having a backup/restore option for the full set of configuration data would be a great support to further track this down. |
I am not saying that it's a definitive solution for everyone but for me disabling Alexa or Hue, in fact I tried disabling everything I could and nothing worked for me. But now that I have disabled the current limiting feature, everything else is enabled and the esp32's I am running are all stable and very responsive now. Before disabling the current limiting feature, I had some stiffness in Hyperion but now It's live and smooth. |
I must add that after disabling current limiting, my second esp crashed a few hours after but I had not rebooted the device after the change. Once rebooted it stayed connected till today (my fault I rebooted my router trying to find what was that new esp connected to my router, turns out it was my new sonoff switch lol) |
Hey! This issue has been open for quite some time without any new comments now. It will be closed automatically in a week if no further activity occurs. |
HI, thanks for the great code !
I run a esp8266 with 120 ws2812b and file server enabled without issues.
I aslo run a esp32 with 89 ws2812b anf file server enabled but get random reboots.
I have just tried to pull latest mster and recompile using cpu at 160mhz instead of 240 like before and flash at 40mhz instead of 80mhz. It did not fix the issue unfortunately but I had pulled arduino serial monitor just for fun and did not expect anything since I dont have debug enabled but got the following after a little while (mabe 20min)...
I will try erasing flash just in case but I suspect it might be esp32 related.
The text was updated successfully, but these errors were encountered: