ConnectPort X2 TCP Socket -to- XBEE Series1 Data Transfer Basics

Is there a simple example of how to open a TCP socket to the ConnectPort X2 which will send its payload data to a wireless XBEE node?

Is a PYTHON script required to perform this transfer?

Does one need to TELNET to the X2 to transfer this data?

Any help is appreciated.

I have the same question as jyaron, but I camnot downlaod the " ",Please send it to my ,Thanks.

The script would accomplish this task. It creates TCP sockets on your CP-X2 gateway which would correspond to the radios on your PAN. You’d then telnet directly to the TCP socket of whichever radio you wanted to talk to.

I’ve attached a zip with the needed py files and zip archive to support this application. You’ll also need to load the Python Standard Library files, [b]which can be found here[/b].

I have the same question as jyaron, but i’m using a connectport X8. In fact i have the drop in networking starter kit. I’ve ran the script on the connectport with a telnet program, and then with the hyperterminal i connect to the 27001 port, and i got a response from the Xbee development board, but if include another Xbee development board, it doesn’t seem to work. Do i have to run script again and then connect to the 27001 and 27002 ports? Both Xbee development boards are configured as end nodes.

By the way, if i run script i get an error. I will post it on Monday. I would really appreciate if you could give a more detailed explanation about this topic.


1 Like

I am trying to run the on my connectport X4. I am getting the following error.

ImportError: No module named xbee_sensor

I have uploaded the and the new version of python library from the digi webiste as

We are using series 1 Xbee Pro 802.15.4 modules.

could you please help me out.

You only run the script once to create the TCP sockets for the radios on your PAN. You should see the discovered radios and their corresponding TCP sockets listed when you run the script. You would then connect to the socket for the appropriate radio to talk to it directly. is located within the that I attached to an earlier post. Just save the zip, unzip it on your harddrive, upload the files contained in the zip to your ConnectPort X gateway, then start the script from a telnet session to the Gateway.

Saw your posting and thought that this might help. I was trying to get a Python Linux daemon to automatically connect to an XBee-based device via my ConnectPort X2. Spent a lot of time asking the admin dumb questions and got good answers.

I came up with a solution that uses the Python XMLRPC module on the PC to determine the ConnectPort X2 TCP port that corresponds with a particular XBee Device.

I posted my test code in an earlier thread “Digi Python scripts” named “ Control Port”. It’s about the 4th topic from the beginning.

Using the program on the ConnectPort and incorporating the posted test code into my Linux daemon, I gathering samples from an ZBee-based Brultech power monitor across a network.

Hope it helps!

1 Like

I’m new in the forum and i have an CCX2.
Where can i find the I can´t find it.

I also made another posting on this subject under “3rd party Python scripts”. The thread is named “ConnectPort X Test Code”

Hope it helps!


Thankyou for posting your code! The nice thing is, I can click on your username on here and find all your posts so I can get to your script easily. Hopefully I have some time to play with it soon.

The python app and thread itself are from 2008. There have been many improvements across the productline, and a strong integration with our Device Cloud and Cloud Services is well under way.

The script under discussion in this thread is one which is a member of the [“Data Tunneling” category]( target="_blank) of our Python mediawiki. The category itself has several such Data Tunneling scripts, some which support TCP or UDP tunneling, in either direction.

If you go to the [b]“Browse Categories” link[/b] in the left nav, you can see all available Python subjects we cover.

Those who truly want to explore the integration of hardware, software, and M2M Device Cloud computing should click the “Get Started Now” button [b]at this link[/b].

Once your account is Active and you’ve logged in, use the Add Device button to move your Gateway over to your own account. If you aren’t sure how to setup your Digi Gateway to connect to the Device Cloud on the other hand, [b]this is the best place to start.[/b]

Hope those help!


I m not able to find the file. Can someone point me to it?