ESP32 In MicroPython: WiFi |
Written by Mike James & Harry Fairhead | ||||
Tuesday, 01 August 2023 | ||||
Page 3 of 3
WiFi ScanThe scan method can be used to survey what access points are available. It returns a list of tuples, each tuple of which has the format: (ssid, bssid, channel, RSSI, security, hidden) where ssid is the usual name of the network, bssid is the MAC address of the access point, channel is the channel number of the access point and RSSI is a relative measure of the strength of the received signal. If your app needs to choose an access point, then picking the one with the highest RSSI is reasonable. The security item is one of: 0 – open 1 – WEP 2 – WPA-PSK 3 – WPA2-PSK 4 – WPA/WPA2-PSK Finally hidden is False if the access point is broadcasting its SSID and True if not. To display the WiFi access points in range you could use: import network wifi = network.WLAN(network.STA_IF) wifi.active(True) wifi.disconnect() aps = wifi.scan() for ap in aps: print(ap) In chapter but not in this extract
Summary
Programming the ESP32in MicroPythonBy Harry Fairhead & Mike JamesBuy from Amazon. ContentsPreface
<ASIN:187196282X>
Comments
or email your comment to: comments@i-programmer.info To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin. |
||||
Last Updated ( Tuesday, 01 August 2023 ) |