fixed issue of Network object in code.py of example for Arduino Nano RP2040 Connect

CircuitPython version: 9.2.4
This commit is contained in:
I-Tang Chiang (Eden) 2025-02-04 11:34:52 +01:00 committed by GitHub
parent 85c13fcbe3
commit 0b6ed775d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -46,7 +46,7 @@ print("Firmware vers.", esp.firmware_version)
print("MAC addr:", [hex(i) for i in esp.MAC_address])
for ap in esp.scan_networks():
print("\t%s\t\tRSSI: %d" % (str(ap['ssid'], 'utf-8'), ap['rssi']))
print("\t%s\t\tRSSI: %d" % (str(ap.ssid, 'utf-8'), ap.rssi))
print("Connecting to AP...")
while not esp.is_connected:
@ -55,7 +55,7 @@ while not esp.is_connected:
except RuntimeError as e:
print("could not connect to AP, retrying: ", e)
continue
print("Connected to", str(esp.ssid, "utf-8"), "\tRSSI:", esp.rssi)
print("Connected to", str(esp.ap_info.ssid, "utf-8"), "\tRSSI:", esp.ap_info.rssi)
print("My IP address is", esp.pretty_ip(esp.ip_address))
print(