I am trying to read some sensor data from the DA14583 I just got. For that, I am using a Raspberry Pi 3 Model B which will establish a connection with the sensor.
Using gatttool on the Pi, I was able to connect to the device via bluetooth and I got some values from the temparature sensor (where 0x20 is the handler address of the respective sensor):
> handle: 0x0020, char properties: 0x10, char value handle: 0x0021, uuid: [omitted here]
$ char-read-hnd 0x20
> 10 21 00 06 24 40 3f 18 26 97 b0 bb 44 44 7d 70 89 a7 2e
The problem is, I don't know how to get a human readable temperature value from this.
Over at IBM's I found somecode snippet to convert hex into °C and °F。这是Python,但它可以很容易地converted to, for instance, JavaScript.
But that's for a different sensor and it only takes 4 hex blocks. I've tried it with any sequence from the above 19 hex blocks, but none gave me a reasonable value.
So, does anyone know how to convert these 19 hex blocks into a temparature between 20°C and 25°C (which it assumingly represents)? I'd be really grateful!
Hi mfn,
You will have to convert from hexadecimal values to decimal values or ascii depending on what you send from your device. You will have to be aware what the device sends (in what format, how many values etc) in order to be able to properly interpret that.
Thanks MT_dialog