• LoPy updated to 0.9.0.b2
    Following the tutorial for WLAN (section 3.2)
    I an getting an error
    AttributeError: 'module' object has no attribute 'SOFT_RESET'

  • @daniel, I got it working using the code example that @DarkHawk posted here.
    I only added a line wlan.ifconfig(config=('', '', '', ''))
    before nets = plan.scan().

    When I compare the few lines of code I cannot really see the difference. I'm not sure, but the only logical explanation would be a typo in the ssid or password. Of course I confirmed them several times...

    Only issue left is the DNS but that you know about already.

  • Hi kurt,

    Thanks for the report. I confirm that there's a bug on the DNS setting part. I cannot reproduce your reconnect issue yet, but I'll look into it.


  • @Maris I appreciate your work to improve the documentation and your quick response.

    I tried the code you suggested:

    from network import WLAN
    # configure the WLAN subsystem in station mode (the default is AP)
    wlan = WLAN(mode=WLAN.STA)
    # go for fixed IP settings
    wlan.ifconfig(config=('', '', '', ''))
    #wlan.ifconfig(config='dhcp') # trying dhcp
    wlan.scan()     # scan for available networks
    wlan.connect('my-ssid', auth=(WLAN.WPA2, 'my-password'), timeout=5000)
    for i in range(10):
        if wlan.isconnected():

    When I check wlan.ifconfig() it prints ('', '', '', ''). The DNS address is set to 0!
    Then it starts printing reconnect, repeating it endlessly, no timeout. I can stop it by issuing a wlan.disconnect().

    The whole reset sequence using the code above looks like this:

    rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0x00
    mode:QIO, clock div:2
    entry 0x4009f2d8
    frc2_timer_task_hdl:3ffd2704, prio:22, stack:2048
    tcpip_task_hdlxxx : 3ffd7224, prio:18,stack:2048
    pp_task_hdl : 3ffdb494, prio:23, stack:8192
    mode : softAP(24:0a:c4:00:11:c9)
    dhcp server start:(ip:, mask:, gw:
    dhcp server start:(ip:, mask:, gw:
    mode : sta(24:0a:c4:00:11:c8)
    ('', '', '', '')
    MicroPython f5444c7 on 2016-10-12; LoPy with ESP32
    Type "help()" for more information.
    >>> reconnect

    Any idea?

  • @kurt We try to constantly fix mistakes in documentation, so time by time documents get updated.

    Please use code from WiFi example

  • @Maris said in machine.SOFT_RESET:

    Sorry, I don't get it. What is it to be done instead of checking for machine.SOFT_RESET? Or has the documentation in changed again?

    Cheers, Kurt.

  • More observations...

    • Expansion board manual shows use of "GP" values for identifying the IO pins e.g. "GP16", but you actually seem to have to
    • pushbutton on G17, even when set as an input (with a PULL_UP) this pin appears to be driven low (not a fault on the expansion board), so the pushbutton input doesn't work.
    • the heartbeat LED won't show any colour other than Blue.
    • I've not found any means to control timing given the absence of the Timer class - e.g. to get a LoRa node to send a message once every XXX seconds?
    • It is easy to get a crash with LoRa things being in a tight loop (hence the need for some means to control timing):
      /home/danicampora/Code/pycom/esp-idf-new/components/freertos/./queue.c:1326 (xQueueGenericReceive)- assert failed!
      Guru Meditation Error: Core 0 panic'ed.

    Please can we have more documentation e.g.

    • What does the parameter to the LoRa socket recv function do?

  • Hi robotmad,
    Great to hear that you found a solution. Indeed there is a mistake in the example.
    It should be like here:
    We will fix example code.
    Reset cause function not jet implemented on LoPy board. We working on that.

  • Investigating I see that after a soft reset (Ctrl-D) reset_cause() still reports 'None'.

    gives an error:
    TypeError: extra positional arguments given

    Although initialising
    wlan =WLAN(mode=WLAN.STA)
    works OK.

Log in to reply

Pycom on Twitter