tahnok / colmi_r02_client

A python client + documentation for the Colmi R02 smart ring
MIT License
303 stars 15 forks source link

Error Packet has error bit set #24

Open agamm opened 1 week ago

agamm commented 1 week ago
C:\Users\MyUser>colmi_r02_client.exe --address=31:38:42:35:XX:XX get-real-time-heart-rate
Starting reading, please wait.
asyncio: Exception in callback Client._handle_tx(<bleak.backen...001820F1A0C80>)(bytearray(b'\...\x00\x00\x8c'))
handle: <Handle Client._handle_tx(<bleak.backen...001820F1A0C80>)(bytearray(b'\...\x00\x00\x8c'))>
Traceback (most recent call last):
  File "C:\Users\MyUser\.pyenv\pyenv-win\versions\3.12.7\Lib\asyncio\events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "C:\Users\MyUser\pipx\venvs\colmi-r02-client\Lib\site-packages\colmi_r02_client\client.py", line 106, in _handle_tx
    assert packet_type < 127, f"Packet has error bit set {packet}"

OS: Windows Python: 3.12.7 XX:XX was changed.

Any ideas?

tahnok commented 1 week ago

Can you try again with the --record flag and the --debug flag and upload the log and the recording?

agamm commented 1 week ago

Here:

colmi_r02_client.exe --record --debug --address=31:38:42:35:XX:XX get-real-time-heart-rate colmi_r02_client.cli: Recording responses to captures\colmi_response_capture_1730404231.bin colmi_r02_client.client: Connecting to 31:38:42:35:XX:XX colmi_r02_client.client: Connected! Starting reading, please wait. colmi_r02_client.client: Sending packet: bytearray(b'i\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00j') colmi_r02_client.client: Received packet bytearray(b'i\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00j') colmi_r02_client.client: Sending packet: bytearray(b'\x1e3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00Q') colmi_r02_client.client: Received packet bytearray(b'\x9e\xee\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x8c') asyncio: Exception in callback Client._handle_tx()(bytearray(b'...\x00\x00\x8c')) handle: <Handle Client._handle_tx()(bytearray(b'...\x00\x00\x8c'))> Traceback (most recent call last): File "C:\Users\MyUser.pyenv\pyenv-win\versions\3.12.7\Lib\asyncio\events.py", line 88, in _run self._context.run(self._callback, *self._args) File "C:\Users\MyUser\pipx\venvs\colmi-r02-client\Lib\site-packages\colmi_r02_client\client.py", line 106, in _handle_tx assert packet_type < 127, f"Packet has error bit set {packet}" ^^^^^^^^^^^^^^^^^

bin capture file:

i image

tahnok commented 4 days ago

Is this the r10?

agamm commented 4 days ago

No, I bought this (R2): https://www.aliexpress[.]us/item/3256806445134241.html

COLMI R02 Smart Ring Military Grade Titanium Steel Shell Health Monitoring IP68 & 3ATM Waterproof Multi-sport Modes

devwearsprada commented 2 days ago

I have the same issue with a COLMI R02 ring. Below the logs and bin file.

Output of scan:

                Name  | Address
--------------------------------------------
            R02_5001  |  C77FF180-C50B-DFD0-AAC1-XXXXXXXXXXXX

Output of get-real-time-heart-rate

colmi_r02_client --address=C77FF180-C50B-DFD0-AAC1-XXXXXXXXXXXX --debug --record get-real-time-heart-rate >> log.txt
colmi_r02_client.cli: Recording responses to captures/colmi_response_capture_1730818479.bin
colmi_r02_client.client: Connecting to C77FF180-C50B-DFD0-AAC1-E8AC2CA17F1D
colmi_r02_client.client: Connected!
colmi_r02_client.client: Sending packet: bytearray(b'i\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00j')
colmi_r02_client.client: Received packet bytearray(b'i\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00j')
colmi_r02_client.client: Sending packet: bytearray(b'\x1e3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00Q')
colmi_r02_client.client: Received packet bytearray(b'\x9e\xee\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x8c')
asyncio: Exception in callback PeripheralDelegate.did_update_value_for_characteristic()
handle: <Handle PeripheralDelegate.did_update_value_for_characteristic()>
Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.13/3.13.0_1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/asyncio/events.py", line 89, in _run
    self._context.run(self._callback, *self._args)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/.local/pipx/venvs/colmi-r02-client/lib/python3.13/site-packages/bleak/backends/corebluetooth/PeripheralDelegate.py", line 381, in did_update_value_for_characteristic
    notify_callback(bytearray(value))
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/Users/user/.local/pipx/venvs/colmi-r02-client/lib/python3.13/site-packages/colmi_r02_client/client.py", line 106, in _handle_tx
    assert packet_type < 127, f"Packet has error bit set {packet}"
           ^^^^^^^^^^^^^^^^^
AssertionError: Packet has error bit set bytearray(b'\x9e\xee\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x8c')

.bin file of record

colmi_response_capture_1730817364.bin.zip