Even this simple code fails:
import network
sta = network.WLAN(network.STA_IF)
sta.active(True)
sta.scan()
sta.connect(‘my ssid’,’my password’)
sta.isconnected()
# I see valid networks here…
sta.ifconfig()
#(‘0.0.0.0’, ‘0.0.0.0’, ‘0.0.0.0’, ‘208.67.222.222’)
Hi Sara, et all
Yet anther attempt to get a WIFI AUTOCONNECT working ….
https://www.youtube.com/watch?v=gGB8iw7R-rM
He provides source code
I have spent 3 days working on this, so far no success
In Thommy the errors I get are:
MicroPython v1.17-12-g26e539a1b on 2021-09-03; ESP module with ESP8266
Type “help()” for more information.
>>> %Run -c $EDITOR_CONTENT
RUN : main.py
Traceback (most recent call last):
File “<stdin>”, line 3, in <module>
File “ConnectWifi.py”, line 13, in connect
NameError: name ‘MicroPython’ isn’t defined
>>>
In PyCharmis get:
RUN: boot.py
RUN : main.py
Traceback (most recent call last):
File “main.py”, line 4, in <module>
File “ConnectWifi.py”, line 22, in connect
KeyboardInterrupt:
MicroPython v1.17-12-g26e539a1b on 2021-09-03; ESP module with ESP8266
Type “help()” for more information.
>>>
What am I doing wrong???
Thanks,
Gary