Example: XBee Gateway with Sensor Device, Cloud Reporting and Notification Configuration
XBee Gateway Setup/Configuration:
-
Unpack the XBee Gateway device and connect it to Ethernet and Power:
-
Create a free device cloud developer account
-
Add the device to your account:
From your Device Cloud account; use the Device Management > Devices page to add the device using the MAC address. Use the Serial Number from the label underneath the gateway as the MAC address. After the device connects, the IP address will be displayed. You may need to hit the refresh button to see this. Use the IP address in a browser session to open the local web interface on the gateway device.
-
Update Gateway Firmware
Download XBee Gateway - ZigBee (Ethernet and Wifi) 3.2.12.1 or current version and update firmware via the local web interface under Administration > Firmware Update > Upgrade device operating system.
![User-added image](https://818164.app.netsuite.com/core/media/media.nl?id=434338&c=818164&h=fc7579fc827bd7d76cc4)
-
Update Gateway Xbee Firmware
Download the Module Firmware, from the zip file find the correct ebl file, xbp24c-zb_4059.ebl, and update the local (gateway) XBee's firmware via the local web interface under Administration > Firmware Update > Upgrade local (gateway) XBee's firmware.
![User-added image](https://818164.app.netsuite.com/core/media/media.nl?id=434183&c=818164&h=59b141be429046047c76)
- Upload the Python application files and set to auto-start.
Download the
Xbee Gateway Python Application, unzip the file and use the local web interface to put the files in the WEB/python directory from the web interface under
Administration > File Management > Choose File > Upload file:
![User-added image](https://818164.app.netsuite.com/core/media/media.nl?id=434061&c=818164&h=25cfdb2087743d3f55ff)
Enable the python application to auto-start from the web interface under Configuration > Python:
![User-added image](https://818164.app.netsuite.com/core/media/media.nl?id=434258&c=818164&h=4ee1f2d950ea8e6a6387)
- Reboot and check python status in the system log. In this example, the python script failed prior to the firmware update:
![User-added image](https://818164.app.netsuite.com/core/media/media.nl?id=434155&c=818164&h=e7e983a6aa37a0d6cc25)
Set Up Remote Xbee:
-
Download and Install XCTU
-
Place the Xbee on Digi Xbee Development Board
![User-added image](https://818164.app.netsuite.com/core/media/media.nl?id=434369&c=818164&h=cbd98bb2a30942981b6e)
-
Connect the Development Board to a PC using a USB cable
-
Launch XCTU and locate the device by using the + button at top left.
![User-added image](https://818164.app.netsuite.com/core/media/media.nl?id=434225&c=818164&h=de7c30377be3cddfafc7)
-
Update the firmware to the latest ZigBee Router AT
-
Set the PAN ID to match the XBee Gateway Pan ID (found in the web interface under the Xbee Network page). In XCTU, set the PAN ID and write the setting.
On the XBee Gateway web interface, refresh the Xbee Network page. Click the Discover button if the XBee does not show up as joined.
![User-added image](https://818164.app.netsuite.com/core/media/media.nl?id=434097&c=818164&h=e18108d9c9d46c35d727)
Connect a Sensor to the Development Board:
?This step varies depending upon the sensor. You need to have the specification for the wires attached to the sensor and connect them to the appropriate locations on the dev board. Use a multimeter to verify your voltage and connections before soldering.
In our example, we are using a PIR sensor which uses 3 wires:
- Power - 5v soldered to pin on back near where USB connects in
- Ground - Attached to bottom left connection (pin 10 - GND)
- Alarm - Attached to 2nd from top right connection (pin 19 - DI01)
Configure Xbee Settings using XCTU:
The settings will cause values to be transmitted when the Digital Input changes value.
- In XCTU: Set I/O Settings
- In XCTU: Set I/O Sampling
For the PIR sensor, we need to set the I/O Settings for D1 to Digital Input which is the Alarm pin. We set the I/O Sampling IC bit mask to 2 which indicates that when Digital Input 1 changes, the value will be transmitted.
![User-added image](https://818164.app.netsuite.com/core/media/media.nl?id=434253&c=818164&h=e7e9f538d3c496ae6335)
Use the XCTU console to verify the sensor values are changing as expected. Type
+++ and until you see OK. Then type
atis to get the current values.
Set Up Device Cloud Alarm:
Verify data is being received by looking at the Data Services - Data Streams tab:
![User-added image](https://818164.app.netsuite.com/core/media/media.nl?id=434301&c=818164&h=824772ead0bc09e916f0)
Create a Device Cloud alarm based upon a DataPoint condition:
![User-added image](https://818164.app.netsuite.com/core/media/media.nl?id=434217&c=818164&h=4130e633233f55683945)
Verify that when the condition changes the alarm fires and resets. Make sure the DataPoint condition alarm you just created is selected from the list and click the Alarm Status button to see the details of when your alarm is fired and reset. Be sure to check the Show History box and in the filter options, uncheck the Hide reset alarms box.
Set Up Device Cloud Notification:
Configure a notification to send a notification when the alarm triggers/resets:
![User-added image](https://818164.app.netsuite.com/core/media/media.nl?id=434099&c=818164&h=28c2541d776f7a3bb130)
Example email notification:
Last updated:
Aug 30, 2024