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.
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
Posts: 2276
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: 123
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.

Post Reply