Usb.core library in Skill

Hey guys!
I am pretty new to the Mycroft community and like what you are doing here! :smiley:

I decided to develop a skill that controls the LEDs of the Respeaker Mic Array v2.0, however I have run into a problem:
When I try to tell the device to change the LEDs, it gives me the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pi/pixel_ring/pixel_ring/", line 25, in off
  File "/home/pi/pixel_ring/pixel_ring/", line 16, in mono
    self.write(1, [(color >> 16) & 0xFF, (color >> 8) & 0xFF, color & 0xFF, 0])
  File "/home/pi/pixel_ring/pixel_ring/", line 66, in write
    0, cmd, 0x1C, data, self.TIMEOUT)
  File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/usb/", line 1071, in ctrl_transfer
  File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/usb/", line 113, in wrapper
    return f(self, *args, **kwargs)
  File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/usb/", line 131, in managed_open
    self.handle = self.backend.open_device(
  File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/usb/backend/", line 804, in open_device
    return _DeviceHandle(dev)
  File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/usb/backend/", line 652, in __init__
    _check(_lib.libusb_open(self.devid, byref(self.handle)))
  File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/usb/backend/", line 604, in _check
    raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno 13] Access denied (insufficient permissions)

Is it not allowed for skills to access USB devices or am I doing something wrong?
Help is much appreciated! :slight_smile:

You will have to check the udev rules to make sure your user has access to the USB devices.

That did it, thank you very much!

1 Like

For those looking for the udev rule to create:

SUBSYSTEM=="usb", ATTR{idVendor}=="2886", ATTR{idProduct}=="0018", MODE="0666", GROUP="plugdev"