py.setup_sleep() & py.go_to_sleep() don't always put PyTrack or PySense to sleep



  • Hi,

    The following code does work ... like 99% of the time ... from all of the long-run tests we've done ... but in ~1% of the time the py.setup_sleep() & py.go_to_sleep() don't always put PyTrack or PySense to sleep ... it just exits to the REPL and waits for the WatchDog to reset the board ...

    CODE:

    delay_min=5
    delay_time=((delay_min*60))
    print('LOG   :: Entering Deep Sleep Mode for ' + str(delay_time) + ' secs')
    pycom.rgbled(off)
    print('LOG   :: @py.setup_sleep(delay_time)')
    py.setup_sleep(delay_time)
    print('DEBUG :: @Feeding Watch Dog')
    wdt.feed()
    print('LOG   :: PyTrack Go To Sleep')
    py.go_to_sleep(gps=False)
    
    ### ADDED THIS BACKUP GO-TO-SLEEP ... IN CASE 1ST ONE FAILS ... to see if it helps ... but it doesn't :-(
    time.sleep(2)
    print('LOG   :: @py.setup_sleep(delay_time) - BackUp')
    py.setup_sleep(delay_time)
    print('LOG   :: PyTrack Go To Sleep - BackUp')
    py.go_to_sleep(gps=False)
    

    LOG:

    LOG   :: Entering Deep Sleep Mode for 300 secs
    LOG   :: @py.DEBUG ::   pulses: [(1, 1331), (0, 1331), (1, 8783), (0, 1330)]
    DEBUG ::   CMD_SETUP_SLEEP: 32
    DEBUG ::   write_data: b' \x13\x01\x00'
    DEBUG :: @Feeding Watch Dog
    LOG   :: PyTrack Go To Sleep
    LOG   :: Waiting for 2 seconds . OK
    LOG   :: @py.setup_sleep(delay_time) - BackUp
    DEBUG :: @setup_sleep(self, time_s)
    DEBUG :: @calibrate_rtc()
    DEBUG ::   CMD_CALIBRATE: 34
    DEBUG ::   pulses: []
    DEBUG ::   CMD_SETUP_SLEEP: 32
    DEBUG ::   write_data: b' \x13\x01\x00'
    LOG   :: PyTrack Go To Sleep - BackUp
    Pycom MicroPython 1.18.2 [v1.8.6-849-07a52e4] on 2019-02-08; FiPy with ESP32
    Type "help()" for more information.
    >>> ets Jun  8 2016 00:22:57
    
    rst:0x7 (TG0WDT_SYS_RESET),boot:0x17 (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:1688
    load:0x4009fa00,len:0
    load:0x4009fa00,len:14592
    entry 0x400a059c
    -----------------------------------------------------------------------------
    LOG   :: Loading XYZ ...
    


  • @jcaron

    what’s the version of the Pytrack firmware?

    pytrack_0.0.8.dfu



  • @combaindeft what’s the version of the Pytrack firmware?


Log in to reply
 

Pycom on Twitter