EasyManua.ls Logo

Adafruit ESP32-S3 - For Network in Wifi.radio.start_Scanning_Networks(); Network.rssi, Network.channel)); Print(Connecting to %S%Secrets[Ssid]); Print(My MAC Addr:, [Hex(I) for I in Wifi.radio.mac_Address])

Adafruit ESP32-S3
263 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
In order, the example code...
Checks the ESP32's MAC address.
print("My MAC addr:", [hex(i) for i in wifi.radio.mac_address])
Performs a scan of all access points and prints out the access point's name (SSID),
signal strength (RSSI), and channel.
print("Avaliable WiFi networks:")
for network in wifi.radio.start_scanning_networks():
print("\t%s\t\tRSSI: %d\tChannel: %d" % (str(network.ssid, "utf-8"),
network.rssi, network.channel))
wifi.radio.stop_scanning_networks()
Connects to the access point you defined in the secrets.py file, prints out its local IP
address, and attempts to ping google.com to check its network connectivity.
print("Connecting to %s"%secrets["ssid"])
wifi.radio.connect(secrets["ssid"], secrets["password"])
print(print("Connected to %s!"%secrets["ssid"]))
print("My IP address is", wifi.radio.ipv4_address)
ipv4 = ipaddress.ip_address("8.8.4.4")
print("Ping google.com: %f ms" % wifi.radio.ping(ipv4))
©Adafruit Industries Page 146 of 263

Table of Contents

Related product manuals