1

I've managed to read UART input by SLRO and SLR commands from pgpiod, however, SLR returns UART bit-banged data in the following format: [number of read bytes] [bytes]

http://abyz.me.uk/rpi/pigpio/pigs.html#SLR

I need to read this bit-banged uart into a variable in a python script, and I need this data to be in plaintext (real characters), instead of decimal (bytes). How to read data with SLR in Python in such a way, that I can store the data as text in a variable?

0

Perhaps something like

count, data = pi.bb_serial_read(SERIAL_GPIO)

if count > 0:
   my_string = data.decode()
   print(my_string)
  • Does pigpio have the decode function? – Ola Sikora Apr 22 at 9:39
  • decode is standard Python. – joan Apr 22 at 10:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.