Decrypting messages for dummies

Indeed, you’re sending text. That text happens to be the hexadecimal or even binary representation of the bytes you actually want to send, but: it’s still text. (“Hello world” examples are evil for LoRaWAN.)

Not really. You’ll want to send binary data; bits or bytes. Those don’t care about a human readable representation, such as hexadecimal.

So, the question for the other readers is: how to send bytes using Python?

Aside: JavaScript is not (at all) the same as Java. But if you would have been sending bytes, then your decoder would almost be fine, though you’ll want to check on shifting bytes, so: 8 bits at a time: var gas = bytes[1]<<8 | bytes[0]. And on not using the index [0] multiple times, and support negative temperatures, like explained above too: var temp = (bytes[2]<<24>>16 | bytes[3]) / 100 makes more sense, depending on the Python code you’ll end up with. Also, please see How do I format my forum post? [HowTo].

1 Like