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:
    wlan.init(mode=WLAN.STA)
    # configuration below MUST match your home router settings!!
    wlan.ifconfig(config=('192.168.178.107', '255.255.255.0', '192.168.178.1', '8.8.8.8'))

    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 "boot.py", line 6, in <module>

    TypeError: extra positional arguments given

    Have you an idea?

    Thanks.
    Anthony


  • administrators

    Can you please check your firmware version?

    import os
    os.uname()
    

Log in to reply
 

Pycom on Twitter

Looks like your connection to Pycom Forum was lost, please wait while we try to reconnect.