What this is for
The Agilent 82357B, later sold as Keysight 82357B, is a USB-to-GPIB adapter. It lets a Linux PC talk to older lab instruments that still use the GPIB connector.
On Linux the adapter needs three things: the linux-gpib driver,
a firmware upload via fxload, and a small GPIB configuration file.
The steps below keep explanation and terminal commands separate, so you can copy
each command block without copying the surrounding text.
Tested environment
- Pop!_OS 22.04 LTS / Ubuntu 22.04 LTS
- Kernel 6.x
- linux-gpib 4.3.7 SourceForge tarball
- Python 3.10 with PyVISA and PyVISA-py
If you use a newer Ubuntu release, the same idea should still apply, but package names and kernel headers are the first things to check when a build fails.
1. Download the linux-gpib source
Use the 4.3.7 release tarball from SourceForge. The older SVN checkout can lag behind on modern kernels, so the tarball is the safer beginner path.
wget https://sourceforge.net/projects/linux-gpib/files/linux-gpib/4.3.7/linux-gpib-4.3.7.tar.gz
tar -xzf linux-gpib-4.3.7.tar.gz
cd linux-gpib-4.3.7
What this does: wget downloads the archive, tar unpacks it,
and cd moves you into the folder where the build commands must run.
2. Install build tools and compile linux-gpib
The driver has to be built against your currently running kernel. That is why the
command installs linux-headers-$(uname -r): it asks Linux for the exact
kernel version and installs matching headers.
sudo apt update
sudo apt install build-essential linux-headers-$(uname -r) fxload texinfo bison flex
./configure
make
sudo make install
sudo ldconfig
Expected result: make finishes without compiler errors, and
sudo make install installs the kernel module and userland tools.
3. Load the GPIB kernel modules
Plug in the 82357B adapter, then load the generic GPIB support module and the adapter-specific module.
sudo modprobe gpib_common
sudo modprobe agilent_82357b
Now check whether Linux sees the modules and whether the kernel logged anything useful.
lsmod | grep gpib
dmesg | tail -20
Expected result: you should see GPIB-related modules in lsmod. The adapter LED
should turn green after the firmware is available and the adapter is initialized.
4. Add a udev rule for firmware upload
The adapter needs firmware after it is plugged in. A udev rule tells Linux:
when this USB device appears, run fxload and upload the firmware file.
sudo nano /etc/udev/rules.d/99-gpib.rules
Paste this rule into the file, save it, and close the editor.
SUBSYSTEM=="usb", ACTION=="add", ATTR{idVendor}=="0957", ATTR{idProduct}=="0107", RUN+="/sbin/fxload -t fx2 -I /usr/share/usb/agilent_82357b_firmware.hex -D $tempnode"
Reload udev so Linux uses the new rule.
sudo udevadm control --reload-rules
sudo udevadm trigger
If the LED stays dark after reconnecting the adapter, this rule and the firmware path are the first things to check.
5. Create a minimal GPIB configuration
The GPIB config tells linux-gpib which driver to use and what the controller is called.
For one 82357B adapter, gpib0 is a simple default name.
sudo nano /etc/gpib.conf
Paste this minimal configuration into the file.
interface {
minor = 0
board_type = "agilent_82357b"
name = "gpib0"
pad = 0
sad = 0
timeout = T3s
}
The instrument address is not configured here. You use it later in the PyVISA resource
string, for example GPIB0::22::INSTR for an instrument set to address 22.
6. Verify communication with PyVISA
Use a small Python virtual environment so the test does not depend on system-wide Python
packages. The command below creates .venv, activates it, and installs PyVISA.
python3 -m venv .venv
source .venv/bin/activate
python -m pip install pyvisa pyvisa-py
Then run this Python test. Change 22 if your instrument uses a different
GPIB address.
import pyvisa
rm = pyvisa.ResourceManager('@py')
print(rm.list_resources())
inst = rm.open_resource('GPIB0::22::INSTR')
print(inst.query('*IDN?'))
Expected result: list_resources() shows something like
('GPIB0::22::INSTR',), and *IDN? returns the identification string
of the connected instrument.
Common failure points
- LED stays dark: firmware upload did not run. Check the udev rule, reconnect the adapter, and verify
lsusbshows vendor ID0957. /dev/gpib0is missing: the kernel module is not loaded or the config is wrong. Runsudo modprobe agilent_82357bagain and inspectdmesg.- PyVISA finds nothing: check
/etc/gpib.conf, instrument address, permissions, and whether the instrument is powered on. - Build fails: confirm that
linux-headers-$(uname -r)is installed for the exact running kernel.
Sources and notes
- linux-gpib 4.3.7 release tarball from SourceForge
- Keysight / Agilent 82357B product documentation
- Tom Verbeure's 82357B Linux notes, useful as a second reference path