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 ??
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.