-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
esp2866 restart couldn't stop #6969
Comments
Codes in net.py almost from offical examples. |
I also tried these simple code: Here is the result: `MicroPython v1.14 on 2021-02-02; ESP module with ESP8266 Type "help()" for more information.
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. |
Okay, thank you. |
`
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.
The text was updated successfully, but these errors were encountered: