@timeb The data returned by lora.mac() is a 8 byte binary quantity in a bytes object. These bytes may not be printable chars. And it is also not an integer, and can therefore not be printed with the %x specifier. If you want to print it in a ASCII-Hex representation, you have to convert that with ubinascii.hexlify, like you did, and print it with the %s specifier. The results is a string. How you further proceed with the data, is up to you. You could use the binary object or the string.