pycom / pycom-micropython-sigfox

A fork of MicroPython with the ESP32 port customized to run on Pycom's IoT multi-network modules.
MIT License
200 stars 166 forks source link

Lopy 4 and Pytrack does not wake up from the sleep. #389

Open nuwanprabhath opened 4 years ago

nuwanprabhath commented 4 years ago

I'm using fllowing code segment to sleep specified amount of time and wake up continously.

from pytrack import Pytrack
from DS3231 import DS3231

print('Starting main')
pycom.rgbled(0xff00)
#     # Init Objects
py = Pytrack()
print('After init pytrack object')

rtc = DS3231()                          # RTC Object
time = rtc.get_time() # Try to get the time as soon as possible
print("Time", time)
for i in range(0,10000):
    pass
print('after wait')
py.setup_int_pin_wake_up() ## run if you want to interupt off the external OI pin 6
print('Setting up wake up pin')
# go to sleep for sleepTime seconds maximum if no accelerometer interrupt happens
py.setup_sleep(720)
print('After sending sleep')
py.go_to_sleep(False) # disable back-up power to the GPS receiver
print('After turning off GPS power')

The output will look similar to this:

Boot
WMAC: 30AEA4EC7CA8
Firmware: 1.20.1.r2
Pybytes: 1.3.0
WARNING! Your sigfox radio configuration (RC) is currently using the default (1)
You can set your RC with command (ex: RC 3): pybytes.set_config('sigfox', {'RCZ': 3})
See all available zone options for RC at https://support.sigfox.com/docs/radio-configura
Connected using Sigfox. Only upload stream is supported
Pybytes connected successfully (using the built-in pybytes library)
Pybytes configuration read from /flash/pybytes_config.json
Starting main
After init pytrack object
6
1
Time (2020, 1, 27, 16, 23, 56, 0, 0)
Previous board is not available anymore

Thank you!

Aryaelektro commented 3 years ago

don't use pin P6 for the wakeup pin, because pin P5, P6, and P7 is used for Lora/sigfox check on it