Python Forum
Serial communication with raspberry pi 3B and Xbee
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Serial communication with raspberry pi 3B and Xbee
#1
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)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  MCU reboots after opening Serial port when ran from Raspberry PI zazas321 3 327 Mar-19-2024, 09:02 AM
Last Post: zazas321
  pyserial/serial "has no attribute 'Serial' " gowb0w 9 3,308 Aug-24-2023, 07:56 AM
Last Post: gowb0w
  packet radio communication EmpireAndrew 1 2,154 Nov-01-2019, 06:35 PM
Last Post: micseydel
  WiFi communication Milad 2 2,418 Sep-07-2019, 11:53 AM
Last Post: ndc85430
  Serial Communication Error AlphyOuseph 1 3,491 Feb-07-2019, 07:16 AM
Last Post: DeaD_EyE
  pi3 serial communication tony1812 0 2,126 Sep-23-2018, 10:29 PM
Last Post: tony1812
  python-osc communication fauveboy 10 10,089 Jul-23-2018, 07:49 PM
Last Post: buran
  serial communication write(comand) and read(result) ricardons 1 2,877 Mar-01-2018, 04:26 PM
Last Post: mpd
  Serial communication with a board Bokka 2 5,308 Dec-07-2017, 07:34 AM
Last Post: Bokka
  code pattern for process communication Skaperen 12 8,372 Oct-08-2017, 03:14 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020