Home/Support/Support Forum/Bidirectional TCP socket to Xbee Network
New and improved user forum site going live on 12/6 (All users will need to reset their password when the new forum is active)
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Bidirectional TCP socket to Xbee Network

0 votes
Dear Support,

I have a couple of the ConnectPort X2 units that I would like to integrate into one of my projects. The project comprises of 10 Arduino Uno's, Xbee shields with Digi Mesh 900 radios. I'm developing an app running on a Windows machine that will allow communication via the ConnectPort X2 to each of the Xbee nodes, continuously. This will allow for commands to be sent to the remote Arduino via the Xbee network and also allow the remote Xbee to send responses back to the PC.

I would like to setup, if possible the gateway to pass ethernet tcp packets to the xbee network via a broadcast packet on the Xbee's network and the traffic from the Xbee's broadcast traffic to the ethernet tcp network.
I would like to use TCP sockets for reliability over UDP sockets.

I have tried some of the python files but only ever seemed to connect to one Xbee and only allowed traffic in one direction anyway.

I would greatly appreciate any help
asked Apr 21, 2020 in ConnectPort Display by sag007 New to the Community (1 point)

Please log in or register to answer this question.

2 Answers

0 votes

The XBee are not an Ethernet product. They are a Serial based product. The gateway can only create a TCP connection to a device that is on the Ethernet side. The XBee side creates a Serial socket to the devices on the other end. You need to create a Python script and load it on the Gateway that does both sending and receiving of data on both sockets.

Digi Support
answered Apr 21, 2020 by mvut Veteran of the Digi Community (15,515 points)
0 votes
Hi Mvut,

Well aware that Xbee are serial devices and the gateways are Ethernet.

I don’t require a tcp connection direct to an individual device on the Xbee network. All I really need is any packets coming in the tcp socket to the gateway going out the serial to the Xbee network. Also at the same time anything coming in the Xbee network through serial to go out the gateways tcp socket.

Basically I have a number of Arduino nodes with Xbee mesh units in the field. When I need to query the remote nodes I simply establish a tcp socket connection to the gateway and send a packet which is broadcasted on Xbee network, if the node the packet was intended for gets it, it will then send the reply back to the tcp socket via the same path.

I sounded simple and like something this unit would so out of the box, but it appears you have to upload a python script to it. I have found a few different variant of the python script but the traffic only ever goes in one direction if at all.


answered Apr 22, 2020 by sag007 New to the Community (1 point)

I am only aware of samples that do one function or the other.  You are going to have to write a script that uses function from both to do what you want.  


Digi Support