Pytrack Wakeup Reason
I am using a Lopy4 board on a pytrack shield. I am trying to find the wakeup reason (https://docs.pycom.io/pytrackpysense/apireference/sleep.html), but the wakeup reason code is always 4 even if I press reset button. Am I doing anything wrong here.
from pytrack import Pytrack
py = Pytrack()
wakeup_reason = py.get_wake_reason()
if(wakeup_reason == 2):
if(wakeup_reason == 4):
print("Pytrack Wakeup reason is " + str(wakeup_reason))
@pvstejeswar Only four reasons are there which are mentioned below. py.get_wake_reason() will not give any reason specifically. As py.setup_sleep(60) is written . So it gives as 4 whatever you do.
WAKE_REASON_ACCELEROMETER = 1
WAKE_REASON_PUSH_BUTTON = 2
WAKE_REASON_TIMER = 4
WAKE_REASON_INT_PIN = 8
@jcaron Thanks for the prompt response, however machine.wake_reason isn't much helpful either for both cases it is returning machine.PWRON_WAKE.