← index #1946PR #2506
Off-topic · high · value 0.928
QUERY · ISSUE

esp8266: wlan.connect() may crash when there're too many scan results

openby ceremcemopened 2016-03-30updated 2016-06-06
port-esp8266

As a follow up of #1943, wlan.connect function causes reset:

print("naber")
naber
>>> import network
>>> wlan = network.WLAN(network.STA_IF)
>>> wlan.active(True)
>>> wlan.scan()
f r0, scandone
[(b'aktos-elektronik', b'\x00\x1c\xa8\xf7\xe8M', 6, -49, 3, 0), (b'UEM', b'\xf4\xe3\xfb\xbak\xdc', 9, -92, 4, 0), (b'TTNET_HUAWEI_827F', b'\xec#=d\x82\x88', 10, -91, 4, 0)]
>>> wlan.isconnected()
False
>>> wlan.connect("aea", "084DA789BF")
Fatal exception 3(LoadStoreErrorCause):
epc1=0x4000deed, epc2=0x00000000, epc3=0x00000000, excvaddr=0x40000008, depc=0x00000000

 ets Jan  8 2013,rst cause:1, boot mode:(1,7)
CANDIDATE · PULL REQUEST

esp8266/modnetwork.c: Allows AP reconnection without WiFi credentials

closedby puuuopened 2016-10-12updated 2016-11-08

There is no automatic reconnect after wlan.active(False);wlan.active(True). This commit provide the possibility to run wlan.connect() without parameter, to reconnect to the previously
connected AP.

@pfalcon This pull request resolve #2493.

I tested it with

wlan=network.WLAN(network.STA_IF)
wlan.isconnected()
wlan.connect()

and

wlan=network.WLAN(network.STA_IF)
wlan.active(False)
wlan.active(True)
wlan.connect()

Both will reconnect to the previously connected AP without providing WiFi credentials.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied