4

I'm trying to get the attributes of my bluetooth device (Bluetooth Smart LED Bulb) so that I can control it using Raspberry pi 3 model B, but I got this Invalid File descriptor.

gatttool -b 00:E0:4C:EF:9D:52 -I [00:E0:4C:EF:9D:52][LE]> connect Attempting to connect to 00:E0:4C:EF:9D:52 Connection successful [00:E0:4C:EF:9D:52][LE]> (gatttool:4006): GLib-WARNING **: Invalid file descriptor.

[00:E0:4C:EF:9D:52][LE]> primary Command Failed: Disconnected [00:E0:4C:EF:9D:52][LE]>

rjm
  • 41
  • 1
  • 3

1 Answers1

2

When the bluetooth device disconnects (due to range, signal strength etc) the underlying cleanup process doesn't get invoked properly - hence the invalid descriptor. See this article for more info: http://www.spinics.net/lists/linux-bluetooth/msg63249.html

Simply put the tool doesn't handle unsolicited/unexpected disconnections very well.

Try moving your PI and bulb close to each other, connect with gatttool and then moving further apart - you'll see what I mean.

Nick D
  • 21
  • 1