Hi All! I'm trying to transfer the DHT22's data through the xbee and Raspberry Pi3. Im using 2 Xbee and 2 Pi3 to do this.And the xbee are set to coordinator API and router API mode with the same PAIN ID.It shows nothing when i plug the coordinator to computer and check the XCTU. How should i fix this problem?
Here's the code of coordinator:
Code:
import serial
ser =serial.Serial("/dev/ttyAMA0", baudrate=9600, timeout=1.0)
while 1:
x=ser.readline()
a = x [15:-1]
if a !='':
print a
And this is the wiring with coordinator and first Pi3.
http://imgur.com/sJdfgec
Code for router api:
Code:
import Adafruit_DHT as dht
import serial
h,t = dht.read_retry(dht.DHT22, 4)
A = 'Tmp=%.1f*C,Hum=%.1f%%' % (t, h)
print a
ser=serial.Serial('/dev/ttyAMA0', baudrate=9600)
ser.write(a)
ser.close()
The wiring for Router API:
http://imgur.com/tz6Ig85