ESP32 WLAN.scan() returns incorrect hidden flag
Hi, new comer to micropython on ESP boards here. Just start to use this and realized the hidden flag in WLAN.scan() result is incorrect.
- The documentation mentioned this flag as
(ssid, bssid, channel, RSSI, authmode, hidden),0 - visible, 1 - hidden; but it's a bool not int. - In my test, all APs in results are always with hidden = False, though apparently the SSID returned is
b''and inwavmonthese are reported as<Hidden SSID>(I mean confirmed as hidden not AP with empty SSID)
uos.uname() = (sysname='esp32', nodename='esp32', release='1.19.1', version='v1.19.1 on 2022-06-18', machine='ESP32 module with ESP32')
network.WLAN(...).scan() on Pico W returns out of range security and hidden parameters
Hi all,
When doing wifi scans, the returned values regularly have values 5 of 7 in security, and values varying from 0 to 8 in hidden; the documentation states security should be 0-4 and hidden should be 0 or 1.
I've tried to go through the source from micropython to the cyw43 pico driver, but I'm not able to identify the issue (as I don't believe I understand the code enough to make a definitive statement). My [poorly informed] assumption is the security values aren't being translated from the CYW43 driver (CYW43_AUTH_), and maybe the hidden variable is getting overrun because it only ever appears to be set to 1 (network_cyw43_scan_cb() in extmod/network_cyw43.c), which would be hidden and should probably be 0 for visible. But neither of those assumptions completely make sense.
I have used two different firmware releases:
- pimoroni-picow-v1.19.10-micropython
- rp2-pico-w-20221118-unstable-v1.19.1-705-gac5934c96
I initially followed the scanning code from this website, and quoting from the website where you can see the example output shows out of range values:
import network #import required module
wlan = network.WLAN(network.STA_IF) #initialize the wlan object
wlan.active(True) #activates the wlan interface
accessPoints = wlan.scan() #perform a WiFi Access Points scan
for ap in accessPoints: #this loop prints each AP found in a single row on shell
print(ap)
'>>> %Run -c $EDITOR_CONTENT
(b'****er-1', b'\xac\x9e\x17k\xd6@', 2, -47, 5, 5)
(b'*********G3P4', b'\xc8Z\x9f\xdc\xa47', 11, -81, 5, 3)
(b'*********TWEB', b'\xcaZ\x9f\xdc\xa47', 11, -80, 5, 2)
And this blog post also mentions unusual output values:
https://dev.webonomic.nl/scanning-network-with-the-raspberry-pi-pico-w
My end goal is to get reliable values to generate logs for wardriving.