scottmckenzie / holman-linux-python Goto Github PK
View Code? Open in Web Editor NEWHolman SDK for Python on Linux
License: MIT License
Holman SDK for Python on Linux
License: MIT License
It is possible to support the BTX1?
Hello,
I am trying this with Holman BTV1
sudo holmanctl --connect
Holman tap timer AA:BB:CC:DD:EE:FF connecting...
Terminate with Ctrl+C
Holman tap timer AA:BB:CC:DD:EE:FF connected
Holman tap timer AA:BB:CC:DD:EE:FF disconnected
ERROR:dbus.connection:Exception in handler for D-Bus signal:
Traceback (most recent call last):
File "/mnt/archive/artiom/Projects/src/venv/holman/lib/python3.10/site-packages/dbus/connection.py", line 232, in maybe_handle_message
self._handler(*args, **kwargs)
File "/mnt/archive/artiom/Projects/src/venv/holman/lib/python3.10/site-packages/gatt/gatt_linux.py", line 394, in properties_changed
self.disconnect_succeeded()
File "/mnt/archive/artiom/Projects/src/venv/holman/lib/python3.10/site-packages/holman/holman.py", line 148, in disconnect_succeeded
self.listener.disconnect_succeeded()
File "/mnt/archive/artiom/Projects/src/venv/holman/lib/python3.10/site-packages/holmanctl.py", line 55, in disconnect_succeeded
sys.exit(0)
SystemExit: 0
What is going wrong? Looks like just disconnecting.
Hi,
I'm trying to connect to the BX1 (HOLMAN_CO3111) with holmanctl (on a raspberry pi) but can't seem to get it to work. It looks like I can connect but then the connection instantly drops and I can't retrieve any of the settings or switch the timer on/off. Have followed your instructions for adding the BTX1 and they appear to have the same service UUID (c521f000-0d70-4d4f-8e43-40d84c50ab38). Have run nRF on my android phone and here's the content. Any help much appreciated. Thanks.
nRF Connect, 2022-08-18
BX1 (AA:BB:CC:DD:EE:FF)
V 19:42:15.157 Connecting to AA:BB:CC:DD:EE:FF...
D 19:42:15.157 gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
D 19:42:16.080 [Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I 19:42:16.080 Connected to AA:BB:CC:DD:EE:FF
V 19:42:16.099 Discovering services...
D 19:42:16.099 gatt.discoverServices()
D 19:42:16.118 [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
I 19:42:16.368 Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
D 19:42:16.703 [Callback] Services discovered with status: 0
I 19:42:16.704 Services discovered
V 19:42:16.718 Generic Access (0x1800)
Hi, I was wondering if it would be possible to write a Home Assistant Intergration for your package?
Let me know if you need any further explanation.
Cheers
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.