Reputation: 21
I have chosen the following setup to read sensor data by Arduino and an XBee-connection:
I have written the code for reading data from Xbee-Explorer at COM4:
#! /usr/bin/python
# Import and init an XBee device
from xbee import XBee, ZigBee
import serial
ser = serial.Serial('COM4', 9600)
xbee = XBee(ser)
while True:
try:
enter response = xbee.wait_read_frame()
print response
except KeyboardInterrupt:
break
ser.close()
At the moment it is not possible to get any data received by the Xbee with the Python code, although it is possible to read the data by XCTU.
In Detail: If I send sensor data (sensor reading and sending to Xbee is done by Arduino Software) from the router to the coordinator, I'm able to read the data frames by XCTU and the results make sense. If I use the Python-code above, I did not get any data frames, although the RSSI-diodes of router and coordinator are blinking independently from the software (XCTU or Python) I use. For me it is not clear what is going wrong and I would be happy to get some help to solve the problem. Thank you very much for your support. Regards Daniel
Upvotes: 0
Views: 577
Reputation: 2231
I had the same problem, changing from API=2 to API=1 solved my problem
Upvotes: 1