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
Random WDT Reset with low WiFI Signal #4942
Comments
Are You sure that You get the letter "M" in MCVE (Minimal) right? :-) this does not look like MCVE to me. I don't want to waste my time studying this poorly formatted and hard-to-read code, but as I remember I faced similar problem with weak wifi - try to check wifi status before any outgoing communication - especially when creating new connection. |
@Pablo2048 This is the complete code, I tried to format it but had no luck doing so. The issue defiantly seems to be a result of having poor wireless signal, for testing purposes I have set up a wireless repeater in the workshop and the issue has now vanished however this project is destined to end up in a rather remote location as a stand alone device where there may not be any internet connectivity. What I was thinking is doing a check on the RSSI and either denying access to the user or if its in client mode stopping the unit from connecting to an AP if the signal is below the threshold. I thought I would share this issue mainly because the problem was not obvious and quite random resulting in me chasing ghosts when the problem was a lot less complex than I had thought. And it appears that a few others may have been having the same issue and blaming it on the power supply or other things rather than what has ended up being an RSSI signal issue. |
Can you please try to monitor (and log somewhere) WiFi.status(), RSSI and decode exception dump? |
@Pablo2048 I turn off the repeater I have set up and log the RSSI. What I did see was that as soon as the signal level dropped to below -87 to -91 this is when the WDT would randomly trigger often resulting in either cyclic restarts or the system just stopping. |
Cyclic restarts? Can You check power source (and whole power path to the ESP), try another power supply, add some capacitors, ... |
@Pablo2048 I replaced the PSU, built another one and checked the ripple. Defiantly not that. When I say cyclic restarts, the system will trigger a wdt reset, restart and run for what seems to be anything from 5 minutes to half an hour then do another wdt reset and restart again. |
Ok, so without stack trace decoding and wifi.status monitoring I have no idea what else to do... |
@Pablo2048 working on that now, as these things always go its not throwing the error as quickly as it was earlier. |
Reset Reason: External System WiFi Status: 3 RSSI: ets Jan 8 2013,rst cause:4, boot mode:(1,7) wdt reset |
@Pablo2048 Looks like as soon as the signal drops to about -93 that is when the wdt reset is triggered. |
IMHO boot mode (1,7) is not the good one. |
@Pablo2048 Finally i got a stack dump eset Reason: External System WiFi Status: 3 RSSI: -91 Soft WDT reset ctx: sys
ets Jan 8 2013,rst cause:2, boot mode:(1,6) ets Jan 8 2013,rst cause:4, boot mode:(1,6) wdt reset |
Without ESPException decoder output is this dump useless. Only you on your machine can decode this dump. |
One more hint - try older version of the ESPEXception decoder because of this me-no-dev/EspExceptionDecoder#36 ... |
I gave that a quick try and get no output from the decoder. |
MAIN_page has size of about 27KB, and you are handling it with:
That means that the flash string is being loaded into a String object, which requires a chunk of contiguous mem to hold it. But that's not what caught my eye. You are trying to serve 27KB of static data as a contiguous string. Under extreme bad Wifi signal connection or intermittent connection, transmission slows down to a crawl. What did you think would happen? On a personal note, I really don't understand why so many users think it's a good idea to embed huge html/js/css strings in their sketch, and handle them as strings. My experience shows that it's much better to have the html/css/js in files served from SPIFFS, and have the dynamic data served with e.g.: tiny jsons or whatever. Besides the above, which strictly speaking are user errors, as @Pablo2048 said, the requirement here is for a MCVE sketch, where the M means Minimal, and this is far from that, so closing for now. If you can trim your sketch down to something manageable, please update your post and I'll reopen, or you can just open a new issue, fill in the required info, and link to this one. |
Thank you @devyte I will move the javascript and html in to a file. I ran the unit last night with the WiFi Repeater set up in the workshop giving the unit an average of -49 and the unit is still running with no WDT resets. Once I get this all tweaked up I may see about moving it all to a D1 with an external antenna connection although the housing I designed and built has the NodeMCU installed as high as possible i'm sure a little bit more gain would not hurt. The great thing is this unit is also heading to a low noise environment. I will also take your advice and move everything over to SPIFFS I did that on my IOT Air Compressor and that thing has never had any issues and has been running for a good 9 or so months 24/7. Thank you also to @Pablo2048 :) |
Basic Infos
Platform
Settings in IDE
Problem Description
I have been chasing some random WDT issues for about a week and it appears that the problem is caused when you have a really low WiFi signal or an unstable connection.
My one was running at levels in the -83 down to -91 at times, I was not expecting it to even work that low but to my surprise what seems to happen is the WDT triggers a reboot.
I was receiving both of these at various times.
The only error i seem to be getting is
ets Jan 8 2013,rst cause:4, boot mode:(1,7)
wdt reset
ets Jan 8 2013,rst cause:4, boot mode:(1,6)
wdt reset
I did have a few stack dumps however I was not able to get them converted using the exception decider for some reason and since moving the Nodemcu I don't seem to have received any more.
Initial thought were it may have been caused by power issues, I have installed a 3.3v supply with a 1000uf cap and know the supply will quite happily deliver up to about 2A so that should be more than enough. In addition the control systems for the Fan etc have been optically isolated just to be sure that there were no feedback issues.
The code for this project is quite sizable and has bits all over the place at the moment as it is a work in progress so please keep that in mind. :)
C Sketch
Debug Messages
The text was updated successfully, but these errors were encountered: