I am using linux-gpib package and Keithley's KUSB-488A (gpib-usb converter) on my Ubuntu 14.04 LTS. It is installed properly and I can successfully command my devices using ibtest
utility. But before that, everytime I disconnect and reconnect the device I need to run gpib_config --minor 0
inorder to initiate the drivers.
I wanted it to run automatically everytime a connection is made without having to run explicitly. So, a udev
rule is what I thought of and wrote the following:
KERNEL=="gpib[0-9]*", ENV{DEVPATH}=="/devices/virtual/gpib_common/gpib0", RUN+="/usr/sbin/gpib_config --minor 0"
based on what I got from:
udevadm info /dev/gpib0
P: /devices/virtual/gpib_common/gpib0
N: gpib0
E: DEVNAME=/dev/gpib0
E: DEVPATH=/devices/virtual/gpib_common/gpib0
E: MAJOR=160
E: MINOR=0
E: SUBSYSTEM=gpib_common
But this didn't help me when I restarted the udev
rules.
What I have observed, if I reboot the pc itself then on first connection I am able to run ibtest
without explicit execution of gpib_config
.
Please help me where I am lacking?
/dev/gpib0
port only. Next when I triedudevadm monitor --environment --udev
I could see the actual characteristics of gpib-usb converter and then I changed my
udev
rule to:SUBSYSTEM=="usb", ENV{ID_SERIAL}=="3923_725c_01123B73", RUN+="/bin/sh -c '/usr/sbin/gpib_config --minor 0'"
It started to detect the device as I wanted it to but sometimes I found this not working when I reboot pc.
– Ashish Sharma Dec 04 '15 at 04:39my-gpib-dev.rules
and it is the same I commented earlier. – Ashish Sharma Dec 05 '15 at 12:11