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

Re: Micropython crashing and rebooting every 9seconds

Post by Cevc » Tue Aug 06, 2019 6:31 pm

It finally works!

I disabled the AP network, but left STA on. Now it works, even in my flat, and for most of my planned projects, I'll be connected to the local WiFi anyway, so AP is not needed.

Thanks very much Roberthh, and everyone else for all your help!

Seeing as I now have 7 extra boards lying around, is there any way to alter the boot file before flashing the device? It would be useful to be able to flash them so that AP is off by default.

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 » Tue Aug 06, 2019 7:25 pm

You can do so, but it requires to build your own firmware image. Using Linux, this requires some steps, but is quite straightforward. In the ports/esp8266/modules directory there is a file called _boot.py (take care of the _), which is executed first at boot time.
Being able to make your own image is any advantageous, because it allows to "freeze" python scripts into the firmware. Then they start faster and consume no RAM for the code. And TAM is a precious resource on the ESP8266. The micropython repository is at https://github.com/micropython/micropython, instructions to build the ESP8266 firmware are at https://github.com/micropython/micropyt ... ts/esp8266. Please follow them carefully.
There are also some threads about copying and flashing the file system of an existing device. But making your own image is a more robust approach.
It still would be interesting to know the reason for the crash. Are you able to catch some communication data? Is by chance your router set in the range of 192,168.4.x? Can you run a protocol sniffer in the subnet the esp8266 uses?

Christian Walther
Posts: 169
Joined: Fri Aug 19, 2016 11:55 am

Re: Micropython crashing and rebooting every 9seconds

Post by Christian Walther » Tue Aug 06, 2019 7:33 pm

There is, if you want to rebuild the firmware (it’s done in ports/esp8266/modules/inisetup.py called from _boot.py), but I’m not sure you need to – you can just disable it on the REPL after flashing, and it will stay off.

alanbell
Posts: 8
Joined: Mon Mar 29, 2021 9:50 am

Re: Micropython crashing and rebooting every 9seconds

Post by alanbell » Mon Mar 29, 2021 11:00 am

I am seeing the same issue, I am wondering if the problem is mesh networking, where there are multiple SSIDs with the same name visible. Doesn't require any attempt to connect, just visibility of the mesh seems sufficient to put it in a reboot loop.

megaRXB
Posts: 3
Joined: Thu Apr 29, 2021 3:59 pm

Re: Micropython crashing and rebooting every 9seconds

Post by megaRXB » Thu Apr 29, 2021 4:01 pm

I am having the same problem as Allan. Using a different board, it had the same problem. I haven't yet tried to turn off the "AP", cause I don't know what that is. I will report back if it works for me as well.

megaRXB
Posts: 3
Joined: Thu Apr 29, 2021 3:59 pm

Re: Micropython crashing and rebooting every 9seconds

Post by megaRXB » Thu May 20, 2021 12:20 pm

megaRXB wrote:
Thu Apr 29, 2021 4:01 pm
I am having the same problem as Allan. Using a different board, it had the same problem. I haven't yet tried to turn off the "AP", cause I don't know what that is. I will report back if it works for me as well.
Alright yeah that worked for me as well. Super weird.

Jackli
Posts: 80
Joined: Thu Apr 29, 2021 9:11 am

Re: Micropython crashing and rebooting every 9seconds

Post by Jackli » Tue May 25, 2021 2:15 am

Please update the post if this problem is solved, I think there are many people with the same problem as me waiting for a solution.

Post Reply