ESP8266 WiFi client behaviour

148 views
Skip to first unread message

Enzo Pontone

unread,
Dec 30, 2020, 8:18:19 AM12/30/20
to thonny

Hi everybody,
please, can anyone explain why this code:

def connectToWifi(SSID, PW):
    wlan = network.WLAN(network.STA_IF)
    wlan.active(True)
    if not wlan.isconnected():
        print("Connecting to network...")
        wlan.connect(SSID, PW)
        while not wlan.isconnected():
            pass
    print('Connection successful')
    mac = ubinascii.hexlify(network.WLAN().config('mac'),':').decode()
    return(wlan.ifconfig())   

client_config = connectToWifi(SSID, PW)
print(client_config)

every few minutes outputs this messages:

>>> bcn_timout,ap_probe_send_start
ap_probe_send over, rest wifi status to disassoc
state: 5 -> 0 (1)
rm 0
pm close 7
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 1
cnt

connected with synwiuninet, channel 6
dhcp client start...
ip:10.0.0.191,mask:255.255.255.0,gw:10.0.0.2
pm open,type:2 0

Please note that other devices (smartphones) connected to the same network works fine.
Thanks.

Aivar Annamaa

unread,
Dec 30, 2020, 10:26:38 AM12/30/20
to thonny
Hi!

I think it's better to ask this at https://forum.micropython.org/

Best regards,
Aivar

Enzo Pontone

unread,
Dec 30, 2020, 5:27:14 PM12/30/20
to thonny
Thanks, I posted it there!
Reply all
Reply to author
Forward
0 new messages