Serial Communication (xbee.h) with mbed Application Board and Xbee

Items Needed:

  • 2 Xbees configured for comms. If you need to configure them see this tutorial: Xbee Basic Setup
  • 2 mbed Application Boards

Steps:

  1. 1 Set Xbee radios into designated spot on mbed Application Boards and plug into computer: /media/uploads/dannellyz/img_5401.jpg
  2. Verify that the computer recognized the boards by checking the Computer section of your file browser for Devices with removable Storage. They will be named generically for the appBoard, I recommend you change their names based on their corresponding Xbee's configuration. I will be following the assumption that they are correctly named for the remainder of the tutorial. /media/uploads/dannellyz/mbed1.png
  3. Download the following code onto the End Device appBoard:

    Import programserialSend

    Code for the End Device to Send serial strings to a coordinator

  4. Download the following code onto the Coordinator appBoard:

    Import programserialGet

    Code to go on the coordinator to receive serial strings with xbee.h

  5. Change the size of the buffer on either end to send more data or less, but make sure to adhere to set values and keep them equal on either end of communication to avoid transmissions issues.

Notes on xbee.h

  • The lack of robustness and versatility is being addressed with new functions to come that will allow the user to collect a packet up until a certain character terminator.
  • Transmission will cease upon a buffer overflow in the communication. This issue will also be addressed in the updates.


Please log in to post comments.