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()
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
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
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.