3

I am trying to read the FSR sensor value attached to the RedBearLab Arduino Shield from the Raspberry Pi. I am using RedBearLab example - simplecontrol.

To turn on the sensor reading capability, I need to write to handle 0x000b the value A00100. So after connecting through gatttool, I used below to enable sensor read capability.

[xx:xx:xx:xx:xx:xx][LE]>char-write-cmd 0x000b A00100

I see expected output in the Arduino serial monitor. So I know this enabling works. Pi is reading the sensor but I can't see the value in the prompt.

Then I followed this article, figured out CCC handle (0x000e) and tried below.

$gatttool -b xx:xx:xx:xx:xx:xx -t random --char-write-req --handle=0x000e --value=02 --listen

Seeing below error

Characteristic Write Request failed: Internal application error: I/O

Can anyone please help?

Community
  • 1
  • 1
nad
  • 2,640
  • 11
  • 55
  • 96
  • Can you confirm you can write to the peripheral? usually you will need higher security level. Try adding --sec-level=high or medium to gatttool. You can do it in interactive mode too. Also, turn on btmon to see the exact packets you send/receive both on client and on server (your rasppi). – Isa A Jan 30 '14 at 09:23
  • @meriororen thanks. I can write to a LED attached to the shield. Turn on/off – nad Jan 30 '14 at 16:20
  • @meriororen reading from the sensor doesn't show any value in the prompt. I tried -l high before while reading sensor, but didn't work. Also tried --sec-level=high. Doesn't help. – nad Jan 30 '14 at 16:26
  • @meriororen, not sure what exactly you meant by " turn on btmon to see the exact packets you send/receive .." but in the arduino serial monitor I see analog sensor value. My problem is, how do I see that in the RaspPi? – nad Jan 30 '14 at 17:43
  • 1
    I meant use btmon tool on your Raspberry Pi to see incoming and outcoming hci packets if you are using linux (you do, right?). Thus you will be able to debug it more easily. – Isa A Jan 30 '14 at 18:09

1 Answers1

0

From researching the same issue this was a known bug with Bluetooth at the time and the issue was resolved in later versions of Bluez after 5.28.

Adam
  • 2,762
  • 1
  • 30
  • 32