The 4s blue flash blues



  • I've got a gpy with a simple lte prgram loaded into flash as main.py (I've removed boot.py). It wakes up, attaches & connects on lte cat M1, uploads a few values, de-connects/attaches then goes to deepsleep for 6 mins. It's supposed to do this indefinitely. Unfortunately the longest I've ever got out of it is 14 hrs. I always find it doing the old 4s blue flash of a regular gpy after it's stopped working. If I cycle the power my program starts again.

    I'm a bit flummoxed on what to do next. Where is this mysterious program that does the 4s blue flash & how is the gpy running it when my main.py program is sitting in flash as the supposedly preferred option of programs to run?



  • @reidfo No I've got everything in try/except loops so it can't crash. This is always when it wakes from deepsleep, instead of running boot or main .py it jumps into dreaded 4s blue flash mode. Grim!



  • @kjm is it getting stuck trying to attach to LTE possibly? If so, do you have the watchdog timer set? I have a few trouble spots in my code that sometimes get stuck as well, so I make sure that in those loops I do not call WDT.feed(), so the board will reset after a few minutes of being in the stuck state.



  • @kjm Loaded my program into both boot.py & main.py Still ends up up in 4s blue flash mode eventually just takes longer, a day or two. Not being able to run the boot/main.py programs reliably after deepsleep is a show stopper for this device if I can't find a fix. Kicking myself now for not testing this thoroughly first before wasting all that time with the LTE.



  • @kjm Paul I moved the gpy back from the battery we're monitoring to the expansion board. I think I can see where it is getting back to the 4s blue flash cycle. When it wakes up from it's 6min deepsleep it prints

    ets Jun  8 2016 00:22:57
    
    rst:0x5 (DEEPSLEEP_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
    

    It's while printing out this wake-from-deepsleep message that it gives a couple of brief blue flashes with an on time about the same as the default 4s blue flash. I think this is where it get's stuck in this mode & fails to finish loading my main.py



  • @kjm Thanks I got it. Will follow up via email.



  • @paul-thornton main.py runs again after a reset Paul, code on the email with link



  • the blue flash is the "heartbeat" and lives in firmware. It can be disabled by

    import pycom
    
    pycom.heartbeat(False)
    

    That said. It doesnt explain why your machine is returning to that state after 14 hours. Does your code begin running again after a reset? Or does it stay missing untill you re upload the code.

    Would you be able to post the code? If you prefer it to be private you can email it to me at paul@pycom.io and include a link to this thread :)



Pycom on Twitter