Skip to content

bleak.exc.BleakError: Characteristic 0000a001-0000-1000-8000-00805f9b34fb does not support write operations! #31

Description

@LudoM9

Hi,

I have this writing issue when I try to change the device mode low power or normal.

Here is the python code I'm using :

  self.device = CalypsoDeviceApi(ble_address=self.ble_address)
  self.device.settings.ble_discovery_timeout = bleDiscoveryTimeout
  self.device.settings.ble_connect_timeout = bleConnectTimeout
  print("Establishing connection with Calypso...")
  self.deviceConnected = False
  i = 1
  attempts = 10
  while not self.deviceConnected and i <= attempts:
      try:
          await self.device.connect()
          self.deviceConnected = True
          print("Connection established Calypso: True")
      except:
          print(f"Connection established Calypso: False {i}/{attempts}")
          i+=1
  await self.device.about()
  await self.device.set_mode(CalypsoDeviceMode.LOW_POWER)

Here is the result :

Establishing connection with Calypso...
TimeoutError: 
Connection established Calypso: False 1/10
TimeoutError: 
Connection established Calypso: False 2/10
Connection established Calypso: True
{
  "info": {
    "ble_address": "E2:7C:BD:0A:22:B6",
    "manufacturer_name": "CALYPSO",
    "model_number": "UP10",
    "serial_number": "22:7C:BD:A:22:B6",
    "hardware_revision": "",
    "firmware_revision": "0.70",
    "software_revision": ""
  },
  "status": {
    "mode": "SLEEP",
    "rate": "HZ_4",
    "compass": "OFF"
  }
}

File "/home/ludom/Rob_Cours/aston-autonomous-sailboat-2023/ASTON2023/Drivers/Calypso/calypso.py", line 161, in _initialization
    await self.device.set_mode(CalypsoDeviceMode.LOW_POWER)        
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ludom/pyenv/aston/lib/python3.11/site-packages/calypso_anemometer/core.py", line 208, in set_mode
    await self.client.write_gatt_char(
  File "/home/ludom/pyenv/aston/lib/python3.11/site-packages/bleak/__init__.py", line 659, in write_gatt_char
    await self._backend.write_gatt_char(char_specifier, data, response)
  File "/home/ludom/pyenv/aston/lib/python3.11/site-packages/bleak/backends/bluezdbus/client.py", line 854, in write_gatt_char
    raise BleakError(
bleak.exc.BleakError: Characteristic 0000a001-0000-1000-8000-00805f9b34fb does not support write operations!

If anyone knows how to solve this issue, please share it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions