execuc / u2if

USB to interfaces implementing MicroPython "machine" module functionalities on a computer.
Other
152 stars 26 forks source link

UDEV rules improvement #5

Open lesamouraipourpre opened 3 years ago

lesamouraipourpre commented 3 years ago

Below is a possible improvement to the udev-rules. It is based on the suggest udev-rules in the libusb/hidraw project Ref: https://github.com/libusb/hidapi/blob/6fcb0bb2282dbb505561a53689eba0c0536570d9/udev/69-hid.rules

# PICO
#KERNEL=="hidraw*", ATTRS{idVendor}=="cafe", ATTRS{idProduct}=="4005", TAG+="uaccess", GROUP="plugdev", MODE="0660"
# Adafruit Feather
#KERNEL=="hidraw*", ATTRS{idVendor}=="239a", ATTRS{idProduct}=="00f1", TAG+="uaccess", GROUP="plugdev", MODE="0660"
# Adafruit ItsyBitsy
#KERNEL=="hidraw*", ATTRS{idVendor}=="239a", ATTRS{idProduct}=="00fd", TAG+="uaccess", GROUP="plugdev", MODE="0660"
# Adafruit QT2040 Trinkey
#KERNEL=="hidraw*", ATTRS{idVendor}=="239a", ATTRS{idProduct}=="0109", TAG+="uaccess", GROUP="plugdev", MODE="0660"
# Adafruit QTPY
#KERNEL=="hidraw*", ATTRS{idVendor}=="239a", ATTRS{idProduct}=="00f7", TAG+="uaccess", GROUP="plugdev", MODE="0660"

I have tested this connected from a Raspberry Pi 4 to a RP2040 Pico and they work

> ls -l /dev/ttyACM0 
crw-rw---- 1 root dialout 166, 0 Jun 29 16:46 /dev/ttyACM0
> ls -l /dev/hidraw*
crw-rw----+ 1 root plugdev 244, 2 Jun 29 16:46 /dev/hidraw2
execuc commented 3 years ago

Hello, On my Debian 10 (x64), it seems not to work because I think it uses libusb implementation (as your link says) and I must use SUBSYSTEM=="usb". I think I'll put both cases in the documentation.

Thank you