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]


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?

1 Answer 1


Perhaps something like

count, data = pi.bb_serial_read(SERIAL_GPIO)

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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