Decode Help on raw packet

OK, I’m an idiot. This is not a Chripstack problem at all, but rather a js/math understanding issue.

I have a payload from a device as seen in the packet logs:

I am trying to do the math on that raw value to get a decoded value out of it. The decoder supplied from the vendor, which works fine has:

    //ADC Channel 0,PA0,units:V
      "0":(bytes[4]<<8 | bytes[5])/1000,
      "1":(bytes[4]<<8 | bytes[5])/1000,
      "2": (bytes[0]<<8 | bytes[1])/1000,
      "3":(bytes[4]<<8 | bytes[5])/1000,
      "4":(bytes[4]<<8 | bytes[5])/1000,
      "5":(bytes[4]<<8 | bytes[5])/1000,      
    }[(bytes[6] & 0x7C)>>2],

Which yields - ADC_CH0V = 2.072

But no matter what I do, I can not figure out how to convert data in the raw value to get that number.

Like I said, not a Chirpstack problem… But I’m trying to more thoroughly learn how the raw value gets converted into the final value by trying to reproduce it by hand. And failing miserably!!! I’ve tried not Base64 decoding it, Base64 decoding it, etc, etc… Always get a different/wrong value.

Any pointers from the experts?

Never mind. :slight_smile:

I took a look at the go function EncryptFRMPayload, and I think I understand now.