problem with wifi init

  • Hi,
    I try to connect the wipy2 to my network but I have always an error on wlan.init()
    I used the code witch is proposed on the pycom documentation

    import machine
    from network import WLAN
    wlan = WLAN() # get current object, without changing the mode

    if machine.reset_cause() != machine.SOFT_RESET:
    # configuration below MUST match your home router settings!!
    wlan.ifconfig(config=('', '', '', ''))

    if not wlan.isconnected():
    # change the line below to match your network ssid, security and password
    wlan.connect('mywifi', auth=(WLAN.WPA2, 'mywifikey'), timeout=5000)
    while not wlan.isconnected():
    machine.idle() # save power while waiting

    the error is
    Traceback (most recent call last):

    File "", line 6, in <module>

    TypeError: extra positional arguments given

    Have you an idea?


  • administrators

    Can you please check your firmware version?

    import os

Log in to reply

Pycom on Twitter