esp2866 restart couldn't stop
` def init(): import net if net.connect('ssid', 'password'): print("ok")
init() ` After running this code, esp8266 will reboot itself(hard reset) won't stop.
net.py: ` import network def connect(ssid,password=None): wlan = network.WLAN(network.STA_IF) wlan.active(True) import machine a = scan(ssid) if a: wlan.connect(ssid, password) while not wlan.isconnected(): machine.idle() return True
def scan(ssid=None): wlan = network.WLAN(network.STA_IF) wlan.active(True) if ssid: a = wlan.scan() for i in a: if i[0] == bytes(ssid,"ascii"): return i else: return wlan.scan() ` Need to erase and flash firmware in esptool will recover.
Codes in net.py almost from offical examples.
I also tried these simple code: ' import network import machine wlan = network.WLAN(network.STA_IF) wlan.active(True) wlan.connect("ssid", "password") wlan.isconnected() `
Here is the result:
`MicroPython v1.14 on 2021-02-02; ESP module with ESP8266
Type "help()" for more information.
import network import machine wlan = network.WLAN(network.STA_IF) wlan.active(True) #7 ets_task(4020ee68, 28, 3fff9e90, 10) wlan.connect("ssid", "password") wlan.isconnected() True ldld
��;�$�d�$��s�l�l�l��{�dǟ
Seems it will restart after connected to AP.
I also tried these simple code: ' import network import machine wlan = network.WLAN(network.STA_IF) wlan.active(True) wlan.connect("ssid", "password") wlan.isconnected() `
Here is the result:
`MicroPython v1.14 on 2021-02-02; ESP module with ESP8266
Type "help()" for more information.
import network import machine wlan = network.WLAN(network.STA_IF) wlan.active(True) #7 ets_task(4020ee68, 28, 3fff9e90, 10) wlan.connect("ssid", "password") wlan.isconnected() True ldld
���;�$�d���$���s�l�l���l���{�dǟSeems it will restart after connected to AP.
Run same code, it recovered itself(won't restart again), I do nothing before that, only unpluged in the board from the cable for about 2mins.
I suggest you raise this support query in the forum rather than in the MicroPython bug tracker.
I suggest you raise this support query in the forum rather than in the MicroPython bug tracker.
Okay, thank you.