Xbee in API mode - how do I read a remote Xbee pin

Hi guys,

I have 2 x Xbee configured in ZigBee API mode and using the Python API wrapper to talk to the remote Xbee plugged into an Arduino Uno.

I can successfully send frames to the remote Xbee via a Python CGI script to turn an LED on and off but I don't know how to 'read' the Xbee pin state via the API.

Has anyone played round with the Python Xbee API handler ??

Cheers

Has anyone played round with the Python Xbee API handler ??

Got a link to the python stuff that you want to share?

Sure !

As I said, you have to have the XBee's in API mode for this to work. I should have also added I am using series 2 XBee radios.

Cheers.

What does your sending script look like?

[edit]What is running on the Arduino?[/edit]

What is running on the arduino ? Nothing yet, I am simply trying to get the Xbee to switch one of its digital pins high / low which I will then use to trigger the arduino on on of its digital pins.

I have since found out that it is NOT so easy to read digital I/O state on the XBees....

# Receive samples from the remote device

        self._set_send_samples(True)

        

        while True:

            packet = self.hw.wait_read_frame()

            

            if 'adc-0' in packet['samples'][0]:

                # Stop receiving samples from the remote device

                self._set_send_samples(False)

                return packet['samples'][0]['adc-0'] > XBeeAlarm.DETECT_THRESH

This came from Paul W the creator of the Xbee Python API wrapper. I think I might rethink my requirement to gain pin status feedback in my project.

This is from the example alarm.py (GitHub - niolabs/python-xbee: Python tools for working with XBee radios) at around line 186.