# What to do with the raw payload via MQTT?

**URL:** <https://www.thethingsnetwork.org/forum/t/what-to-do-with-the-raw-payload-via-mqtt/4889>\
**Category:** Application Development\
**Created:** [January 17, 2017, 9:47am UTC](https://www.thethingsnetwork.org/forum/t/what-to-do-with-the-raw-payload-via-mqtt/4889 "2017-01-17T09:47:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkuemmel](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@mkuemmel](https://www.thethingsnetwork.org/forum/u/mkuemmel)\
**Post date:** [January 17, 2017, 9:47am UTC](https://www.thethingsnetwork.org/forum/t/what-to-do-with-the-raw-payload-via-mqtt/4889/1 "2017-01-17T09:47:07Z")

</div>

Hello everyone,

I tried to receive data sent from my nodes following [this tutorial](https://www.thethingsnetwork.org/docs/applications/nodejs-v1/quick-start.html) 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?

---

<div class="post-metadata">

**Author:** ![arjanvanb](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/arjanvanb/32/46626_2.png) [@arjanvanb](https://www.thethingsnetwork.org/forum/u/arjanvanb)\
**Post date:** [January 17, 2017, 4:42pm UTC](https://www.thethingsnetwork.org/forum/t/what-to-do-with-the-raw-payload-via-mqtt/4889/2 "2017-01-17T16:42:55Z")

</div>

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

The value in `raw: 'BQH/AQAA'` is Base64 encoded and [tells you](http://tomeko.net/online_tools/base64.php?lang=en) that you sent the binary data `0x0501FF010000`.

That _could_ be two numbers sent with 3 bytes each, [LSB](https://en.wikipedia.org/wiki/Least_significant_byte), in which case you could use [the example for decoding coordinates](https://www.thethingsnetwork.org/forum/t/best-practices-when-sending-gps-location-data/1242/14) 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.

---

<div class="post-metadata">

**Author:** ![mkuemmel](https://www.thethingsnetwork.org/forum/letter_avatar_proxy/v4/letter/m/e95f7d/32.png) [@mkuemmel](https://www.thethingsnetwork.org/forum/u/mkuemmel)\
**Post date:** [January 18, 2017, 6:51am UTC](https://www.thethingsnetwork.org/forum/t/what-to-do-with-the-raw-payload-via-mqtt/4889/3 "2017-01-18T06:51:58Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![arjanvanb](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/arjanvanb/32/46626_2.png) [@arjanvanb](https://www.thethingsnetwork.org/forum/u/arjanvanb)\
**Post date:** [January 18, 2017, 11:40am UTC](https://www.thethingsnetwork.org/forum/t/what-to-do-with-the-raw-payload-via-mqtt/4889/4 "2017-01-18T11:40:40Z")

</div>

> [@mkuemmel](#):
>
> echo BQH/AQAA | base64 --decode

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

```
