capacitor-community / bluetooth-le

Capacitor plugin for Bluetooth Low Energy
MIT License
284 stars 86 forks source link

characteristic doesn't support read operation, but it does :/ #683

Open eried opened 2 months ago

eried commented 2 months ago

Hi! thanks for this add-on, I am trying to connect to a simple ESP32 device that exposes a characteristic as:

  // Create the characteristic
  BLECharacteristic* pCharacteristic = pService->createCharacteristic(
    CHARACTERISTIC_UUID,
    BLECharacteristic::PROPERTY_READ | 
    BLECharacteristic::PROPERTY_NOTIFY | 
    BLECharacteristic::PROPERTY_INDICATE);

After connecting to the device (this part works ok), when I try to get if I can read the value:


      const result = await BleClient.read(device.deviceId, this.SERVICE_UUID, this.CHARACTERISTIC_UUID);

I always get:

app.component.ts:141 Error fetching fish data: NotSupportedError: GATT operation not permitted.

Even when I can read it on another app on the same PC:

image

I am missing something very obvious?

peitschie commented 2 months ago

That looks like it ought to work. Have you tried nrf Connect on mobile (there's an Apple version too) just to confirm it's not a BLE issue?

nrf Connect sometimes can show some deeper diagnostics information too, to help root-cause what's going on there.

eried commented 2 months ago

Hi, thanks. It is very similar, also can read in nrfConnect

image

On the web there is no permissions I could have missed right?, I am still puzzled on why it does not work :/

peitschie commented 2 months ago

Just clarifying @eried ... which platform ar eyou running on? Is this Web (via Chrome?), Android or iOS?

eried commented 2 months ago

Hi, web via chrome, windows 10