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

Insufficient Authorization #62

Open
soner89 opened this issue Feb 4, 2021 · 0 comments
Open

Insufficient Authorization #62

soner89 opened this issue Feb 4, 2021 · 0 comments

Comments

@soner89
Copy link

soner89 commented Feb 4, 2021

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

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

1 participant