Micropython crashing and rebooting every 9seconds

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Cevc
Posts: 10
Joined: Thu Apr 25, 2019 7:54 am

Micropython crashing and rebooting every 9seconds

Post by Cevc » Thu Aug 01, 2019 2:33 pm

Hi All!

About six months ago I started my first micropython project on an esp8266. Everything went smoothly. I flashed micropython on the the board using esptool on a Windows machine, and was instantly up and running in the board. It was running without any issues until roughly a month ago when it started rebooting itself every 9 seconds or so, and is completely unresponsive in between reboots.

I figured the board had gone bad, so I replaced it with a new board (brand new out of the box) and flashed the firmware. To be clear this is completely un-altered, just straight from the official micropython page. But the same thing happened again, reboots every 9 seconds. I then bought a few new board thinking I might have gotten unlucky and gotten a bad batch, but the same thing is still happening. I've now gone through 7 boards, and all of them behave in the same way. I've also tried flashing them using two different PCs, and 4 different versions of the micropython firmware, but it always shows the same result.

My issue is identical to the issue in this post: viewtopic.php?t=5950

However the conclusion here was a faulty board. While still possible, I guess, I can't imagine 3 separate batches of board from 3 different manufacturers would all be failing.

Does anyone have any ideas? Thanks very much in advance!!

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Micropython crashing and rebooting every 9seconds

Post by Roberthh » Thu Aug 01, 2019 3:17 pm

It is unlikely so many boards from different vendors tested with different PCs show the same problem. So let's search for common test components.
- During your tests, did you also change the USB cable?
- Did you try to disable the local WiFi during testing?
- Did you try erasing the flash before loading the firmware?
Edit: Looking at the logs in the link you gave; I see that the reset cause is hardware WDT reset. That's strange, if just the plain firmware was started.

Cevc
Posts: 10
Joined: Thu Apr 25, 2019 7:54 am

Re: Micropython crashing and rebooting every 9seconds

Post by Cevc » Thu Aug 01, 2019 3:35 pm

Hi Roberthh,

Thanks so much for you super fast response!

I did try a few different cables, including the one that worked initially. But thinking back on it, I'm not sure how good the quality of either of those cables is. I will try to get a better cable to test with again!

On the wifi front, no I did not turn off the local wifi. Could this be interfering you think?

Yes, I erased everything before re-flashing each time.

And yes it does seem like the watchdog is acting up, which I find very confusing.

Thanks!!

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Micropython crashing and rebooting every 9seconds

Post by Roberthh » Thu Aug 01, 2019 3:51 pm

What is the flash size of the devices? Sometimes oyu have to specify the flash size during firmware flashing instead of using the detect mode.

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

Re: Micropython crashing and rebooting every 9seconds

Post by pythoncoder » Fri Aug 02, 2019 6:28 am

Have you checked for power supply problems?
Peter Hinch
Index to my micropython libraries.

Cevc
Posts: 10
Joined: Thu Apr 25, 2019 7:54 am

Re: Micropython crashing and rebooting every 9seconds

Post by Cevc » Fri Aug 02, 2019 7:04 am

The flash size is 4MB, but I've only tried with the "detect" setting so far. I'll try to specifically call out the flash size as well.

Regarding the power supply, I've only done this via USB cable plugged into the board from a computer. But I've tried every USB port on every computer. I could try to hook it up to a 3.3v source directly to see if that behaves any differently.

Thank very much, both of you, for your tips. I'll try all of this tonight when I'm back home and report back!

Cevc
Posts: 10
Joined: Thu Apr 25, 2019 7:54 am

Re: Micropython crashing and rebooting every 9seconds

Post by Cevc » Fri Aug 02, 2019 9:10 pm

Hi again,

I've now tried all of your suggestions, but sadly to no avail. Still the same exact issue no matter what I try. I even ordered new cables from Amazon to try, and got a hold of a third computer to try from, but nothing.

The one thing I still want to try is to go somewhere where there is no WiFi at all, because even if I disable my WiFi, there is a lot of interference from neighbouring wifis. Ill try this during the weekend.

Any other ideas? At this point, I'm starting to believe I'm simply cursed...

manseekingknowledge
Posts: 61
Joined: Sun Oct 29, 2017 5:14 pm

Re: Micropython crashing and rebooting every 9seconds

Post by manseekingknowledge » Fri Aug 02, 2019 10:01 pm

Cevc wrote:
Fri Aug 02, 2019 9:10 pm
Hi again,

I've now tried all of your suggestions, but sadly to no avail. Still the same exact issue no matter what I try. I even ordered new cables from Amazon to try, and got a hold of a third computer to try from, but nothing.

The one thing I still want to try is to go somewhere where there is no WiFi at all, because even if I disable my WiFi, there is a lot of interference from neighbouring wifis. Ill try this during the weekend.

Any other ideas? At this point, I'm starting to believe I'm simply cursed...
Can you please post the exact commands you are using to erase and flash the device?

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Micropython crashing and rebooting every 9seconds

Post by Roberthh » Sat Aug 03, 2019 6:11 am

Which version of esptool.py are you using?

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Micropython crashing and rebooting every 9seconds

Post by Roberthh » Sat Aug 03, 2019 8:06 am

I tried to redo what you have done, using a Wemos D1 device. The commands I used are:

Code: Select all

esptool.py --port /dev/ttyUSB0 --baud 460800 erase_flash
esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_size=detect -fm dio 0 esp8266-20190803-v1.11-187-g00e7fe8ab.bin
I have esptool.py in my path, so I do not need to specify that. The version of esptool.py is 2.6.
The output during flashing is:

Code: Select all

esptool.py v2.6
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
MAC: 5c:cf:7f:85:ea:1a
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Flash params set to 0x0240
Compressed 617880 bytes to 402086...
Wrote 617880 bytes (402086 compressed) at 0x00000000 in 9.0 seconds (effective 547.8 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
The result is a stable ESP8266 with MicroPython. I repeated that with the latest stable version. Same result.
What is the upload log of your ffirmware?

Post Reply