Connecting to a Router
-
I am trying the sample code:
from network import WLAN import machine wlan = WLAN(mode=WLAN.STA) wlan.connect(ssid='My_SSID', auth=(WLAN,WPA2, '**********')) while not wlan.isconnected(): machine.idle() print("WiFi connected succesfully") print(wlan.ifconfig())but I get this:
>>> Traceback (most recent call last): File "<stdin>", line 6, in <module> NameError: name 'WPA2' isn't defined > Pycom MicroPython 1.20.2.rc3 [v1.11-2037465] on 2020-02-05; LoPy4 with ESP32 Pybytes Version: 1.3.1 Type "help()" for more information. >>> >>>What does it mean?
I´m sure I put the correctly WiFi credentials.
-
@Erick-Falcon May be refer [WLAN}(https://docs.pycom.io/tutorials/all/wlan/) to connect?
-
@Erick-Falcon you have a typo. It should be
WLAN.WPA2(with a dot), notWLAN,WPA2(with a comma). -
@jcaron you are right, thanks.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login