Help decoding json format

Hi, i would like some help with decoding a sensor i got.
Mosquitto broker recieve:

Device data:


the node is a

it’s sending in message format json in plain text.

I’ve been reading the forum and the how to on decoding but i’m still at zero, any help would be greatly appreciated.

I can paste the lora frame raw information if needed.

You need to base64 decode the data field (beware if you try to copy it from this posting it has been munged with pretty alternate quotes, you will have to substitute true ascii quotes if using a command which needs it quoted)

Once decoded you will find the contents are:


Which seems self-explanatory, apart from being a horribly inefficient way to encode information. Given LoRaWAN’s low bandwidth in longer range situations (your packet report shows the slowest DR0 was used!), a more efficient binary encoding really should be used.

1 Like

Thanks, figured it had something to do with base64.

So, the smaller the message = longer range?

No, but longer range messages need to have small packets, otherwise they take absurdly long on the air - which is any of impolite, an increase in the risk of suffering interference, or in same places outright illegal. Because LoRaWAN has fairly long, fixed-size headers, at the slower data rates just the header can end up consuming most of a reasonable packet duration, leaving only a few bytes (if any) for application data.

Your sensor took something like 18 bytes, to send only 3-4 bytes worth of information.

Allright, i changed my nodes to the standard format but that one doesnt’ seem to use base64 or hex, i should be getting bytes but i get “AAJlkAkB+xsq”, so i guess that needs to be decoded and then i will get bytes that needs to be translated into the proper message i can read?

That’s clearly base64, why do you say it isn’t?

As for the payload contents:

00 02 65 90 09 01 fb 1b 2a

you’ll have to check the node documentation or source code.

Yes it is, i used the wrong base64 decoder.

So i need to convert the base64 to hex to dec, i’m not a coder, could you point me in the right directions on how that java code would look like?

When i use
i can decode the hex into binary, and when i decode binary to decimal i think i get the correct value, but how do i translate this into javascript code? that is the node message format.