Sleep mode is essential to conserve battery life. When the device is sleeping the radio and all non-essential processors and sensors are shut down so they do not consume power. Once asleep there are two events that can cause the device to wake up and transmit data:
A timed cycle where the device wakes up after a specified interval has expired and a sensor reading is taken, transmitted over the radio, and then sleep mode resumes until the timer expires again and so on.
A switch is triggered that causes the device to wake up, transmit the event over the radio and resume sleeping.
Timed Sleep Cycle Command
There are two commands required to set a timed sleep cycle:
- INTVL - The sleep cycle interval (in minutes)
- CYCLE - The command that tells the sensor to enter a cyclic sleep
The two command in the example below set a timed cycle of 5 minutes:
python rf_config.py 03 INTVL005 SENT : 03INTVL005 RECEIVED : 03INTVL005- python rf_config.py 03 CYCLE SENT : 03CYCLE RECEIVED : 03SLEEPING-
Now every 5 minutes the device will wake up and send the sensor data that is associated with the sensor’s type.
The SLEEP command simply puts the RF module to sleep. The device will wake when the button sensor contacts are bridged on the sensor.
Use the INTVL command to set the interval you want to set for the button state to be sent. When the device is put to sleep using the SLEEP command then it will wake every INTVL minutes to report the state (a03STATEON– or a03STATEOFF-) of the button contact.
The example below sets the reporting interval to 25 minutes and puts the device to sleep:
python rf_config.py 03 INTVL025 SENT : 03INTVL025 RECEIVED : 03INTVL025- python rf_config.py 03 SLEEP SENT : 03SLEEP RECEIVED : 03SLEEPING-
Every 25 minutes the state of the button contact will get reported and the device will also wake and transmit when the button contact is bridged, followed by sleep again.
The WAKE command (previously AWAKE command for versions 1 and 2) is used to wake up a sensor. You cannot wake a device without getting physical access to the device to power off and back on (this is a security feature). Once the device is powered back up you have a 5 second internal to issue the WAKE (or AWAKE for version 1 and 2) command.
The steps to wake up a device are as follows:
- Power off and on the device
Send the WAKE command within 5 seconds:
python rf_config.py 03 WAKE SENT : 03WAKE RECEIVED : 03WAKE-----
Send the HELLO command to check if the device is awake
python rf_config.py 03 HELLO SENT : 03HELLO RECEIVED : 03HELLO----
Now the device is awake and available for configuration. You can put the device back to sleep using the CYCLE and SLEEP commands described above.