Iot data conversion from mqtt topic

Hello,

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]:

00000100020003000000000000000000000000000000000000000000000000000000

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

I see the following json string

{
“data” : “AAABAAIAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==”,
“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.

Ricardo

1 Like

Thank you Ricardo. :smiley:
Nori

1 Like

@programonauta @noriemo hi, i tried to decode the data’AsUPSQgAAEgcAAAAABkAAAAAAAAAAAAAAAAAAAAAAAAAAA==‘and get below result.
it seems decode wrongly.
b’\x02\xc5\x0fI\x08\x00\x00H\x1c\x00\x00\x00\x00\x19\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00’
i don’t know what is the problem

@leapslabs dear developer. could you please help me to solve this problem.
the data ’AsUPSQgAAEgcAAAAABkAAAAAAAAAAAAAAAAAAAAAAAAAAA==‘ is what i get using MQTT.fx.

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
thanks

@ [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.
thanks
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.

Cheers,
TDK

@leapslabs hi leapslabs . thanks for your reply. i have solved this problem.
but i have another problem currently.

now i am trying to change the TX power using shell command utpg & utps. however , when i input them inside the shell window, it shows these command are not existed.

i have no ideas about this. please help me.
thanks a lot

Hi @kuka,

are you sure you are using the official PANS 2.0 release hex file and not the User Application? The User Application is stripped and does not contain these commands.

Cheers,
TDK