signal11 / hidapi

A Simple library for communicating with USB and Bluetooth HID devices on Linux, Mac, and Windows.
http://www.signal11.us/oss/hidapi/
Other
2.46k stars 901 forks source link

can not open device on Linux in user mode #422

Closed AlfredoCubitos closed 5 years ago

AlfredoCubitos commented 5 years ago

Hi, using your test script I can open a device only root.

While calling hid_enumerate(0x0, 0x0) works in user mode, but calling hid_enumerate(0x1a86, 0xe008)` doesn't work either.

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 using the library?

AlfredoCubitos commented 5 years ago

ok, I could fix the problem. I added the following line to my udev rules KERNEL=="hidraw*", ATTRS{busnum}=="2", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="e008", MODE="0666"