What's the best way to convert payload to decimal?

Hi there,
I receive the payload information but I want to separate and convert to decimal like to show for example 37 (ºC).
This is possible?

What do you send ? Do you use any encoding format ?

rand.Seed(time.Now().UnixNano() / 10000)
temp := [2]byte{uint8(rand.Intn(25)), uint8(rand.Intn(100))}
pressure := [3]byte{uint8(rand.Intn(2)), uint8(rand.Intn(20)), uint8(rand.Intn(100))}
humidity := [2]byte{uint8(rand.Intn(100)), uint8(rand.Intn(100))}

//Create the payload, data rate and rx info.

payload := byte{temp[0], temp[1], pressure[0], pressure[1], pressure[2], humidity[0], humidity[1]}

You can use the Custom JavaScript Codec Functions in application configuration which allows you to program a simple JS decoder. The data you receive are decrypted and encoded in base 64 so you just have to convert this in decimal.

You are sending a random temperature between 0,00 °C and 25.99°C right ?

It’s possible with a programing in go?

I don’t know.

You can probably add your custom function in loraserver src code but the easiest way is to use the JS pre-script available.

It’s not hard at all, I didn’t know anything about JS and I managed to decode my payload in 30min.

Thanks for your help :slight_smile: