I read UART port with this:
print ("Attempt to Read") readOut = serial_port.readline() time.sleep(1) in_hex = hex(int.from_bytes(readOut,byteorder='big')) print ("Reading: ", in_hex) and then it gives me output e.g. like:
Attempt to Read Reading: 0x6011401011403 So there is one leading zero missing before number 6. I can't find a way to add it without specifying in the code the length of the whole string (and I don't want to do that, becasue the string can have variable length e.g. like 0x056822). Could you please help?