Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Connecting to a Router

    Scheduled Pinned Locked Moved Discussion
    4 Posts 3 Posters 49 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • E Offline
      Erick Falcon
      last edited by Erick Falcon

      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.

      J 1 Reply Last reply Reply Quote 0
      • B Offline
        bitvijays
        last edited by

        @Erick-Falcon May be refer [WLAN}(https://docs.pycom.io/tutorials/all/wlan/) to connect?

        1 Reply Last reply Reply Quote -1
        • J Offline
          jcaron @Erick Falcon
          last edited by

          @Erick-Falcon you have a typo. It should be WLAN.WPA2 (with a dot), not WLAN,WPA2 (with a comma).

          E 1 Reply Last reply Reply Quote 1
          • E Offline
            Erick Falcon @jcaron
            last edited by

            @jcaron you are right, thanks.

            1 Reply Last reply Reply Quote 0

            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
            • 1 / 1
            • First post
              Last post

            Pycom on Twitter

            Pycom