kj7
Posts: 5
Joined: Wed Feb 13, 2019 2:18 pm

Serial communication with raspberry pi 3B and Xbee

Sun Mar 24, 2019 3:59 am

:cry: Hello, I'm new to python programming, if I wanted to know if someone can help me with respect to reading a value that I am receiving serially.
In if the topology of my network is based on two parts, in which I have a sensor that sends an analog data by means of an Xbee S2 and is received by another Xbee S2 connected to the raspberry pi 3b.
I use the following code but I receive this information:

b ' '


instead you should receive the value of:

65 or 66

the code that I am using is:

import serial

while True:
ser = serial.Serial('/dev/ttyUSB0', 9600, timeout=1)
resu=ser.readline()
#s=ser.read(6)
print('Resultado: ', resu)

Return to “General discussion”