Direct communication with single modules in a XBee mesh via RS232 or sockets


I’m wondering if it is feasible to exchange data directly with XBee modules that are arranged in a mesh?
Background: I have some devices that communicate with a PC application via RS232. The application is written in C++ (visualC). The idea is to enhance the devices with XBee modules, but I don’t like to rewrite the whole application. Instead I am wondering if it is possible to map each single module onto a single virtual Comport or TCP/IP socket on the PC.
May be RealPort software in connection with a ConnectPort or a python script on the ConnectPort can do that but I am wondering if this really feasible.


Here is a sample to give you some ideas and get you started

This is a simple add ‘’. You will need to modify the script to include the port you want to use, and the EUI of your XBee, but it will create a socket for a single XBee and present a data connection as a TCP socket.

This is presented as-is, as a sample of how this can be achieved. Use at your own risk. :slight_smile:

Edited: I was going to present a second sample, but I can’t seem to find it now.

Thank you very much. Although I haven’t a clue of python I think I can understand the code. It is a really good starting point and talking through TCP sockets is not difficult to implement in C++. The most important thing is to know that it is possible at all.

That script has to run on a ConnectPort, am I right?