I have my usb device, and I've had a go at controlling it, using usb4java. I'm having a problem with permission to access the device. I've been following the advice written here:
https://unix.stackexchange.com/question ... -in-libusb
I can't access the device:
javax.usb.UsbPlatformException: USB error 3: Can't open device Bus 001 device 007: ID 1a86:7523: Access denied (insufficient permissions)
I'm sure I've got the right device:
Code: Select all
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 255 Vendor-specific
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x1a86
idProduct 0x7523
bcdDevice 2.64
iManufacturer 0
iProduct 2
iSerial 0
bNumConfigurations 1
I've tried making a file /etc/udev/rules.d/99-localusb.rules containing the text:
SUBSYSTEM=="usb", ATTR{idVendor}=="1a86", ATTR{idProduct}=="7523", MODE="0666"
Didn't help. That page I was referring to sometimes mentioned the folder /etc/udev/rules.d/ and sometimes /lib/udev/rules.d/
I don't know which was the correct folder to use, so I've put a file called 99-localusb.rules in each of them.
I've also look at /lib/udev/rules.d/50-udev-default.rules referred to at the top of that page. I was hoping to change all the usb devices to 0666, since I am the only user of the rasp pi. I was hoping to see the line:
# 'libusb' device nodes
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664"
and change it to
# 'libusb' device nodes
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0666"
but a note at the top of the file points out that it isn't so useful to edit the file as it will be over-written on updating. And also, even as an experiment, I couldn't try it as that line doesn't exist in my /lib/udev/rules.d/50-udev-default.rules file.
What I do have in that file is:
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb", GOTO="default_hwdb_imported"
ENV{MODALIAS}!="", IMPORT{builtin}="hwdb --subsystem=$env{SUBSYSTEM}"
LABEL="default_hwdb_imported"
So it looks like the advice on that page, aimed for linux users, isn't appropriate for Raspian.
Can anyone tell me how to set the permissions for my device on the pi please?