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.
-
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.
- 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:
Enable the python application to auto-start from the web interface under Configuration > Python:
- Reboot and check python status in the system log. In this example, the python script failed prior to the firmware update:
Set Up Remote Xbee:
-
Download and Install XCTU
-
Place the Xbee on Digi Xbee Development Board
-
Connect the Development Board to a PC using a USB cable
-
Launch XCTU and locate the device by using the + button at top left.
-
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.
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.
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:
Create a Device Cloud alarm based upon a DataPoint condition:
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:
Example email notification:
Last updated:
Dec 16, 2024