I've been playing with USBTMC stuff lately. Here's the udev rule I use:
Code: Select all
# /etc/udev/rules.d/usbtmc.rules
# USB test and measurement class devices
SUBSYSTEM=="usbmisc", KERNEL=="usbtmc[0-9]", GROUP="users", MODE="0666"
This is on Arch, so you'll probably have to change the group. I think it's much more useful to specify the subsystem than vendor and product IDs for every possible device.
UPDATE:
So udev is pretty confusing. I could set the permissions of the dev node, but it still wouldn't let me use python-usbtmc, presumably because it uses the USB device directly and not the dev node. I ended up with this:
Code: Select all
# /etc/udev/rules.d/usbtmc.rules
# permissions for the dev node
DRIVERS=="usbtmc", GROUP="users", MODE="0666"
# 33220A permissions for libusb
SUBSYSTEM!="usb_device", ACTION!="add", GOTO="usbtmc_rules_end"
SYSFS{idVendor}=="0957", SYSFS{idProduct}=="0407"
MODE="0666", GROUP="users"
LABEL="usbtmc_rules_end"
It seems like you still need to specify every device.
BTW, I tried to use the dev node directly, but the read() call behaves strangely. I found
http://www.home.agilent.com/upload/cmc_ ... =US&lc=eng and
https://github.com/imrehg/usbtmc/tree/master/agilent, but I could not set the readmode. I wish I understood why they can't just have a normal read().