Author Topic: Getting values from BLE  (Read 8 times)

davidgs

  • RFduino Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Getting values from BLE
« on: January 18, 2018, 01:32:47 PM »
I've been playing with this for a while, and I can't seem to find the right solution.

I have a SenseAir k30 CO2 sensor hooked to my RFDuino, and it does a reasonable job of handling that. I get correct readings on the RFDuino Console.

The problem comes when I try to send those values to a connected device.

Code: [Select]
float co2Value = readCO2();
  if (co2Value > 0)
  {
    Serial.print("CO2 Value: ");
    Serial.println(co2Value);
    RFduinoBLE.sendFloat(co2Value);   
  }

Works fine, and if I connect to the RFDuino using the RFDuino Temperature iPhone app -- I modified it and rebuilt it to just display the value received -- it gets the right data.

Here's the thing though. I need to get the values from a Linux box.

Code: [Select]
root@pine64:~# gatttool -b C1:C4:E4:05:14:95 -t random --char-read  --handle=0x000e
Characteristic value/descriptor: 00 80 ee 43
root@pine64:~#

so that's
Code: [Select]
[0, 128, 238, 67]
But the actual reading is 487. Simply adding up the numbers gets me 433, so I'm missing something about how to handle this output.