DigiMesh Power Management using Pin Sleep example for mbed XBeeLib By Digi
Fork of XBeeZB_power_mngmnt_pin_sleep by
Description
This example characterizes a device that after taking samples from some sensors and sending
the information collected through the radio, does nothing for a long period of time that could
range from several minutes to several hours.
In that long period of inactivity it's not expected to have communication with the coordinator or other remote devices.
The device will not be able to receive packets and should save as much power as possible, therefore the radio is set into low power.
The example does following cycle endlessly:
- Some sensor is read. For demonstration, a counter is incremented.
- For demonstration, a message containing the data collected during sampling stage is sent to a remote device.
- After job has been done the radio will go to sleep:
- First radio is requested to go to sleep. When radio finally sleeps, then the application waits for the time configured in the SLEEP_SECONDS define (40 seconds).
- This time can be increased as desired.
- After that time, the application will awake the radio through the On/Sleep pin and another cycle will start by taking a sample.
Setup
Application
Define RADIO_SLEEP_REQ and RADIO_ON_SLEEP in config.h file according to the mbed micro-controller GPIOs that will be used to control the XBee module power.
Hardware
It's necessary to wire following connections from the mbed micro-controller to the XBee radio according to the configuration done in the application:
- From the mbed micro-controller RADIO_SLEEP_REQ to the XBee module SLEEP_RQ pin (pin 9 on THT modules, pin 10 on SMT modules) will allow the mbed micro-controller to request the radio to sleep or awake.
- From the mbed micro-controller RADIO_ON_SLEEP to XBee module ON/SLEEP# pin (pin 13 on THT modules, pin 26 on SMT modules) will allow the mbed micro-controller to know if the radio is awake or slept.
Demo run
While the demo is running, you will see the frames sent by the XBee module through the serial console terminal.
Verify that the remote device is receiving the frames by accessing the "Console" tab of the XCTU.
If the frames are successfully sent, they will be displayed there, every 40 seconds.
Sensor sample: 0, next sample in 40 seconds Sensor sample: 1, next sample in 40 seconds
Revision 8:2ed4afd4964b, committed 2016-07-29
- Comitter:
- hbujanda
- Date:
- Fri Jul 29 12:15:54 2016 +0200
- Parent:
- 7:adbc169e77b2
- Commit message:
- Automatic upload
Changed in this revision
XBeeLib.lib | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r adbc169e77b2 -r 2ed4afd4964b XBeeLib.lib --- a/XBeeLib.lib Thu Jul 28 10:35:08 2016 +0000 +++ b/XBeeLib.lib Fri Jul 29 12:15:54 2016 +0200 @@ -1,1 +1,1 @@ -http://developer.mbed.org/teams/Digi-International-Inc/code/XBeeLib/#06522f3a6642 +http://developer.mbed.org/teams/Digi-International-Inc/code/XBeeLib/#b5f4a0e92249
diff -r adbc169e77b2 -r 2ed4afd4964b mbed.bld --- a/mbed.bld Thu Jul 28 10:35:08 2016 +0000 +++ b/mbed.bld Fri Jul 29 12:15:54 2016 +0200 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/f9eeca106725 \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/487b796308b0 \ No newline at end of file