cannon-bluetooth-remote icon indicating copy to clipboard operation
cannon-bluetooth-remote copied to clipboard

btgatt-client is deprecated

Open dov opened this issue 2 years ago • 0 comments

I was trying to follow your instructions on a Linux system in order to connect to a Canon EOS R6 camera. But I encountered several problems:

  1. btgatt-client seems to be deprecated. Even so I installed it from source and tried to reproduce the commands run by remote.py but it failed. I'm not very familiar with bluetooth so perhaps I'm doing something wrong. Do you have any idea what happens and what "Invalid handle (0x01) means?
$ btgatt-client -d -d 74:38:B7:48:52:CB
Connecting to device... Done
[GATT client]# Service Added - UUID: 00001801-0000-1000-8000-00805f9b34fb start: 0x0008 end: 0x0008
[GATT client]# Service Added - UUID: 00001800-0000-1000-8000-00805f9b34fb start: 0x0001 end: 0x0007
[GATT client]# Service Added - UUID: 0000180a-0000-1000-8000-00805f9b34fb start: 0x0009 end: 0x0011
[GATT client]# Service Added - UUID: 00050000-0000-1000-0000-d8492fffa821 start: 0x0012 end: 0xffff
[GATT client]# GATT discovery procedures complete
[GATT client]#
service - start: 0x0001, end: 0x0007, type: primary, uuid: 00001800-0000-1000-8000-00805f9b34fb
          charac - start: 0x0002, value: 0x0003, props: 0x02, ext_props: 0x0000, uuid: 00002a00-0000-1000-8000-00805f9b34fb
          charac - start: 0x0004, value: 0x0005, props: 0x02, ext_props: 0x0000, uuid: 00002a01-0000-1000-8000-00805f9b34fb
          charac - start: 0x0006, value: 0x0007, props: 0x02, ext_props: 0x0000, uuid: 00002a02-0000-1000-8000-00805f9b34fb

service - start: 0x0008, end: 0x0008, type: primary, uuid: 00001801-0000-1000-8000-00805f9b34fb

service - start: 0x0009, end: 0x0011, type: primary, uuid: 0000180a-0000-1000-8000-00805f9b34fb
          charac - start: 0x000a, value: 0x000b, props: 0x02, ext_props: 0x0000, uuid: 00002a29-0000-1000-8000-00805f9b34fb
          charac - start: 0x000c, value: 0x000d, props: 0x02, ext_props: 0x0000, uuid: 00002a24-0000-1000-8000-00805f9b34fb
          charac - start: 0x000e, value: 0x000f, props: 0x02, ext_props: 0x0000, uuid: 00002a26-0000-1000-8000-00805f9b34fb
          charac - start: 0x0010, value: 0x0011, props: 0x02, ext_props: 0x0000, uuid: 00002a28-0000-1000-8000-00805f9b34fb

service - start: 0x0012, end: 0xffff, type: primary, uuid: 00050000-0000-1000-0000-d8492fffa821
          charac - start: 0x0013, value: 0x0014, props: 0x02, ext_props: 0x0000, uuid: 00050001-0000-1000-0000-d8492fffa821
          charac - start: 0x0015, value: 0x0016, props: 0x0c, ext_props: 0x0000, uuid: 00050002-0000-1000-0000-d8492fffa821
          charac - start: 0x0017, value: 0x0018, props: 0x0c, ext_props: 0x0000, uuid: 00050003-0000-1000-0000-d8492fffa821
          charac - start: 0x0019, value: 0x001a, props: 0x22, ext_props: 0x0000, uuid: 00050004-0000-1000-0000-d8492fffa821
                  descr - handle: 0x001b, uuid: 00002902-0000-1000-8000-00805f9b34fb
          charac - start: 0x001c, value: 0x001d, props: 0x0c, ext_props: 0x0000, uuid: 00050005-0000-1000-0000-d8492fffa821
          charac - start: 0x001e, value: 0x001f, props: 0x22, ext_props: 0x0000, uuid: 00050006-0000-1000-0000-d8492fffa821
                  descr - handle: 0x0020, uuid: 00002902-0000-1000-8000-00805f9b34fb
          charac - start: 0x0021, value: 0x0022, props: 0x22, ext_props: 0x0000, uuid: 00050007-0000-1000-0000-d8492fffa821
                  descr - handle: 0x0023, uuid: 00002902-0000-1000-8000-00805f9b34fb
          charac - start: 0x0024, value: 0x0025, props: 0x0c, ext_props: 0x0000, uuid: 0005000a-0000-1000-0000-d8492fffa821
          charac - start: 0x0026, value: 0x0027, props: 0x22, ext_props: 0x0000, uuid: 0005000b-0000-1000-0000-d8492fffa821
                  descr - handle: 0x0028, uuid: 00002902-0000-1000-8000-00805f9b34fb
          charac - start: 0x0029, value: 0x002a, props: 0x0c, ext_props: 0x0000, uuid: 0005000c-0000-1000-0000-d8492fffa821

[GATT client]# write-value 0xf504 3 80 89
[GATT client]#
Write failed: Invalid Handle (0x01)
  1. I tried using bluethoothctl (which from what I understand replaces btgatt-client) as follows, but it first connected and then disconnected. Could it be that the write value command must be written immediately?
[bluetooth]# connect 74:38:B7:48:52:CB
Attempting to connect to 74:38:B7:48:52:CB
[CHG] Device 74:38:B7:48:52:CB Connected: yes
Connection successful
[CHG] Device 74:38:B7:48:52:CB Connected: no
[CHG] Device 74:38:B7:48:52:CB Connected: yes
[CHG] Device 74:38:B7:48:52:CB Connected: no

Thanks!

dov avatar May 21 '22 19:05 dov