Configure wake up sources
The wake up sources refer to the different mechanisms and triggers used to wake up the device and put it in normal operating mode again when the device is in suspend mode. There are three available wake up sources:
- XBee: wake up the device when any data is received in the XBee interface.
- Serial port: wake up the device when any data is received in the Serial Port.
- RTC alarm: configure an alarm and wake up the device when the alarm triggers.
To configure the different wake up sources, use the digidevice.config Python module as follows:
New API
from digidevice import config
# Load configuration.
cfg = config.load(writable=True)
# Configure the wake up sources:
cfg.set("system.power.wakeup_sources.xbee", True)
#cfg.set("system.power.wakeup_sources.xbee", False)
cfg.set("system.power.wakeup_sources.serial", True)
#cfg.set("system.power.wakeup_sources.serial", False)
cfg.set("system.power.wakeup_sources.rtc", True)
#cfg.set("system.power.wakeup_sources.rtc", False)
# When the RTC alarm wake up source is configured, you have to configure the date/time of the alarm using this format: [YYYY-MM-DD hh:mm:ss]
cfg.set("system.power.wakeup_sources.rtc_time", "YYYY-MM-DD hh:mm:ss")
# Apply and save configuration
cfg.commit()
PDF
