Skip to content
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

Closed
vidalouiswang opened this issue Feb 27, 2021 · 5 comments
Closed

esp2866 restart couldn't stop #6969

vidalouiswang opened this issue Feb 27, 2021 · 5 comments

Comments

@vidalouiswang
Copy link

vidalouiswang commented Feb 27, 2021

`
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.

@vidalouiswang
Copy link
Author

Codes in net.py almost from offical examples.

@vidalouiswang
Copy link
Author

vidalouiswang commented Feb 27, 2021

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
l dld���;�$�d�� �$���s�l�l�� � l���{�d ǟ

Seems it will restart after connected to AP.

@vidalouiswang
Copy link
Author

vidalouiswang commented Feb 27, 2021

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
l dld���;�$�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.

@peterhinch
Copy link
Contributor

I suggest you raise this support query in the forum rather than in the MicroPython bug tracker.

@vidalouiswang
Copy link
Author

I suggest you raise this support query in the forum rather than in the MicroPython bug tracker.

Okay, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants