How do I use ConnectPort X2e Ethernet/Wifi to receive data send from multiple Xbee RF module?

Hi Guys,

I’m trying to write a python script that enable ConnectPort X2e to receive data sent from multiple Xbee S2 RF module(XB24-ZB). Does any one can give some suggestions about how to start?

The current network configuration is, a ConnectPort X2e gateway as a coordinator to receive data. 2-3 Xbee S2 RF modules are placed at different locations on a room, and keep sending a designated number. What I trying to achieve is to use the Xbee gateway to receive the number sent by those Xbee RF module.

As I know I have to write a python script to make this work, so I would like to ask where can I find related reference documents, tutorials, or examples. Many thanks!

Sure, try using the sample Hello world application in the Python Development kit.

The Hello World sample doesn’t help at all.
it just simply print “Hello World”.
The answer I looking for is, which Xbee Python API(module/funtion) should I use, so that the gateway is able to get data sent by Xbee RF module. However, I already figured it out. Thanks

Hi,

You need to open a socket -
sd = socket(AF_XBEE, SOCK_DGRAM, XBS_PROT_TRANSPORT)
and bind at -
sd.bind((“”, 0xe8, 0, 0))
then use -
payload, src_addr = sd.recvfrom(255)
Now unpack the payload and parse it.

I hope this works.

Any resources for unpacking and parsing?

If you have figured it out, you mind sharing.