Xbee is a great radio module to communicate between devices wireless. Steven shared his extensive work on Xbee communication in API mode which was included in his Masters thesis. His setup uses Xbee module on each end. On one end he connect module to PC with Xbee USB adapter, another part is attached to Arduino.
The fun part begins with software. He’s chosen API mode because there are several advantages over regular modes. It frees from switching in to command mode in order to change configuration options, also message address can be set on fly, messages packets come with RSSI (Received Signal Strength Indicator) and feedback message is sent on successful transmission. He used Digi X-CTU software to work with message frames which is robust on building API frames. Once succeeded Steven moved to python code. He was able to talk to Xbee module by using PySerial library. The code takes care of sending and receiving message frames. Same applies to Arduino part which also has to be able to receive and send message packets in API mode. For those who want to dig deeper, there is a source code available in Github.