Example: Turn on an LED on the XBee interface board

To turn on the User LED 4 (DS4) of the XBee Interface Board (XBIB):

  1. Ensure the XBee node you are going to configure is attached to an XBIB device. You will change the status of the User LED 4 (DS4) of the board by modifying the value of the DIO4 of the XBee node because they are connected each other.

  2. From a web browser, go to the Home page of your XBee Gateway web interface.

  3. Under Configuration, click XBee Network. The XBee Configuration page appears.

  4. Click the Discover XBee Devices button to locate the remote XBee devices that are in the same network as XBee Gateway
  5. Click the XBee device that you want to configure.
  6. From the XBee Configuration page, click Input/Output Settings.
  7. Under I/O Pin Settings, configure I/O Pin 4 (AT setting D1) to Digital Output High (5). This way, the DIO4 is configured as output and its value is set to high turning the User LED 4 (DS4) OFF because the LED in the board is using an inverted logic.

    Input/Output Settings example

  8. From a web browser, log in to Remote Manager.

  9. Click Documentation and then click API Explorer. API console appears.
  10. From the API console, select POST HTTP Method and write the following SCI request that includes the set_digital_output command. The set_digital_output command will be sent to the remote XBee node within the RCI do_command element, as follows:

    <sci_request version="1.0">
        <send_message>
            <targets>
                <device id="{device_id}"/>
           </targets>
          <rci_request version="1.1">
             <do_command target="xbgw">
                 <set_digital_output addr="{xbee_mac}" name="DIO4">low</set_digital_output>
             </do_command>
         </rci_request>
      </send_message>
    </sci_request>

    Where:

    • {device_id} is the ID of your XBee Gateway device.

    • {xbee_mac} is the MAC address of the XBee node that you attached to your computer.

    For example:

    <sci_request version="1.0">
        <send_message>
            <targets>
                <device id="00000000-00000000-00409dff-ff5c3BBd"/>
           </targets>
          <rci_request version="1.1">
             <do_command target="xbgw">
                 <set_digital_output addr="0013A2004031A8E1"
                            name="DIO4">low</set_digital_output>
             </do_command>
         </rci_request>
      </send_message>
    </sci_request>

    The set_digital_output command sets the value of the DIO4 to low, which will turn ON the User LED 4 (DS4) of the board.

  11. Click Send.
  12. Verify that the User LED 4 (DS4) on the XBIB board is now ON.
  13. Now try to turn the LED off by sending the same request, but changing the value of the set_digital_output command to high.