Example: XBee Gateway with Sensor Device, Cloud Reporting and Notification Configuration

Example:  XBee Gateway with Sensor Device, Cloud Reporting and Notification Configuration


XBee Gateway Setup/Configuration:

  1. Unpack the XBee Gateway device and connect it to Ethernet and Power:         

  2. Create a free device cloud developer account

  3. 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.

  4. Update Gateway Firmware
    Download XBee Gateway - ZigBee (Ethernet and Wifi) Current version and update firmware via the local web interface under Administration > Firmware Update >  Upgrade device operating system.

    User-added image

  5. 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

  6.  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

Enable the python application to auto-start from the web interface under Configuration > Python:

User-added image

  1.  Reboot and check python status in the system log. In this example, the python script failed prior to the firmware update:

User-added image

Set Up Remote Xbee:

  1. Download and Install XCTU

  2. Place the Xbee on Digi Xbee Development Board

    User-added image

  3. Connect the Development Board to a PC using a USB cable

  4. Launch XCTU and locate the device by using the + button at top left.

    User-added image

  5. Update the firmware to the latest ZigBee Router AT

  6. 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

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. 

In our example, we are using a PIR sensor which uses 3 wires:

  1. Power - 5v soldered to pin on back near where USB connects in
  2. Ground - Attached to bottom left connection (pin 10 - GND)
  3. Alarm - Attached to 2nd from top right connection (pin 19 - DI01)
User-added image

Configure Xbee Settings using XCTU:

The settings will cause values to be transmitted when the Digital Input changes value.

  1. In XCTU: Set I/O Settings
  2. 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

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.

User-added image

Set Up Device Cloud Alarm:

Verify data is being received by looking at the Data Services - Data Streams tab:

User-added image

Create a Device Cloud alarm based upon a DataPoint condition:

User-added image

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.

User-added image

Set Up Device Cloud Notification:

Configure a notification to send a notification when the alarm triggers/resets:

User-added image

Example email notification:

User-added image

Last updated: Jan 01, 2024

Recently Viewed

No recently viewed articles

Did you find this article helpful?