WDT reboot on startup relating to WIFI (possibly mesh wifi)

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
alanbell
Posts: 8
Joined: Mon Mar 29, 2021 9:50 am

WDT reboot on startup relating to WIFI (possibly mesh wifi)

Post by alanbell » Mon Mar 29, 2021 10:03 am

I am having an issue flashing micropython to a couple of boards, a D1 mini (probably not a real one) and a slightly bigger nodeMCU board (also generic).
I get a reboot cycle with this output, roughly every 9 seconds:

Code: Select all

 ets Jan  8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x40100000, len 30712, room 16 
tail 8
chksum 0xd5
load 0x3ffe8000, len 996, room 0 
tail 4
chksum 0x2e
load 0x3ffe83f0, len 1064, room 4 
tail 4
chksum 0xfd
csum 0xfd
���o�r��o|�l$ll ��r�l�$�$ ��r�l�l�$`��{�p����$l 
rl��o���b��"�#br�ۄ�p�NN�l��l�l��ll������d �N����Bl$��#��

This is on a laptop USB port, I have tried several laptops, older versions of micropython etc. I also flashed them with tasmota with no issues at all, that works and they can be set up to connect to a wifi hotspot so I don't think the boards are broken. I am flashing with esptool flash mode=dio and I tried the others, also flashing with different versions of esptool.

Finally I turned off the wifi hotspot on my desk, and got straight to a repl prompt! I have a mesh wifi system, so that means there are several hotspots visible with the same SSID name. I am going to continue experimentation, but I think that the issue might be that it is scanning the slightly complex wifi environment and a watch dog timer is tripping without being fed and it reboots.

Anyone else seeing this kind of reboot cycle? Is there a way to disable or extend the watch dog timer?

davef
Posts: 811
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: WDT reboot on startup relating to WIFI (possibly mesh wifi)

Post by davef » Mon Mar 29, 2021 6:45 pm

Are you using the class wdt? When do you start it?

I use
Simple software WDT implementation
which you should find on the forum. I have had to place a lot of error-trapping and print statements in my connect function before I made any head-way towards getting reliable connection. sta_if.status() has been quite helpful.

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

Re: WDT reboot on startup relating to WIFI (possibly mesh wifi)

Post by alanbell » Mon Mar 29, 2021 8:40 pm

I am literally flashing the firmware esp8266-20210202-v1.14.bin and looking to get a repl prompt. I am not running any of my code or modifying anything, I am not attempting to connect it to any wifi, and not connecting to it with anything, it won't boot to a repl prompt in the presence of my home wifi setup.

The wifi I am using is a Tenda MW3 mesh network, it has 3 access points that talk to each other and get signal across the house. In reality it is three separate BSSID networks all with the same SSID, which I suspect is the issue. Will reconfigure the house a bit to attempt to prove exactly what does and doesn't work.

davef
Posts: 811
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: WDT reboot on startup relating to WIFI (possibly mesh wifi)

Post by davef » Mon Mar 29, 2021 9:00 pm

Ah, so you haven't configured any watchdog timer functionality. I think you are seeing timeouts.

Just a thought ... maybe you start off in sta mode and maybe that would give you a chance to do some scanning/debugging.

Good luck!

p.s. maybe it is because the ESP8266 starts up in AP mode?

davef
Posts: 811
Joined: Thu Apr 30, 2020 1:03 am
Location: Christchurch, NZ

Re: WDT reboot on startup relating to WIFI (possibly mesh wifi)

Post by davef » Mon Mar 29, 2021 9:15 pm

In boot.py add:

Code: Select all

import network
sta_if = network.WLAN(network.STA_IF)
and re-boot

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

Re: WDT reboot on startup relating to WIFI (possibly mesh wifi)

Post by Christian Walther » Mon Mar 29, 2021 10:05 pm

Did you erase the flash before installing MicroPython (esptool.py erase_flash)? The ESP8266 remembers in flash whether WiFi was on and what network it was connected to, and tries to restore that at boot. Maybe it has stale information there. On the first boot after erasing the flash (when no filesystem is available and a new one has to be created), the AP interface will be activated, but once you turn it off with network.WLAN(network.AP_IF).active(False), it should stay off. When both interfaces are off, I would expect that at the next boot it shouldn’t even be able to notice whether there is a network around.

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

Re: WDT reboot on startup relating to WIFI (possibly mesh wifi)

Post by alanbell » Mon Mar 29, 2021 11:37 pm

yes, I did erase the flash, multiple times using esptool, didn't seem to work. I turned off the wifi to boot it and turned off AP mode as suggested, and now it works!

I can scan for networks and it does see the three nodes:

>>> sta_if.scan()
[(b'knockatemple', b'\xd82\x14bkq', 6, -56, 3, 0), (b'knockatemple', b'P\x0f\xf5\xab\x91\xa1', 6, -34, 3, 0), (b'knockatemple', b'P\x0f\xf5\xab\x91\x99', 6, -83, 3, 0)]

turning AP back on puts it in the reboot cycle, I get about half a second of responsive prompt so I can paste in the command to turn AP mode off again.

Done the same on both boards, so I am happy to get going, but there does appear to be something odd going on!

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

Re: WDT reboot on startup relating to WIFI (possibly mesh wifi)

Post by alanbell » Tue Mar 30, 2021 12:02 am

Both are now nice and stable, and can connect to the wifi and get data across it with no issues. Just turning on AP mode seems to be the trigger that sends them into a reboot loop, I will try and test that in different wifi environments.

Alan.

Post Reply