import can
bus = can.Bus(interface='socketcan',
channel='can0',
bitrate=500000)
for msg in bus:
print("{}: {}".format(msg.arbitration_id, msg.data))
As a result of the code above, I get a bytearray with some ascii characters. For example
bytearray(b'@\x1f@\x00\x00\xf4\x00\x00')
bytearray(b'\x00\x90o\x10')
and here below their equivalent.
40 1f 40 00 00 f4 00 00
00 90 6f 10
How can i get pure hex values without "@" and "o" in bytearray?