Deep Sleep shield stopped working



  • I have a number of the original LoPy and V1 Expansion boards and the deepsleep shields. I got it working when the ds shield was released but tried today and no go.

    The example code on in the Docs does not work with the current library (1.0.5). The following code does not error but never wakes up. LoPy starts blue flashing when it is meant to be asleep.

    code [Code tags added by @administrators]

    import deepsleep
    
    ds = deepsleep.DeepSleep()
    
    # get the wake reason and the value of the pins during wake up
    wake_s = ds.get_wake_status()
    print(wake_s)
    
    if wake_s['wake'] == deepsleep.PIN_WAKE:
        print("Pin wake up")
    elif wake_s['wake'] == deepsleep.TIMER_WAKE:
        print("Timer wake up")
    else:  # deepsleep.POWER_ON_WAKE:
        print("Power ON reset")
    
    ds.enable_pullups('P17')  # can also do ds.enable_pullups(['P17', 'P18'])
    ds.enable_wake_on_fall('P17') # can also do ds.enable_wake_on_fall(['P17', 'P18'])
    
    ds.go_to_sleep(10)  # go to sleep for 60 seconds 
    

    Result

    Uploading project (main folder)...
    Reading file status
    [1/1] Writing file main.py
    Upload done, resetting board...
    ets Jun  8 2016 00:22:57
    
    rst:0x7 (TG0WDT_SYS_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0xee
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:DIO, clock div:1
    load:0x3fff8028,len:8
    load:0x3fff8030,len:1728
    load:0x4009fa00,len:0
    load:0x4009fa00,len:14584
    entry 0x400a059c
    Booting...
    Telnet server started
    {'P10': 0, 'wake': 0, 'P18': 0, 'P17': 0}
    Pin wake up
    Traceback (most recent call last):
      File "main.py", line 42, in <module>
      File "/flash/lib/deepsleep.py", line 182, in go_to_sleep
      File "/flash/lib/deepsleep.py", line 75, in poke
      File "/flash/lib/deepsleep.py", line 48, in _magic
    KeyboardInterrupt:
    Pycom MicroPython 1.18.0 [v1.8.6-849-046b350] on 2018-06-01; LoPy with ESP32
    Type "help()" for more information.
    >>>
    >>>
    >>> ets Jun  8 2016 00:22:57
    
    rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
    ets Jun  8 2016 00:22:57
    
    rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0xee
    clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
    mode:DIO, clock div:1
    load:0x3fff8028,len:8
    load:0x3fff8030,len:1728
    load:0x4009fa00,len:0
    load:0x4009fa00,len:14584
    entry 0x400a059c
    Booting...
    Telnet server started
    {'P10': 0, 'wake': 0, 'P18': 0, 'P17': 0}
    Pin wake up
    Traceback (most recent call last):
      File "main.py", line 42, in <module>
      File "/flash/lib/deepsleep.py", line 184, in go_to_sleep
      File "/flash/lib/deepsleep.py", line 75, in poke
      File "/flash/lib/deepsleep.py", line 48, in _magic
    KeyboardInterrupt:
    Pycom MicroPython 1.18.0 [v1.8.6-849-046b350] on 2018-06-01; LoPy with ESP32
    Type "help()" for more information.
    >>>
    >>> os.uname()
    (sysname='LoPy', nodename='LoPy', release='1.18.0', version='v1.8.6-849-046b350 on 2018-06-01', machine='LoPy with ESP32', lorawan='1.0.2')
    >>>
    

  • administrators

    @jcaron @jubbs I used my administrative powers to update the above post adding the correct code tags.



  • @jubbs Can you please edit your post and add ``` before and after the code, so it gets properly formatted?


Log in to reply
 

Pycom on Twitter