Periodically, one wants to send data from the device cloud to an XBee module connected
to a device via the XBee modules Serial port or COM port.
This can be done using the default application that comes with an XBee X2e or Connect port X2e Gateway.
The application is called XBGW.py.
The items used for this example are:
1) XBee Gateway X2e (I am using the XBee WIFI X2e for Zigbee)
2) One XBee ZB S2C module
3) One XBIB-U-DEV Development board (Any USB or RS232 interface board for the XBee can be used
4) A Device Cloud Account that has your X2e provisioned
5) XCTU or some other terminal emulator software in which to receive the incoming serial data
In this article, it is presumed that you already have your X2e provisioned on your account, that the correct drivers
are installed on your PC for your interface board, and that you have a PC application such as XCTU in order to access
the COM port.
Step 1. Power up your gateway and make sure it has a connection to the device cloud. You can verify this by logging into
your device cloud account and checking the devices tab. You should have a blue connection icon next to the device in question.
Step 2. Connect the XBee module to the board and your PC.
Step 3. Launch your terminal emulator software. In this case I am using the XCTU.
Step 4. If you are using XCTU, make sure you are able to see your local XBee module and are on the terminal screen and it is connected.
Step 5. In the device Cloud, under the Documentation tab, select the API Explorer.
Step 6. Select POST.
Step 7. The script you want to use is as follows:
<device id="00000000-00000000-Enter your devices ID here"/>
<send_serial addr="Enter the MAC address of target XBee here "
encoding="base64"> Using Base64, enter the ASCII text you want to send here, I am using SGVsbG8gWEJlZSBXb3JsZA==
The response will look something like:
Out the radio you will see: Hello XBee World
Mar 07, 2019