Skip to content

Insufficient Authorization #62

@soner89

Description

@soner89

Hi all,

on my Raspberry Pi 4, I'm trying to write some characteristics using this gatt module.
However, I run into the following issue:

> ACL Data RX: Handle 64 flags 0x02 dlen 9                                               #36 [hci0] 17.312990
      ATT: Error Response (0x01) len 4
        Write Request (0x12)
        Handle: 0x0020
        Error: Insufficient Authorization (0x08)

The python code looks like this:

import gatt

manager = gatt.DeviceManager(adapter_name='hci0')

class AnyDevice(gatt.Device):
    def services_resolved(self):
        super().services_resolved()

        device_information_service = next(
            s for s in self.services
            if s.uuid == '00001234-0000-1000-8000-001234567890')

        firmware_version_characteristic = next(
            c for c in device_information_service.characteristics
            if c.uuid == '00001235-0000-1000-8000-001234567890')

        firmware_version_characteristic.write_value(b'start')

    def characteristic_write_value_succeeded(self, characteristic):
        """
        Called when a characteristic value write command succeeded.
        """
        # To be implemented by subclass
        print("worked")

    def characteristic_write_value_failed(self, characteristic, error):
        """
        Called when a characteristic value write command failed.
        """
        # To be implemented by subclass
        print("failed")


device = AnyDevice(mac_address='00:21:7E:24:A7:F1', manager=manager)
device.connect()

manager.run()

On my computer, this works without any issues. On the RPI, i get the autohrization error.

I read that you can set the permissions in the gatt, but couldn't find a proper function in the implementation.

Any ideas?

Thanks,
Soner

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