A pure Python implementation of Huawei BLE Link Protocol v2.
Check out the Wiki for the details.
A pure Python implementation of Huawei BLE Link Protocol v2
License: MIT License
A pure Python implementation of Huawei BLE Link Protocol v2.
Check out the Wiki for the details.
Here is the error message:
DEBUG:asyncio:Using selector: SelectSelector
DEBUG:bleak.backends.dotnet.scanner:Received 88:11:96:5C:EA:AF: Unknown.
DEBUG:bleak.backends.dotnet.scanner:Received 88:11:96:5C:EA:AF: honor Band 4-AAF.
DEBUG:bleak.backends.dotnet.client:Connecting to BLE device @ 88:11:96:5C:EA:AF
DEBUG:bleak.backends.dotnet.client:_ConnectionStatusChanged_Handler: 1
DEBUG:bleak.backends.dotnet.client:Get Services...
DEBUG:bleak.backends.dotnet.client:_ConnectionStatusChanged_Handler: 0
Traceback (most recent call last):
File ".\band_gatt.py", line 58, in <module>
event_loop.run_until_complete(read_data(event_loop))
File "D:\Program Files (x86)\Python37\lib\asyncio\base_events.py", line 584, in run_until_complete
return future.result()
File ".\band_gatt.py", line 41, in read_data
async with BleakClient(device_mac if platform.system() != "Darwin" else device_uuid, loop=loop) as client:
File "Program Files (x86)\Python37\lib\site-packages\bleak\backends\client.py", line 61, in __aenter__
await self.connect()
File "Program Files (x86)\Python37\lib\site-packages\bleak\backends\dotnet\client.py", line 250, in connect
await self.get_services(use_cached=use_cached)
File "Program Files (x86)\Python37\lib\site-packages\bleak\backends\dotnet\client.py", line 476, in get_services
return_type=GattCharacteristicsResult,
File "Program Files (x86)\Python37\lib\site-packages\bleak\backends\dotnet\utils.py", line 79, in wrap_IAsyncOperation
raise BleakDotNetTaskError(op.ErrorCode.ToString())
bleak.exc.BleakDotNetTaskError: System.ObjectDisposedException: 该对象已关闭。 (异常来自 HRESULT:0x80000013)
My idea is that you can directly get the data like the number of steps today and the cell phone battery through Bluetooth
Hi @zyv I am testing your console with my honor band 3 to see if I can help with the integration with gadgetbridge. Unfortunately I am unable to do anything and I get this error:
./Git/huawei-lpv2# python3 band_gatt.py
INFO:bleak.backends.bluezdbus.discovery:xx:xx:xx:xx:xx:xx,xx:xx:xx:xx:xx:xx (-57 dBm), Object Path: /org/bluez/hci0/dev_xx:xx:xx:xx:xx:xx
INFO:bleak.backends.bluezdbus.discovery:xx:xx:xx:xx:xx:xx, xx:xx:xx:xx:xx:xx (-91 dBm), Object Path: /org/bluez/hci0/dev_xx:xx:xx:xx:xx:xx
INFO:bleak.backends.bluezdbus.discovery:xx:xx:xx:xx:xx:xx, xx:xx:xx:xx:xx:xx (-62 dBm), Object Path: /org/bluez/hci0/dev_xx:xx:xx:xx:xx:xx
DEBUG:bleak.backends.bluezdbus.client:Connecting to BLE device @ xx:xx:xx:xx:xx:xx with hci0
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/bleak/backends/bluezdbus/client.py", line 124, in connect
).asFuture(self.loop)
txdbus.error.RemoteError: org.freedesktop.DBus.Error.UnknownObject: Method "Connect" with signature "" on interface "org.bluez.Device1" doesn't exist
Any hint?
Thanks
Hello everyone again! I was finally able to hook up to the watch, but code gives an authentication error, I looked at the logs in wireshark and found such a line
after the watch send an authentication error
in the watch logs I found a string with authentication, but does not coincide with the authentication request in the script, what should I do?
Hi zyv! I have a question, can I use your script to connect to a Huawei Band 7 watch? And if so, how? What is device_uuid in band.ini file?
Hello, I'm trying to run your app with my Huawei band 3 pro.
As I understand, I shoud write smthing like this:
DEVICE_NAME = "HUAWEI Band 3 Pro-B0D"
But what should be in
"device_uuid" field?
Also should I download band.ini anywhere?
Ok so I'm a total newbie with BLE devices. Here is what I got after a few attempts. It looks like I had to turn bluetooth off on my phone and have the band in an "unpaired" state.
DEBUG:asyncio:Using selector: SelectSelector
DEBUG:bleak.backends.dotnet.discovery:Received F4:BF:80:5B:DA:9B: Unknown.
DEBUG:bleak.backends.dotnet.discovery:Received C8:D0:83:C2:CB:7B: Unknown.
DEBUG:bleak.backends.dotnet.discovery:Received 3A:A9:D6:34:D7:C8: Unknown.
DEBUG:bleak.backends.dotnet.discovery:Received F4:BF:80:5B:DA:9B: Unknown.
DEBUG:bleak.backends.dotnet.discovery:Could not remove event handlers: unknown event handler...
DEBUG:bleak.backends.dotnet.discovery:Received 3A:A9:D6:34:D7:C8: Unknown.
DEBUG:bleak.backends.dotnet.discovery:3 devices found. Watcher status: 3.
DEBUG:bleak.backends.dotnet.discovery:Received C8:D0:83:C2:CB:7B: Unknown.
DEBUG:bleak.backends.dotnet.discovery:Received F4:BF:80:5B:DA:9B: Unknown.
DEBUG:bleak.backends.dotnet.client:Connecting to BLE device @ F4:BF:80:5B:DA:9B
DEBUG:bleak.backends.dotnet.client:Get Services...
Traceback (most recent call last):
[...]
File \Python\Python37\lib\site-packages\bleak\backends\dotnet\client.py", line 240, in get_services
"Could not get GATT characteristics for {0}.".format(service)
bleak.exc.BleakDotNetTaskError: Could not get GATT characteristics for Windows.Devices.Bluetooth.GenericAttributeProfile.GattDeviceService.
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.