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
X4-HMU-U801-A
the xbee module is
XBP9B-DMSTB002
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:

sd = socket(AF_ZIGBEE, SOCK_DGRAM, ZBS_PROT_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

DESTINATION:

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 sd.read function to read the data coming in.

In the given program, replace the sendto function with read function.
sd.read() or sd.recvfrom(buflen).
Refer following link for the syntax, http://www.digi.com/wiki/developer/index.php/XBee_Extensions_to_the_Python_socket_API#recvfrom.28.29