Open fallingin2infinity opened 3 years ago
I couldn't get this to work using any variation of SUBSYSTEM=="usb"
alone. This worked for me:
echo 'KERNEL=="usbtmc*", MODE="0660", GROUP="plugdev"' | sudo tee -a /etc/udev/rules.d/10-usbtmc.rules
echo 'SUBSYSTEM=="usb", MODE="0660", GROUP="plugdev"' | sudo tee -a /etc/udev/rules.d/00-usb-permissions.rules
sudo udevadm control --reload-rules
sudo udevadm trigger
And ensuring the user was a member of the "plugdev" group (they are by default on the Ubuntu I'm using).
I believe this grants permission for all usbtmc devices regardless of vendor ID and product ID, that's fine for me - but you might wanna specify them if you want to restrict it to only one devuce. I didn't test if that works.
Hello,
I got python-usbtmc working yesterday, and was having a good time connecting to my Keysight Ocilloscope, running IDN queries, etc. All from my Raspberry Pi 3B+. I followed everything in the readme file, except the optional Kernel bit. But this morning, it's not working!
The output from lsusb:
My usbtmc.rules file:
My Python3 code:
However, this morning the exact same code is returning:
usb.core.USBError: [Errno 13] Access denied (insufficient permissions)
The Pi was left on overnight, too - so nothing should have restarted, etc. The USB device was disconnected and reconnected in the morning. I didn't change anything, other than I probably re-started Python.
I've gone back through the readme (again, not the optional part) and I'm just not getting anywhere. When plugged in, the device is added to
/dev/usbtmc0
. Usingls -all
, I get:Which doesn't look right to me. I've done some udevadm debugging to try and highlight an issue, and I'm seeing this line, which looks wrong, as I'd expect the mode to be picked up from my usbtmc.rules file:
usbtmc0: Handling device node '/dev/usbtmc0', devnum=c180:176, mode=0600, uid=0, gid=0
Does anyone have any thoughts?