network.WLAN(network.STA_IF).connect results in reset loop

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
pithy_prolix
Posts: 3
Joined: Mon Mar 23, 2020 7:16 am

network.WLAN(network.STA_IF).connect results in reset loop

Post by pithy_prolix » Mon Mar 23, 2020 8:54 am

Hello,

Newbie here.

I am trying to connect to a wifi router and it invariably will end up in an endless reset loop. I've tried with 3 different NodeMCU v2 boards, all with the same result. They must be erased & re-flashed.

My script (the ssid and password have been altered, of course):

Code: Select all

import network
import time
    
def connect():
    sta_if = network.WLAN(network.STA_IF)
    sta_if.active(True)
    sta_if.connect('not-the-real-ssid', 'not-the-real-password')
    for i in range(15):
        print(".")
        if sta_if.isconnected():
            break
        time.sleep(1)
    if sta_if.isconnected():
        print("Connection successful")
        print(sta_if.ifconfig())
    else:
        print("Connection could not be made.\n")
        
connect()
It gets into the 3rd or 4th iteration of the 'for' loop, seems to pause for a few seconds, then it goes into an endless reset loop.

Here's the error output with MicroPython v1.9.1:

Code: Select all

MicroPython v1.9.1-8-g7213e78d on 2017-06-12; ESP module with ESP8266
Type "help()" for more information.
>>>
 ets Jan  8 2013,rst cause:4, boot mode:(3,7)

wdt reset
load 0x40100000, len 32000, room 16
tail 0
chksum 0xee
load 0x3ffe8000, len 1104, room 8
tail 8
chksum 0xaa
load 0x3ffe8450, len 3000, room 0
tail 8
chksum 0xc0
csum 0xc0
and with MicroPython v1.12:

Code: Select all

MicroPython v1.12 on 2019-12-20; ESP module with ESP8266
Type "help()" for more information.
>>>
 ets Jan  8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x40100000, len 31088, room 16
tail 0
chksum 0x44
load 0x3ffe8000, len 1028, room 8
tail 12
chksum 0x1e
ho 0 tail 12 room 4
load 0x3ffe8410, len 824, room 12
tail 12
chksum 0x89
csum 0x89
I understand 'wdt' refers to the watchdog timer but I have no idea why it is timing out & resetting the boards.

Notables:
  • When I log into the router it shows the board is connected (the MAC address matches).
  • Same behavior when the boards are attached to a laptop USB port or an externally powered USB hub (nothing else on the hub).
  • The 3 boards were purchased from different sources.
  • All 3 boards appear identical except 2 are printed "Amica" on the bottom and the 3rd has no name.
Sorry if this is a FAQ - I've tried Googling for an answer for quite a while. Any ideas, please?

pithy_prolix
Posts: 3
Joined: Mon Mar 23, 2020 7:16 am

Re: network.WLAN(network.STA_IF).connect results in reset loop

Post by pithy_prolix » Tue Mar 24, 2020 5:40 am

Forgot to add that I have tried 3 different short USB cables, all supposedly high quality, including one that was supplied with one of the boards.

I will try connecting to another wifi router and see what happens ...

pithy_prolix
Posts: 3
Joined: Mon Mar 23, 2020 7:16 am

Re: network.WLAN(network.STA_IF).connect results in reset loop

Post by pithy_prolix » Tue Mar 24, 2020 6:08 am

So, I tried a different router - the wireless hotspot functionality on my phone - and it works!

???

Post Reply