Iot data conversion from mqtt topic


I am trying to work with iot data. My goal is to send acceleration data over iot.
At the beginning:

I send the following 4 uint16 numbers: 0, 1 , 2, 3 by using the example code from dwm-range-iot

By opening the message Tab of the node properties in the Gateway Web Manager, I see the data coming

Received from node [hex]:


However by opening the MQTT topic dwm/node/c500/uplink/data (c500 is my tag ID)

I see the following json string

“superFrameNumber” : 1021

My question is how to convert the strange data of json string to readable numbers.

Many thanks for your help

Hello @noriemo

Data come in Base64. You must to decode it.


1 Like

Thank you Ricardo. :smiley:

1 Like

@programonauta @noriemo hi, i tried to decode the data’AsUPSQgAAEgcAAAAABkAAAAAAAAAAAAAAAAAAAAAAAAAAA==‘and get below result.
it seems decode wrongly.
i don’t know what is the problem

@leapslabs dear developer. could you please help me to solve this problem.

I could get the correct data in the DRTLS WEB manager. but once i use mqtt.fx to get the IOT data and decode it base64. it has problem. i don’t know why. please help me

@ [Yves_Bernard]@ Kenneth_Dwyer_DW(Profile - Yves_Bernard - Decawave Tech Forum)

1hi ,kenneth and bernard, can you help to answer this question?
may i know how the DRTLS WEB Manager dealing with the IOT data received through MQTT.
thanks. because the data received and showed in the web is correct and the one i need.
thank you

Hello, I think I have a similar issue regarding downlink data. Playing around with the Web Manager and a single-gateway topology I found that hex value “95” is coded as “lQ” but it should be “ld”.

Is it something wrong or I am missing something ?

Thanks a lot!

hi @pvgonzalez , can we discuss to solve this problem together

Hi @kuka, sure we can ! I’m not sure when but I can surely use this feature. I’m don’t recall this is explained in the docs and to be honest I haven’t study the PANS library

Well, it seems that I was doing it wrong. For what is worth I had to convert ASCII to Hex first and then encode to Base64.

Hi @kuka,

@pvgonzalez got it right. The data is Base64 of the hexadecimal string of the payload.