RAKWireless / WisBlock

Quickstart, tutorials and examples for the RAKwireless WisBlock product line.
https://www.rakwireless.com
MIT License
161 stars 117 forks source link

Decrypted LoRa data appears corrupted? #66

Closed wedgie32 closed 1 year ago

wedgie32 commented 1 year ago

Hi,

I'm using this sketch to push data to Chirpstack v4. It seems the data is getting corrupted on the way through? The payload looks okay:

data:"AQfoFWoAAXMuAABExw=="

but when I try and parse it, I get:

data:"èjs.DÇ"

Not sure how to troubleshoot this?

beegee-tokyo commented 1 year ago

What do you mean with decrypt? The payload AQfoFWoAAXMuAABExw== is Base64 format and already decrypted. Decoding it from Base64 into a byte array results in {0x01, 0x07, 0xe8, 0x15, 0x6a, 0x00, 0x01, 0x73, 0x2e, 0x00, 0x00, 0x44, 0xc7} and depending on which example you use (I am guessing it is the Environment Monitoring) this results into (following the payload description):

0x01 ==> Environment data 0x07 0xe8 ==> temperature = 2024 ==> 20.24 degree C 0x15 0x6a ==> humidity = 5486 ==> 54.86 % RH 0x00 0x01 0x73 0x2e ==> barometric pressure = 95022 ==> 950.22 hPa 0x00 0x00 0x44 0xc7 ==> gas resistance = 17607 = 17607 Ohm

beegee-tokyo commented 1 year ago

Answered in forum

wedgie32 commented 1 year ago

My apologies and thank you for the clear explanation. I've been struggling with some of the LoRa concepts, and the encoding/decoding part was the trickiest. Your explanation has helped me hugely. 👍