scottmckenzie / holman-linux-python

Holman SDK for Python on Linux
MIT License
13 stars 3 forks source link

Holman GATT service missing #4

Closed danobot closed 5 years ago

danobot commented 5 years ago

Hi, I installed the pip module and the apt package. Im on bluetooth version 5.48.

Connection through bluetoothctl is successful:

[bluetooth]# connect F4:12:9E:7C:94:1C
Attempting to connect to F4:12:9E:7C:94:1C
[CHG] Device F4:12:9E:7C:94:1C Connected: yes
Connection successful
[NEW] Primary Service
        /org/bluez/hci0/dev_F4_12_9E_7C_94_1C/service0008
        00001801-0000-1000-8000-00805f9b34fb
        Generic Attribute Profile
[NEW] Primary Service
        /org/bluez/hci0/dev_F4_12_9E_7C_94_1C/service0009
        46a60001-ca26-425a-9bc6-d917829d2906
        Vendor specific
[NEW] Characteristic
        /org/bluez/hci0/dev_F4_12_9E_7C_94_1C/service0009/char000a
        46a60001-ca26-425a-9bc6-d917829d2906
        Vendor specific
[NEW] Descriptor
        /org/bluez/hci0/dev_F4_12_9E_7C_94_1C/service0009/char000a/desc000c
        00002902-0000-1000-8000-00805f9b34fb
        Client Characteristic Configuration
[NEW] Primary Service
        /org/bluez/hci0/dev_F4_12_9E_7C_94_1C/service000d
        c521f000-0d70-4d4f-8e43-40d84c50ab38
        Vendor specific
[NEW] Characteristic
        /org/bluez/hci0/dev_F4_12_9E_7C_94_1C/service000d/char000e
        0000f003-0000-1000-8000-00805f9b34fb
        Unknown
[NEW] Descriptor
        /org/bluez/hci0/dev_F4_12_9E_7C_94_1C/service000d/char000e/desc0010
        00002901-0000-1000-8000-00805f9b34fb
        Characteristic User Description
[NEW] Characteristic
        /org/bluez/hci0/dev_F4_12_9E_7C_94_1C/service000d/char0011
        0000f004-0000-1000-8000-00805f9b34fb
        Unknown
[NEW] Descriptor
        /org/bluez/hci0/dev_F4_12_9E_7C_94_1C/service000d/char0011/desc0013
        00002901-0000-1000-8000-00805f9b34fb
        Characteristic User Description
[NEW] Characteristic
        /org/bluez/hci0/dev_F4_12_9E_7C_94_1C/service000d/char0014
        0000f005-0000-1000-8000-00805f9b34fb
        Unknown
[NEW] Descriptor
        /org/bluez/hci0/dev_F4_12_9E_7C_94_1C/service000d/char0014/desc0016
        00002901-0000-1000-8000-00805f9b34fb
        Characteristic User Description
[NEW] Characteristic
        /org/bluez/hci0/dev_F4_12_9E_7C_94_1C/service000d/char0017
        0000f006-0000-1000-8000-00805f9b34fb
        Unknown
[NEW] Descriptor
        /org/bluez/hci0/dev_F4_12_9E_7C_94_1C/service000d/char0017/desc0019
        00002901-0000-1000-8000-00805f9b34fb
        Characteristic User Description
[NEW] Characteristic
        /org/bluez/hci0/dev_F4_12_9E_7C_94_1C/service000d/char001a
        0000e001-0000-1000-8000-00805f9b34fb
        Unknown
[NEW] Descriptor
        /org/bluez/hci0/dev_F4_12_9E_7C_94_1C/service000d/char001a/desc001c
        00002901-0000-1000-8000-00805f9b34fb
        Characteristic User Description
[NEW] Characteristic
        /org/bluez/hci0/dev_F4_12_9E_7C_94_1C/service000d/char001d
        0000c001-0000-1000-8000-00805f9b34fb
        Unknown
[NEW] Descriptor
        /org/bluez/hci0/dev_F4_12_9E_7C_94_1C/service000d/char001d/desc001f
        00002901-0000-1000-8000-00805f9b34fb
        Characteristic User Description
[NEW] Characteristic
        /org/bluez/hci0/dev_F4_12_9E_7C_94_1C/service000d/char0020
        0000c002-0000-1000-8000-00805f9b34fb
        Unknown
[NEW] Descriptor
        /org/bluez/hci0/dev_F4_12_9E_7C_94_1C/service000d/char0020/desc0022
        00002901-0000-1000-8000-00805f9b34fb
        Characteristic User Description
[CHG] Device F4:12:9E:7C:94:1C UUIDs: 00001800-0000-1000-8000-00805f9b34fb
[CHG] Device F4:12:9E:7C:94:1C UUIDs: 00001801-0000-1000-8000-00805f9b34fb
[CHG] Device F4:12:9E:7C:94:1C UUIDs: 46a60001-ca26-425a-9bc6-d917829d2906
[CHG] Device F4:12:9E:7C:94:1C UUIDs: c521f000-0d70-4d4f-8e43-40d84c50ab38
[CHG] Device F4:12:9E:7C:94:1C ServicesResolved: yes

I disconnected from the device and executed this command:

sudo holmanctl --connect F4:12:9E:7C:94:1C

This gives me an error shown below:

Holman tap timer F4:12:9E:7C:94:1C connecting...
Terminate with Ctrl+C
Holman tap timer F4:12:9E:7C:94:1C connect failed: Holman GATT service missing
ERROR:dbus.connection:Exception in handler for D-Bus signal:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 230, in maybe_handle_message
    self._handler(*args, **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/gatt/gatt_linux.py", line 398, in properties_changed
    self.services_resolved()
  File "/usr/local/lib/python3.6/dist-packages/holman/holman.py", line 158, in services_resolved
    Exception("Holman GATT service missing"))
  File "/usr/local/lib/python3.6/dist-packages/holmanctl.py", line 44, in connect_failed
    sys.exit(0)
SystemExit: 0

Running the discover command does not find any devices:

sudo holmanctl --discover
Terminate with Ctrl+C

(I left it running for a few minutes).

The same happens using the Python script. Here is the installed versions and dependencies mentioned in README.

daniel@ubuntu:~/repos/holman_component$ bluetoothd --version
5.48
daniel@ubuntu:~/repos/holman_component$ sudo apt-get install --no-install-recommends bluetooth
Reading package lists... Done
Building dependency tree
Reading state information... Done
bluetooth is already the newest version (5.48-0ubuntu3.1).
0 to upgrade, 0 to newly install, 0 to remove and 35 not to upgrade.
daniel@ubuntu:~/repos/holman_component$
daniel@ubuntu:~/repos/holman_component$ pip3 install holman
Collecting holman
  Cache entry deserialization failed, entry ignored
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/ec/a1/eb98e8ce58a1b08dc148420550e987d1f74ce791ce1d56e056103b1d3f41/holman-0.0.7-py2.py3-none-any.whl
Collecting gatt>=0.2.7 (from holman)
Installing collected packages: gatt, holman
Successfully installed gatt-0.2.7 holman-0.0.7
daniel@ubuntu:~/repos/holman_component$ pip install holman
Requirement already satisfied: holman in /home/daniel/.local/lib/python2.7/site-packages (0.0.7)
Requirement already satisfied: gatt>=0.2.7 in /home/daniel/.local/lib/python2.7/site-packages (from holman) (0.2.7)
daniel@ubuntu:~/repos/holman_component$

Can you please advise how to proceed? I am not sure what I am missing.

hmoffatt commented 5 years ago

From the bluetoothctl output it looks like you are using a BTX1 like I am. Can you try the latest from github, rather than the pip repository?

danobot commented 5 years ago

Can you please push an update to the pip repository?

scottmckenzie commented 5 years ago

Created new version 0.1.0 and pushed to pip repo.

hmoffatt commented 5 years ago

FYI @danobot you can get PIP to install directly from github: pip install https://github.com/scottmckenzie/holman-linux-python

danobot commented 5 years ago

Thanks, I didnt know that, but that's not possible in my target environment. Thanks

mkhabc commented 5 years ago

I had to do pip install git+https://github.com/scottmckenzie/holman-linux-python to get it to update from github as pip install https://github.com/scottmckenzie/holman-linux-python gave the error 'Cannot unpack file...'