What to do with the raw payload via MQTT?

Hello everyone,

I tried to receive data sent from my nodes following this tutorial on MQTT using Node.js (I’m aware it’s v1, but since the app isn’t v2 yet, it wouldn’t help me anyway)

In that tutorial it seems easy and you get the decrypted message displayed, but everything I receive is

Received message { devEUI: 'mydevEUI',
  fields: { raw: 'BQH/AQAA' },

What am I doing wrong here?

Why do you think something is wrong? What value are you expecting?

The value in raw: 'BQH/AQAA' is Base64 encoded and tells you that you sent the binary data 0x0501FF010000.

That could be two numbers sent with 3 bytes each, LSB, in which case you could use the example for decoding coordinates to get the original values back (which would then be -65275 and 1). But only you know what data your node is sending, and how it encodes it.

1 Like

Uhm… well. My jaw just dropped.
I tried several Base64 decoders since I also thought it should be that easy to decode.
Sadly, all the ones I tried gave empty results or gibberish ( e.g. $ echo BQH/AQAA | base64 --decode ).
That’s why I’ve thought I’d do something terribly wrong here.

Thank you very much for your reply!

I guess you know now, but for future readers, one can pipe the output to hexdump:

echo BQH/AQAA | base64 --decode | hexdump -C
00000000  05 01 ff 01 00 00                                 |......|
00000006
1 Like