|
| 1 | +Synchronous Sleep Sample Application |
| 2 | +====================================== |
| 3 | + |
| 4 | +In a synchronously sleeping DigiMesh network, the MicroPython |
| 5 | +application doesn't control when the module sleeps. If an application |
| 6 | +needs to be aware of when the network sleeps and wakes, it can do so by |
| 7 | +registering a modem status callback and watching for the relevant modem |
| 8 | +statuses. |
| 9 | + |
| 10 | +This sample application demonstrates a module on a synchronously |
| 11 | +sleeping network configured to read a sample from an external sensor and |
| 12 | +send it to an aggregator each time the network wakes. |
| 13 | + |
| 14 | +Requirements |
| 15 | +------------ |
| 16 | + |
| 17 | +To run this example you need: |
| 18 | + |
| 19 | +* Two XBee 3 DigiMesh modules with MicroPython support. |
| 20 | +* Carrier boards for each radio module (XBIB-U-DEV or XBIB-C board). |
| 21 | +* One standalone HDC1080 humidity and temperature sensor (not necessary |
| 22 | + if you are using an XBIB-C carrier board). |
| 23 | + |
| 24 | +Setup |
| 25 | +----- |
| 26 | + |
| 27 | +Set up a synchronously sleeping network with two DigiMesh modules: |
| 28 | + |
| 29 | +* One module is the *aggregator*, and should be configured with the |
| 30 | + following AT commands: |
| 31 | + * **AP** 1 |
| 32 | + * **SM** 7 |
| 33 | + * **SO** 1 |
| 34 | + |
| 35 | +* The other module is the *sensor module* that will run the sample |
| 36 | + application. Make sure the sensor module is on the same network as the |
| 37 | + aggregator (ie ID and CH match on both radios if they have been |
| 38 | + changed from the default), but do not configure sleep settings as that |
| 39 | + will be done by the application. |
| 40 | + |
| 41 | + |
| 42 | +Make sure the hardware is set up correctly on the sensor module: |
| 43 | + |
| 44 | +1. Plug the XBee3 radio module into the XBee adapter and connect it to your |
| 45 | + computer's USB port. |
| 46 | +2. Connect the HDC1080 device to the I2C interface of the XBee module. The way |
| 47 | + to connect the sensor changes depending on the carrier board you have: |
| 48 | + |
| 49 | + * XBIB-U-DEV board: |
| 50 | + |
| 51 | + * Isolate the pins configured as SDA and SCL so they do not use the |
| 52 | + functionality provided by the board. |
| 53 | + * Connect the HDC1080 device to VCC, to the pins configured as SDA and SCL |
| 54 | + and to GND. See the following table for more information about the pins |
| 55 | + layout: |
| 56 | + |
| 57 | + +--------+------------+----------+-----------+-----------+ |
| 58 | + | Signal | Pin ID | Pin # TH | Pin # SMT | Pin # MMT | |
| 59 | + +--------+------------+----------+-----------+-----------+ |
| 60 | + | SDA | PWM1/DIO11 | 7 | 8 | 8 | |
| 61 | + +--------+------------+----------+-----------+-----------+ |
| 62 | + | SCL | AD1/DIO1 | 19 | 32 | 30 | |
| 63 | + +--------+------------+----------+-----------+-----------+ |
| 64 | + |
| 65 | + * XBIB-C board: |
| 66 | + |
| 67 | + * XBIB-C boards already come with an HDC1080 I2C sensor connected to the |
| 68 | + I2C interface of the XBee module, so you don't need to connect anything. |
| 69 | + |
| 70 | + **NOTE**: It is recommended to verify the capabilities of the pins used in |
| 71 | + the example as well as the electrical characteristics in the product manual |
| 72 | + of your XBee Device to ensure that everything is configured correctly. |
| 73 | + |
| 74 | +Run |
| 75 | +--- |
| 76 | + |
| 77 | +Open the aggregator in XCTU's API terminal so you can observe the frames |
| 78 | +output by the module, then compile and launch the application on the |
| 79 | +sensor module. |
| 80 | + |
| 81 | +The sensor module will begin to cyclically sleep: two seconds on, two |
| 82 | +seconds off. Each time the sensor module wakes, it will send a packet to |
| 83 | +the aggregator with the temperature measurement. Observe the |
| 84 | +transmissions received in XCTU. |
| 85 | + |
| 86 | +Required libraries |
| 87 | +-------------------- |
| 88 | + |
| 89 | +* hdc1080 |
| 90 | + |
| 91 | +Supported platforms |
| 92 | +------------------- |
| 93 | + |
| 94 | +* Digi XBee3 DigiMesh 2.4 - minimum firmware version: 300B |
| 95 | + |
| 96 | +License |
| 97 | +------- |
| 98 | + |
| 99 | +Copyright (c) 2020, Digi International, Inc. |
| 100 | + |
| 101 | +Permission is hereby granted, free of charge, to any person obtaining a copy |
| 102 | +of this software and associated documentation files (the "Software"), to deal |
| 103 | +in the Software without restriction, including without limitation the rights |
| 104 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 105 | +copies of the Software, and to permit persons to whom the Software is |
| 106 | +furnished to do so, subject to the following conditions: |
| 107 | + |
| 108 | +The above copyright notice and this permission notice shall be included in all |
| 109 | +copies or substantial portions of the Software. |
| 110 | + |
| 111 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 112 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 113 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 114 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 115 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 116 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 117 | +SOFTWARE. |
0 commit comments