Decoding data from device

Hi

I have tried searching the forum for an answer before posting.
I have added my first device to the server but I struggle a bit with decoding the data. After reading the forum it mention serveral places that it is Base64 encoded but it does not show the correct data when I try to decode it.

I receive an uplink-message and I can see it in “LORAWAN FRAMES” under my device.
The message I receive looks like this:

If I try to decode the frmPayload.0.bytes it does not make any logical data to me.
I find the doc a bit hard to understand when it comes to the decoding. The data is:
“1c16mko84TSEPq0n3Db7dPw231oFFSUy53x3lwIdj3iR”

The device-profile is set with Cayenne LPP as codec (Based on reading the forum).
It would be great if someone can point me in the right direction here.

//Morten

in live frames tab you can’t use that data for decoding.

Ok. I also get the data in Node Red from MQTT. I subscribe to the topic: application/1/device/8966e80000000371/event/up. There my msg.object looks like this:

{
“topic”:“application/1/device/8966e80000000371/event/up”,
“payload”:{
“applicationID”:“1”,
“applicationName”:“Fredrikstad-Test-Applikasjon”,
“deviceName”:“Klima_Kontor_morbog”,
“devEUI”:“8966e80000000371”,
“rxInfo”:[
{
“gatewayID”:“008000000001ab75”,
“uplinkID”:“cbb2539d-2cae-4990-82d8-ed0a764f5557”,
“name”:“GW_01_Hanco”,
“rssi”:-39,
“loRaSNR”:8.2,
“location”:{
“latitude”:59.217738597284296,
“longitude”:10.937876701354982,
“altitude”:0
}
}
],
“txInfo”:{
“frequency”:867500000,
“dr”:0
},
“adr”:true,
“fCnt”:143,
“fPort”:2,
“data”:"+gH3AAUBEQACASsAAO5ALAAA6gAtAADzDS4AAG8nzhB8"
},
“qos”:0,
“retain”:false,
“_msgid”:“87ca1a04.245788”,
“ttl”:0,
“_queuetimestamp”:1607413355454,
“_queueCount”:1
}

Still if I try to decode with base64 for the “data” it gives me no useful data.

sure, from device you getting the byte sequence. write your own decoder regarding the endnode device specs.

Ok. A bit cryptic for me. I come from usin LORIOT server where I receive the data already decoded so I have not digged into the encoding. In the doc for the end device it say i will receive a HEX-formated string.
From the doc of my Vicotee-sensor:

This document is a quick guide to decode VicPack payload from sensors. VicPack is a simple 5 bytes per package in a payload. Since this is a quick guide, we will skip many details about how VicPack is structured and dive right into how to decode the measurement values.

The payload always starts with 0xFA and ends with 0xCE. Some sensors may also send a 16 bits CRC (checksum) at very ends of the payload (after 0xCE).

This is an example of a payload with CRC (0x39DC) at the end, in hex-string. Space between bytes is to make it easier to read. We will use this payload sample throughout the document.

FA 01 00 00 02 01 04 00 00 01 1A 00 00 23 01 CE 39 DC

Following sample is without CRC:

FA 01 00 00 02 01 04 00 00 01 1A 00 00 23 01 CE

So I was expecting to find this HEX-string, not something else.
Sorry for not fully understanding your 1-sentence answers.

@Morbog The data element (“data”:"+gH3AAUBEQACASsAAO5ALAAA6gAtAADzDS4AAG8nzhB8") is a base64 encoded hex byte array. If you plug that data into https://cryptii.com/ you will get the following (screen shot included as well):

fa 01 f7 00 05 01 11 00 02 01 2b 00 00 ee 40 2c 00 00 ea 00 2d 00 00 f3 0d 2e 00 00 6f 27 ce 10 7c

Per the documentation you linked, it appears the payload runs through ce and the final hex bytes are the checksum 10 7c.

Hi @John_Roesler :slight_smile: Thanks for the answer. I figured it out in Node Red last night as well. Not being a developer makes it a bit harder with all the coding and decoding :stuck_out_tongue: but now it is up and running and we can continue testing the Chirpstack to see if it is the correct way for us to go.

2 Likes