[SOLVED] Crashing/freezing every few hours

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
kevinkk525
Posts: 270
Joined: Sat Feb 03, 2018 7:02 pm

Re: Crashing/freezing every few hours

Post by kevinkk525 » Sat Dec 01, 2018 10:38 am

Considering that all this should be implemented in my code and heavily relies on your contribution in that part, I consider my application reliable and stable. The cause for freeze and crash must be outside of the application.
Also mkiotdev's code does not use wifi actively, it just checks periodically and reconnets. There's nothing that should freeze or crash the application.

mkiotdev
Posts: 9
Joined: Sun Nov 11, 2018 9:12 am

Re: Crashing/freezing every few hours

Post by mkiotdev » Wed Dec 26, 2018 11:59 am

Hi guys!

I see there was much activity on this forum when I was partially unavailable. This gives me good feeling about community and platform!

To the subject. Stability or stability + WDT as it was described here remained unchainged, so my setup is stable, small software WDT with timer did the trick. This thread can be marked as SOLVED. I do not mind if board resets itself now or then. My situation is set to the 1 minute pace, process is not fast, it is controlling house heating, so 1 minute for data delivery to outside server is just fine. On the control level, timing is 1 second, but that is another sitiation.

Having stable situation is very extremely important, I think that this software WDT trick should be part of official documentation, it would
save me much of the time. I will look into ways of suggesting that.

Just to comment about WIFI interface. I am using STA, but AP has been active also. After reading your posts, I have just now disabled AP .

kevinkk525
Posts: 270
Joined: Sat Feb 03, 2018 7:02 pm

Re: Crashing/freezing every few hours

Post by kevinkk525 » Wed Dec 26, 2018 12:34 pm

You can mark your post as solved yourself, just edit the first post in the thread and change the subject.

I disabled AP too and that did not improve my stability. Sometimes they are stable 7 days, sometimes they reboot 5 times a day. But as they recover from it, all is good.

User avatar
pythoncoder
Posts: 3157
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

They should never crash.

Post by pythoncoder » Thu Dec 27, 2018 9:43 am

I'm running a test with three ESP8266 devices connected to a server. Each communicates in both directions every five seconds. Code is designed according to the principles in this doc. This test runs 24/7.

I have accumulated some 1500 device hours of running with only one crash. This may have had an electrical cause: currently I'm using generic USB charger adaptors which can be of variable quality. I plan to get some branded Raspbery Pi adaptors designed for 24/7 operation.

I am of the view that properly written ESP8266 applications running on quality hardware do not crash.
Peter Hinch

kevinkk525
Posts: 270
Joined: Sat Feb 03, 2018 7:02 pm

Re: [SOLVED] Crashing/freezing every few hours

Post by kevinkk525 » Thu Dec 27, 2018 10:09 am

Maybe that is the difference, you are using quality hardware. I'm using cheap china NodeMCU with whatever power supply I have laying around. Sometimes they are stable for 7 days, sometimes they get stuck 4 times a day (although the interrupts work, which is weird).
There sure seems to be some external influences too and maybe some power spikes causes them to freeze as well.
The code surely is not the problem as we experienced this kind of behaviour even on the simplest code that is not even using sockets.

User avatar
pythoncoder
Posts: 3157
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Cheap hardware

Post by pythoncoder » Fri Dec 28, 2018 8:11 am

There is no question that hardware quality is very variable, both ESP8266 modules and USB power supplies. I have a USB PSU which works fine for charging phones. It even works for a couple of days running an ESP8266. Then it generates a burst of about 1000 power spikes before resuming normal operation. I also have ESP8266 kit suitable only for landfill.

There are two choices. Buy cheap hardware and waste days tracking down non-existent bugs. Or pay for reliability. Adafruit may not be cheap but their kit works.
Peter Hinch

kevinkk525
Posts: 270
Joined: Sat Feb 03, 2018 7:02 pm

Re: [SOLVED] Crashing/freezing every few hours

Post by kevinkk525 » Fri Dec 28, 2018 8:18 am

True enough but I don't have the money to buy expensive hardware, especially as the price quickly gets close to Raspberry Pis and then I'd definitely buy Raspberry Pis instead of esp8266/esp32. Would the Raspberry Pi Zero W be better available, I'd probably not buy esp32 at all.
Therefore I'm happy to equip my home with NodeMCUs that cost 2.5€ per unit + 1.5€ custom board + ~2€ components (htu21d, buzzer, led) + old and used usb power supplies = 6€ per unit.
For that price I accept that I have to use a software watchdog because the device partly freezes from time to time.

Post Reply