Deep or LightSleep, how do i know if it's my FiPy or my PySense?



  • Hi everyone.

    First time poster :)

    Been looking around in the documentation pages and here on the forum for several hours now, but have not been able to find answers to the following questions, hope someone can help:

    I have a FiPy that i use with the Pysense board. I am a total newbie to Pycom products, so bear over with me. Now i want to know how sleep works, specifially deep or light sleep. What i can't seem to wrap my head around, is which of my pycom products is actually sleeping.

    If i add code: machine.sleep(5000)
    then i'm pretty sure now, that it is only the FiPy that sleeps (lightsleep) for 5 secs. However the LED, which i turned on just before sleeping still is on, why?

    Whereas if i add code: pysense.setup_sleep(5) + pysense.go_to_sleep()
    then it should only be my pysense who sleeps right? Or is it both? (only deepsleep available for the pysense as far as i know?)

    The only sleep i can seem to get working is the machine.sleep() method. However i am having problems waking up using the button on the pysense board. I have tried both of the following methods, but it appears it can't be done with the machine and only the pysense:

    machine.setup_int_pin_wake_up(False) - (according to documentation)

    or

    machine.pin_deepsleep_wakeup(pins = ('P14',), mode = machine.WAKEUP_ANY_HIGH, enable_pull = True)

    Really hope someone can elaborate on my questions, thanks in advance.!

    My test code:
    2da33687-9e3b-4ea8-a4ae-77137229d7d4-image.png

    EDIT: Another thing:

    Just tested with the pysense object instead, where i put the pysense to sleep, and then should be able to wake it up with the button on the pysense print. However i get following output, and it just loops like this:
    757b2f04-bc33-4558-9dd2-47fb5e57cfc9-image.png

    Do i need to somehow tell the pysense that it still must keep the connection from my USB to PC, in order to be able to use the FiPy while Pysense is sleeping?


Log in to reply
 

Pycom on Twitter