Replies: 5 comments 26 replies
-
In your first block of code and after # seems more reliable to start with a fresh connect()
if sta_if.isconnected():
sta_if.disconnect()
print('started in the connected state, but now disconnected')
else:
print('started in the disconnected state')
utime.sleep(0.1) |
Beta Was this translation helpful? Give feedback.
-
Outputs
|
Beta Was this translation helpful? Give feedback.
-
Maybe : try:
available_wifi_networks = wifi.scan()
print(f'{available_wifi_networks}')
except OSError as error:
print(f'{error}') |
Beta Was this translation helpful? Give feedback.
-
I don't think f strings are supported in micropython If I remove the f strings
Produces no output |
Beta Was this translation helpful? Give feedback.
-
You should pressed En button,on the board。That can make wifi on。 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
So my apologies upfront if this whole discussion is bogus due to my noobness.
I am completely unfamiliar with ESP32 and Python ... I'm just trying to get my feet wet with the fundamentals.
I am using the Thing Plus C ESP32 from Sparkfun and the Thonny Editor.
I just want to power up the ESP32, and scan to see which wifi networks it can see.
This code will not produce any output when run.
However, I have noticed that if I declare the wifi object, set it's active status to false, sleep the device for 1 second, and then set it back to active it will work as expected and reliably so.
Is this ESP32 unit from Sparkfun faulty? Am I doing something wrong here?
Any and all help greatly appreciated. Cheers.
Beta Was this translation helpful? Give feedback.
All reactions