1

I am trying to use a package called "linux-gpib" to interface with a USB-GPIB adapter. I installed the driver, and didn't get any errors, and plugged in my device.

In Python there is a wrapper for the C API, so I tried the function to open my device, but got error:

libgpib: ibBoardOpen failed to open device file /dev/gpib0

I checked /dev and sure enough, that device doesn't exist. What DOES exist is a file called "usb_gpib". So it looks like my device is being registered in some way by the system, but it's not creating the right /dev file. I'm not certain, but it's possible that the "usb_gpib" file is what I'm looking for, and was improperly named for some reason. What would determine how a dev file gets named?


After some additional searching, I found the /etc/udev/rules.d/ directory.

There is a .rules file here for GPIB, and in it there is the following line:

KERNEL=="gpib[0-9]*", ACTION=="add", MODE="660", GROUP=="plugdev"

This looks like it is saying that the device created is supposed to be gpib0, yet that still is not the case.


As requested, this is what "udevadm monitor" printed out when I unplugged and replugged the device twice:

monitor will print the received events for:
UDEV - the event which udev sends out after rule processing

UDEV  [32.214427] add      /devices/soc0/amba@0/e0002000.usb/ci_hdrc.0/usb1/1-1/1-1.3 (usb)
ACTION=add
BUSNUM=001
DEVLINKS=/dev/usb_gpib
DEVNAME=/dev/bus/usb/001/004
DEVNUM=004
DEVPATH=/devices/soc0/amba@0/e0002000.usb/ci_hdrc.0/usb1/1-1/1-1.3
DEVTYPE=usb_device
ID_BUS=usb
ID_MODEL=702b
ID_MODEL_ENC=702b
ID_MODEL_FROM_DATABASE=GPIB-USB-B
ID_MODEL_ID=702b
ID_REVISION=0001
ID_SERIAL=3923_702b
ID_USB_INTERFACES=:ffffff:
ID_VENDOR=3923
ID_VENDOR_ENC=3923
ID_VENDOR_FROM_DATABASE=National Instruments Corp.
ID_VENDOR_ID=3923
MAJOR=189
MINOR=3
PRODUCT=3923/702b/1
SEQNUM=1077
SUBSYSTEM=usb
TYPE=255/255/255
USEC_INITIALIZED=941557

UDEV  [32.228951] add      /devices/soc0/amba@0/e0002000.usb/ci_hdrc.0/usb1/1-1/1-1.3/1-1.3:1.0 (usb)
ACTION=add
DEVPATH=/devices/soc0/amba@0/e0002000.usb/ci_hdrc.0/usb1/1-1/1-1.3/1-1.3:1.0
DEVTYPE=usb_interface
ID_MODEL_FROM_DATABASE=GPIB-USB-B
ID_USB_CLASS_FROM_DATABASE=Vendor Specific Class
ID_USB_PROTOCOL_FROM_DATABASE=Vendor Specific Protocol
ID_USB_SUBCLASS_FROM_DATABASE=Vendor Specific Subclass
ID_VENDOR_FROM_DATABASE=National Instruments Corp.
INTERFACE=255/255/255
MODALIAS=usb:v3923p702Bd0001dcFFdscFFdpFFicFFiscFFipFFin00
PRODUCT=3923/702b/1
SEQNUM=1078
SUBSYSTEM=usb
TYPE=255/255/255
USEC_INITIALIZED=2645

UDEV  [32.347470] remove   /devices/soc0/amba@0/e0002000.usb/ci_hdrc.0/usb1/1-1/1-1.3/1-1.3:1.0 (usb)
ACTION=remove
DEVPATH=/devices/soc0/amba@0/e0002000.usb/ci_hdrc.0/usb1/1-1/1-1.3/1-1.3:1.0
DEVTYPE=usb_interface
ID_MODEL_FROM_DATABASE=GPIB-USB-B
ID_USB_CLASS_FROM_DATABASE=Vendor Specific Class
ID_USB_PROTOCOL_FROM_DATABASE=Vendor Specific Protocol
ID_USB_SUBCLASS_FROM_DATABASE=Vendor Specific Subclass
ID_VENDOR_FROM_DATABASE=National Instruments Corp.
INTERFACE=255/255/255
MODALIAS=usb:v3923p702Bd0001dcFFdscFFdpFFicFFiscFFipFFin00
PRODUCT=3923/702b/1
SEQNUM=1079
SUBSYSTEM=usb
TYPE=255/255/255
USEC_INITIALIZED=2645

UDEV  [32.361405] remove   /devices/soc0/amba@0/e0002000.usb/ci_hdrc.0/usb1/1-1/1-1.3 (usb)
ACTION=remove
BUSNUM=001
DEVLINKS=/dev/usb_gpib
DEVNAME=/dev/bus/usb/001/004
DEVNUM=004
DEVPATH=/devices/soc0/amba@0/e0002000.usb/ci_hdrc.0/usb1/1-1/1-1.3
DEVTYPE=usb_device
ID_BUS=usb
ID_MODEL=702b
ID_MODEL_ENC=702b
ID_MODEL_FROM_DATABASE=GPIB-USB-B
ID_MODEL_ID=702b
ID_REVISION=0001
ID_SERIAL=3923_702b
ID_USB_INTERFACES=:ffffff:
ID_VENDOR=3923
ID_VENDOR_ENC=3923
ID_VENDOR_FROM_DATABASE=National Instruments Corp.
ID_VENDOR_ID=3923
MAJOR=189
MINOR=3
PRODUCT=3923/702b/1
SEQNUM=1080
SUBSYSTEM=usb
TYPE=255/255/255
USEC_INITIALIZED=941557

UDEV  [34.314071] add      /devices/soc0/amba@0/e0002000.usb/ci_hdrc.0/usb1/1-1/1-1.3 (usb)
ACTION=add
BUSNUM=001
DEVLINKS=/dev/usb_gpib
DEVNAME=/dev/bus/usb/001/005
DEVNUM=005
DEVPATH=/devices/soc0/amba@0/e0002000.usb/ci_hdrc.0/usb1/1-1/1-1.3
DEVTYPE=usb_device
ID_BUS=usb
ID_MODEL=702a
ID_MODEL_ENC=702a
ID_MODEL_ID=702a
ID_REVISION=0001
ID_SERIAL=3923_702a
ID_USB_INTERFACES=:ff0000:
ID_VENDOR=3923
ID_VENDOR_ENC=3923
ID_VENDOR_FROM_DATABASE=National Instruments Corp.
ID_VENDOR_ID=3923
MAJOR=189
MINOR=4
PRODUCT=3923/702a/1
SEQNUM=1081
SUBSYSTEM=usb
TYPE=0/0/0
USEC_INITIALIZED=1346

UDEV  [34.368446] add      /devices/soc0/amba@0/e0002000.usb/ci_hdrc.0/usb1/1-1/1-1.3/1-1.3:1.0 (usb)
ACTION=add
DEVPATH=/devices/soc0/amba@0/e0002000.usb/ci_hdrc.0/usb1/1-1/1-1.3/1-1.3:1.0
DEVTYPE=usb_interface
ID_VENDOR_FROM_DATABASE=National Instruments Corp.
INTERFACE=255/0/0
MODALIAS=usb:v3923p702Ad0001dc00dsc00dp00icFFisc00ip00in00
PRODUCT=3923/702a/1
SEQNUM=1082
SUBSYSTEM=usb
TYPE=0/0/0
USEC_INITIALIZED=2286

UDEV  [39.006199] remove   /devices/soc0/amba@0/e0002000.usb/ci_hdrc.0/usb1/1-1/1-1.3/1-1.3:1.0 (usb)
ACTION=remove
DEVPATH=/devices/soc0/amba@0/e0002000.usb/ci_hdrc.0/usb1/1-1/1-1.3/1-1.3:1.0
DEVTYPE=usb_interface
ID_VENDOR_FROM_DATABASE=National Instruments Corp.
INTERFACE=255/0/0
MODALIAS=usb:v3923p702Ad0001dc00dsc00dp00icFFisc00ip00in00
PRODUCT=3923/702a/1
SEQNUM=1083
SUBSYSTEM=usb
TYPE=0/0/0
USEC_INITIALIZED=2286

UDEV  [39.013553] remove   /devices/soc0/amba@0/e0002000.usb/ci_hdrc.0/usb1/1-1/1-1.3 (usb)
ACTION=remove
BUSNUM=001
DEVLINKS=/dev/usb_gpib
DEVNAME=/dev/bus/usb/001/005
DEVNUM=005
DEVPATH=/devices/soc0/amba@0/e0002000.usb/ci_hdrc.0/usb1/1-1/1-1.3
DEVTYPE=usb_device
ID_BUS=usb
ID_MODEL=702a
ID_MODEL_ENC=702a
ID_MODEL_ID=702a
ID_REVISION=0001
ID_SERIAL=3923_702a
ID_USB_INTERFACES=:ff0000:
ID_VENDOR=3923
ID_VENDOR_ENC=3923
ID_VENDOR_FROM_DATABASE=National Instruments Corp.
ID_VENDOR_ID=3923
MAJOR=189
MINOR=4
PRODUCT=3923/702a/1
SEQNUM=1084
SUBSYSTEM=usb
TYPE=0/0/0
USEC_INITIALIZED=1346
  • @MarkPlotnick I ran the command and replugged the device twice. I included it in my original question. – Amari Nov 2 '17 at 13:21
  • Sorry, I should've asked for a little more detail. Can you run sudo udevadm monitor --udev --environment while plugging in your device and show what it prints out? – Mark Plotnick Nov 2 '17 at 13:28
  • @MarkPlotnick OK, I have the longer version added now – Amari Nov 2 '17 at 13:36
  • I'll look into what created the /dev/usb_gpib. What Linux distro are you using and where did the linux-gpib package come from? – Mark Plotnick Nov 2 '17 at 15:16
  • Make a Symlink `KERNEL=="gpib[0-9]*", ACTION=="add", SYMLINK+="gpib0%n, MODE="660", GROUP=="plugdev" – user192526 Nov 2 '17 at 15:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.