Search code examples
libusbudevhidapi

hdiapi how to access device in user mode?


I am running the test script from GitHub, and I can only open the device as root.

While calling hid_enumerate(0x0, 0x0), it works in user mode.

My udev rule looks like this:

SUBSYSTEM=="usb", ATTRS{idVendor}=="1a86", ATTR{idProduct}=="e008", MODE="0666"

The rule is working because I can run he2325u_pyusb in user mode. Disabling this rule, the script runs only with root rights.

How can I access the device in user mode?


Solution

  • ok, I could fix the problem I changed the udev rules like this:

    SUBSYSTEM=="usb", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="e008", MODE="0666" KERNEL=="hidraw*",ATTRS{busnum}=="2", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="e008", MODE="0666", GROUP="users"

    The very important thing was to append a * at the end of the KERNEL parameter hidraw*.