Now (using, 61fa7c81527016be164321c442fe5317daa260ee), I think I get the same behavior as initially described in this post:
Code: Select all
MicroPython v1.6-327-g61fa7c8 on 2016-03-30; ESP module with ESP8266
Type "help()" for more information.
>>> import network
>>> wlan = network.WLAN(network.STA_IF)
>>> wlan.active()
False
>>> wlan.active(True)
mode : sta(5c:cf:7f:11:62:85) + softAP(5e:cf:7f:11:62:85)
#5 ets_task(40214e78, 28, 3fffad60, 10)
add if0
>>> wlan.active()
True
>>> wlan.connect('xxxx', 'yyyy')
Fatal exception 3(LoadStoreErrorCause):
epc1=0x4000deed, epc2=0x00000000, epc3=0x00000000, excvaddr=0x40000040, depc=0x00000000
ets Jan 8 2013,rst cause:2, boot mode:(1,6)
I tired to figure out, why "connect" seamed to be working before with code from the repository, and so far it looks like so:
When I deploy the firmware from the repository to a clean board (clean flash), or a board that was treated with "esptool.py erase_flash", I get the above behavior.
However when using a board that was previously flashed with ALPHA v02, and had a working (and thus stored connection), then a version deployed from the repo (without doing a flash erase before), is able to use "connect" without a restart. This is even true when connecting to different APs:
Code: Select all
MicroPython v1.6-327-g61fa7c8 on 2016-03-30; ESP module with ESP8266
Type "help()" for more information.
>>> import network
>>> wlan = network.WLAN(network.STA_IF)
>>> wlan.active(True)
>>> wlan.isconnected()
True
>>> wlan.disconnect()
state: 5 -> 0 (0)
rm 0
>>> wlan.connect('aaa', 'bbb')
f r0, >>> scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 26
cnt
connected with aaa, channel 11
dhcp client start...
ip:192.168.x.y,mask:255.255.255.0,gw:192.168.x.y