How to read IO status from XBEE to connectport X$

I have a CPx4 and a xbee rf module.
I am wanting to read the IO status from the remote module back to the CPx4.
What i think i need to do is send it to the comport of the CPx4 but i cant get my python code to work.

any help would be great!

No, you do not use the COM port on the gateway to collect this data . Instead you use a sd.receive or something of that nature. Try using the Hello world example for your specific XBee version and it will provide you with the proper command to access the radios data.

The x4 is
the xbee module is
I have done the hello word and it dose not tell me anything about any command other than print (’ ')

could you give me an example?

Try this one:

import sys, os
from socket import *

The Format of the tuple is:

(address_string, endpoint, profile_id, cluster_id)

The values for the endpoint, profile_id, and

cluster_id given below are the values used to write

to the serial port on an Ember-based XBee module.

DESTINATION=(“00:0d:6f:00:00:06:89:29!”, 0xe8, 0xc105, 0x11)

Create the socket, datagram mode, proprietary transport:


Bind to endpoint 0xe8 (232):

sd.bind((“”, 0xe8, 0, 0))

Send “Hello, World!” to the destination node, endpoint,

using the profile_id and cluster_id specified in


sd.sendto(“Hello, World!”, 0, DESTINATION)

How do i read/ use the data coming into the x4? I have tried listening but I dont know what port the xbee module in the x4 it is attached to.

You do not need to worry about that. All you need to do is to create the socket as described above and then use the function to read the data coming in.

In the given program, replace the sendto function with read function. or sd.recvfrom(buflen).
Refer following link for the syntax,