Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experiencing ValueError: Characteristic notifications already started #77

Closed
dhruvkb opened this issue Nov 5, 2023 · 4 comments
Closed

Comments

@dhruvkb
Copy link

dhruvkb commented Nov 5, 2023

linak-controller is raising the following error.

Connected 84F900A3-AB7F-C330-501D-575AB6D66797
Capabilities: {'memSize': 3, 'autoUp': False, 'autoDown': False, 'bleAllow': True, 'hasDisplay': False, 'hasLight': False}

Something unexpected went wrong:
Traceback (most recent call last):
  File "/opt/pipx/venvs/linak-controller/lib/python3.11/site-packages/linak_controller/main.py", line 204, in main
    client = await connect()
             ^^^^^^^^^^^^^^^
  File "/opt/pipx/venvs/linak-controller/lib/python3.11/site-packages/linak_controller/main.py", line 46, in connect
    await Desk.initialise(client)
  File "/opt/pipx/venvs/linak-controller/lib/python3.11/site-packages/linak_controller/desk.py", line 30, in initialise
    user_id = await DPGService.dpg_command(client, DPGService.DPG.CMD_USER_ID)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/pipx/venvs/linak-controller/lib/python3.11/site-packages/linak_controller/gatt.py", line 200, in dpg_command
    await cls.DPG.subscribe(client, callback)
  File "/opt/pipx/venvs/linak-controller/lib/python3.11/site-packages/linak_controller/gatt.py", line 27, in subscribe
    await client.start_notify(cls.uuid, callback)
  File "/opt/pipx/venvs/linak-controller/lib/python3.11/site-packages/bleak/__init__.py", line 834, in start_notify
    await self._backend.start_notify(characteristic, wrapped_callback, **kwargs)
  File "/opt/pipx/venvs/linak-controller/lib/python3.11/site-packages/bleak/backends/corebluetooth/client.py", line 357, in start_notify
    await self._delegate.start_notifications(characteristic.obj, callback)
  File "/opt/pipx/venvs/linak-controller/lib/python3.11/site-packages/bleak/backends/corebluetooth/PeripheralDelegate.py", line 217, in start_notifications
    raise ValueError("Characteristic notifications already started")
ValueError: Characteristic notifications already started
Screenshot 2023-11-05 at 1 24 02 PM

Specs

  • Package name: linak-controller
  • Package version: 1.1.0
  • Python version: 3.11.6
  • Installed via: pipx
  • OS name: macOS
  • OS version: 14.1 (23B74)
  • Desk name: Ikea Idåsen
@snok3r-krk
Copy link

snok3r-krk commented Nov 30, 2023

I have a similar issue. It worked correctly on the same machine/system before I updated to the recent version.
image

Specs
Package name: linak-controller
Package version: 1.1.0
Python version: 3.11
Installed via: pip3
OS name: macOS
OS version: 14.1.1
Desk name: Ikea Idåsen

@rhyst
Copy link
Owner

rhyst commented Nov 30, 2023

I have uploaded 1.1.1-dev which unsubscribes after each DPG command. Can you try this and let me know if it improves things?

@snok3r-krk
Copy link

snok3r-krk commented Dec 1, 2023

It works with 1.1.1-dev 🎈 Thanks!

@rhyst rhyst closed this as completed Dec 1, 2023
@rhyst
Copy link
Owner

rhyst commented Dec 1, 2023

Released 1.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants