Python Forum
Help reading data from serial RS485
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help reading data from serial RS485
#5
Still not working

maybe you can see what is wrong

Sender side python2 :
send = serial.Serial(
    port='/dev/serial0',
    baudrate = 9600,
    parity=serial.PARITY_NONE,
    stopbits=serial.STOPBITS_ONE,
    bytesize=serial.EIGHTBITS,
    timeout=1
while True:
    send.write('test')
    time.sleep(200)
Receiver side Python3:
while True:
    x = ser.read()
    data = str(x) -->not working et the same b'\xbb\x1b\xfe'
    data1 = str(x).decode('utf-8') --> error AttributeError: 'str' object has no attribute 'decode'

    print(data)
    print(data1)
?

Thanks ,
Reply


Messages In This Thread
Help reading data from serial RS485 - by korenron - Nov-10-2021, 02:24 PM
RE: Help reading data from serial RS485 - by korenron - Nov-11-2021, 01:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  pyserial/serial "has no attribute 'Serial' " gowb0w 9 4,932 Aug-24-2023, 07:56 AM
Last Post: gowb0w
Star Pyserial not reading serial.readline fast enough while using AccelStepper on Arduino MartyTinker 4 4,262 Mar-13-2023, 04:02 PM
Last Post: deanhystad
  Reading All The RAW Data Inside a PDF NBAComputerMan 4 1,432 Nov-30-2022, 10:54 PM
Last Post: Larz60+
  help with code for USB-RS485 korenron 3 3,766 Nov-17-2022, 09:04 AM
Last Post: wiseweezer
  Reading Data from JSON tpolim008 2 1,144 Sep-27-2022, 06:34 PM
Last Post: Larz60+
  Help with WebSocket reading data from anoter function korenron 0 1,366 Sep-19-2021, 11:08 AM
Last Post: korenron
  Fastest Way of Writing/Reading Data JamesA 1 2,242 Jul-27-2021, 03:52 PM
Last Post: Larz60+
  Reading data to python: turn into list or dataframe hhchenfx 2 5,472 Jun-01-2021, 10:28 AM
Last Post: Larz60+
  Reading data from mysql. stsxbel 2 2,260 May-23-2021, 06:56 PM
Last Post: stsxbel
  reading canbus data as hex korenron 9 6,425 Dec-30-2020, 01:52 PM
Last Post: korenron

Forum Jump:

User Panel Messages

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