Careful, these are numbers denoted in hexadecimal, so you should write a 0x
in front of them to signify that it’s not a decimal number. With the hex digit system being (0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f) corresponding to (0…15). Then see that hex to decimal conversion for 2-digit hex values can be done by writing 16 * left_digit + right_digit
, so:
0x2d
0x2 * 16 + 0xd
2 * 16 + 13
- 32 + 13
- 45
Since these are just different displayed strings from the same underlying numerical value you won’t have to do that conversion in code. Underlying it’s all just integers.
With chirpstack you can provide your own JavaScript decoding logic to have it displayed nicely in the UI. See e.g. forum posts Receiving (decrypted) device data / FRMPayload - #19 by nanomo - ChirpStack Application Server - ChirpStack Community Forum. There you also already get a byte[]
directly and not a Base64 string.
However usually the goal is not to decode the frame payload in Chirpstack anyways, but the integration you have configured in Chirpstack where the data is forwarded to, e.g. a HTTP, InfluxDB, MQTT, Azure, AWS,… (all listed at https://www.chirpstack.io/application-server/integrate/sending-receiving/) server so depending on where the data is pushed to it needs decoding logic in a different language there on the server.