Hi everyone,
This thread and the install script were very helpful. However, out of the clipboard it didn't quite work for me. I'm using a Raspberry pi CM4 on the reference I/O expander board. Running Raspbian Bullseye in late May of 2023.
Here are the changes / extra steps I did to get it working for my Agilent 82357A GPIB to USB adapter:
Add "arm_64bit=0" to ./boot/config.txt
Added "/home/pi/.local/bin" to my path variable to resolve some warnings. The command is:
export PATH=$PATH:/home/pi/.local/bin
added make clean between the make and make install steps
in step 2 ran the risky kernel upgrade: "sudo apt-get install --reinstall raspberrypi-bootloader raspberrypi-kernel"
measat_releaseX1.8.hex doesn't work, put 82357a_fw.hex where measat was going in step 4.2, in my case"/usr/local/share/usb/agilent_82357a"
ignored system.map errors when installing the kernel driver
reboot between steps - if something doesn't work reboot and try again, then if still not working run "sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade" and reboot again and try again.
step 6.1 was needed
In 4.2 the gpib.conf file, board type = agilent_82357a
Also in step 4 if people copy and paste the wget command with the HTML url tags then it will fail to download.
I also manually edited the file gpib.conf in step 4 since I wasn't sure if the script would work as intended. Replacing: board_type = "NI HS whatever" with board_type = "agilent_82357a"
Also keep in mind 6.2 is still using the measat firmware so it needs to be adjusted before attempting to use it with a Agilent 82357A.
Install GPIB on Linux with Agilent USB-GPIB adapter (tested with Raspberry Pi OS Lite 32bit 2022-04-04 Bullseye (5.15.32-v7+) and linux gpib 4.3.4 (r2025) on pi3):
Joe Meta's tweaks:
Add "arm_64bit=0" to ./boot/config.txt
//my path = /home/pi/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
export PATH=$PATH:/home/pi/.local/bin
echo $PATH
added make clean between the make and make install steps
in step 2 ran the risky kernel upgrade: "sudo apt-get install --reinstall raspberrypi-bootloader raspberrypi-kernel"
measat_releaseX1.8.hex doesn't work, put 82357a_fw.hex where measat was going in step 4.2, in my case"/usr/local/share/usb/agilent_82357a"
ignore system.map errors
reboot between steps - if something doesn't work reboot and try again, then if still not working run "sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade" and reboot again and try again.
step 6.1 was needed
Sources:
[url]https://xdevs.com/guide/agilent_gpib_rpi/[/url]
[url]https://www.eevblog.com/forum/metrology/raspberry-pi23-logging-platform-for-voltnuts/msg1301773/#msg1301773[/url]
[url]https://www.eevblog.com/forum/reviews/using-a-raspberry-pi-with-linux-gpib-and-a-beiming-or-agilent-usb-gpib-adapter/?all[/url]
[url]https://sourceforge.net/p/linux-gpib/code/HEAD/tree/trunk/[/url] -> History
1. Preparation
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && echo 'Rebooting...' && sudo reboot
2. Install Kernel-Headers
sudo apt-get install raspberrypi-kernel-headers && [ -d /usr/src/linux-headers-$(uname -r) ] && echo 'kernel-headers installed' || echo 'ERROR: wrong or no kernel-headers installed: '$(ls /usr/src/)', should be '$(uname -r | cut -d+ -f1)
//If newer headers are installed, updating kernel could be an option (at your own risk)
sudo apt-get update && sudo apt-get install --reinstall raspberrypi-bootloader raspberrypi-kernel
//If older headers are installed, we are stuck and have to wait until the newer headers are released
3. Install GPIB
3.1 Install build-tools
sudo apt-get install build-essential texinfo texi2html libcwidget-dev tcl8.6-dev tk8.6-dev libncurses5-dev libx11-dev binutils-dev bison flex libusb-1.0-0 libusb-dev libmpfr-dev libexpat1-dev tofrodos subversion autoconf automake libtool libpython3-dev
3.2 Build & install GPIB kernel module //was getting stuck here
sudo svn checkout svn://svn.code.sf.net/p/linux-gpib/code/trunk /usr/local/src/linux-gpib-code
cd /usr/local/src/linux-gpib-code/linux-gpib-kernel/ && sudo make
sudo make clean
sudo make install
3.3 Build & install GPIB user module
cd /usr/local/src/linux-gpib-code/linux-gpib-user/
sudo ./bootstrap
sudo ./configure
sudo make
sudo make clean
sudo make install
4. Install Agilent 82357a
4.1 Get Firmware
cd /usr/local/src/linux-gpib-code/ && sudo apt-get install fxload
&&
sudo wget [url]https://linux-gpib.sourceforge.io/firmware/gpib_firmware-2008-08-10.tar.gz[/url]
&&
sudo tar xvzf gpib_firmware-2008-08-10.tar.gz
&&
cd /usr/local/src/linux-gpib-code/gpib_firmware-2008-08-10/agilent_82357a/
4.2 Config
//adapter
sudo nano $(sudo find / -name 'gpib.conf' | grep etc) //new location since r1757 (changed from /etc/gpib.conf to $(sysconfdir)/gpib.conf)
-> board_type = "agilent_82357a"
//auto download firmware - wrong file, correct location - should use 82357a_fw.hex
//sudo cp /usr/local/src/linux-gpib-code/gpib_firmware-2008-08-10/agilent_82357a/measat_releaseX1.8.hex $(sudo find / -type d -name 'agilent_82357a' | grep usb | grep -v gpib)
//corrected version:
sudo cp /usr/local/src/linux-gpib-code/gpib_firmware-2008-08-10/agilent_82357a/82357a_fw.hex $(sudo find / -type d -name 'agilent_82357a' | grep usb | grep -v gpib)
//udev rules
sudo cp /usr/local/etc/udev/rules.d/* /etc/udev/rules.d/ //seems that the udev rules are copied to incorrect location - bug in gpib or raspbian? In r1730 everything is fine, in which release does it break?
// Grant user permission
// Since r1748, group gpib has to be created manually
sudo groupadd gpib
// Add user to group - for other user replace 'pi' with name of other user
sudo adduser pi gpib
5. Finish
5.1 Reboot
sudo reboot
//after reboot, all leds should be lit on the adapter (2x green, red) and finally only one green, if not there is a problem (see 6)
//after plug-in the adapter all leds should be lit (2x green, red) and finally only one green, if not there is a problem (see 6)
5.2 Test with connected equipment (optional)
ibtest
d
//device id
w
//after here is device specific, given are examples for HP/Agilent/Keysight devices (tested with 3457A/3458A)
END ALWAYS
w
ID?
r
[enter]
//prints: HP345xA
q //quit
6 Trouble-shooting
6.1 Test gpib module
lsmod | grep gpib_common
//Should give a line back with gpib_common, if not try next step
sudo modprobe gpib_common
lsmod | grep gpib_common
//should finish without error & print gpib_common, else gpib is not installed -> try 3. and watch out for errors
6.2 Test Adapter (only needed if not all leds are lit)
//Load Firmware for testing (latest point to plugin Adapter)
cd /usr/local/src/linux-gpib-code/gpib_firmware-2008-08-10/agilent_82357a/
lsusb -d 0957:0518 //output: Bus xxx Device yyy: ID 0957:0518 Agilent Technologies, Inc. 82357B GPIB Interface
sudo fxload -t fx2 -D /dev/bus/usb/xxx/yyy -I ./measat_releaseX1.8.hex //1st FW load
lsusb -d 0957:0518 //output: Bus xxx Device zzz: ID 0957:0518 Agilent Technologies, Inc. 82357B GPIB Interface
sudo fxload -t fx2 -D /dev/bus/usb/xxx/zzz -I ./measat_releaseX1.8.hex //2nd FW load
lsusb -d 0957:0718 //output (ID changed to 0957:0718 and all leds 2x green & red on adapter are lit) : Bus xxx Device xyz: ID 0957:0718 Agilent Technologies, Inc.
lsmod | grep agilent //output (2 lines): agilent_82357a & gpib_common
6.3 Test userspace
sudo ldconfig && sudo gpib_config
//finish without error, else the configuration is not correct -> 4.2