I only have rpi1, so i cannot test this logging platform.
fxload -t fx2 -D /dev/bus/usb/001/004 -I /opt/gpib_firmware/gpib_firmware-2008-08-10/agilent_82357a/measat_releaseX1.8.hex
Aug 18 19:06:40 raspberrypi kernel: [ 202.257222] gpib: no gpib board configured on /dev/gpib0
Aug 18 19:06:40 raspberrypi kernel: [ 202.257328] gpib: no gpib board configured on /dev/gpib0
Aug 18 19:06:40 raspberrypi kernel: [ 202.257365] gpib: no gpib board configured on /dev/gpib0
Aug 18 19:07:07 raspberrypi kernel: [ 229.381524] attached to bus interface 0, address 0xd94ae600
Aug 18 19:07:07 raspberrypi kernel: [ 229.406328] agilent_82357a_attach: attached
Hi all,
Ok.......I'm gonna bite the bullet just for fun and so I've ordered a Rasp Pi 3 Model B and I've had a look through this thread and I'm looking for the one post that lays it out what to do when starting from scratch to get 3458a & temperature logging operational.....right from how to install the OS. Any pointers appreciated.
I see this page, is this the one:
https://xdevs.com/guide/agilent_gpib_rpi/
I've got:
82357B (clone) GPIB USB adaptor (this looks the obvious one to use)
Galvant GPIBUSB adaptor (just thought I'd mention it)
Silicon Labs Si7051-EVB temp/humidity sensor (probably not supported, but would be nice)
Ian.
curl https://raw.githubusercontent.com/PlesaEEVBlog/RPi_LogNut/master/Install_GPIB_Support.sh | sudo bash
For settng web and Sambacurl https://raw.githubusercontent.com/PlesaEEVBlog/RPi_LogNut/master/Web_Samba.sh | sudo bash
IanJ
You can follow plesa's suggestion, it works great. My guide you linked is somewhat manual process, which is still might be of interested to understand what is actually going on, instead of running one command which does some magic behind the curtains .
Perhaps I should update it with "Automated install" section.
After image recovery runCode: [Select]curl https://raw.githubusercontent.com/PlesaEEVBlog/RPi_LogNut/master/Install_GPIB_Support.sh | sudo bash
For settng web and SambaCode: [Select]curl https://raw.githubusercontent.com/PlesaEEVBlog/RPi_LogNut/master/Web_Samba.sh | sudo bash
Supported interfaces are Agilent 82357B, National Instruments NI GPIB-USB-HS and their clones eg. Keithley ones.Also the Ethernet GPIB gateway Agilent E5810A/B are supported and tested.
On github there are www and Python folders with multiple examples with D3.js and C3.js ( easier for configuration)
Only BME280 and DS18S20 supported, but adding support will be easy.
curl https://raw.githubusercontent.com/PlesaEEVBlog/RPi_LogNut/master/Install_GPIB_Support.sh | sudo bash
And after a few minutes got this at the very end:Successfully built si-prefix
Installing collected packages: si-prefix
Successfully installed si-prefix-0.5
Agilent 82357B found
failed to bring board online
failed to configure board
main: No such device
pi@raspberrypi:~ $
I haven't got the 82357B plugged into my 3458a as yet........just trying it with USB connected at the mo.Hi Ian,
please can you post lsusb when adapter is connected?
The end of scrip failed, so you will needs to edit gpib.conf to setup the correct adapter.
We needs to make sure GPIB adapter is recognized.
pi@raspberrypi:~ $ lsusb
Bus 001 Device 005: ID 0957:0518 Agilent Technologies, Inc. 82357B GPIB Interface
Bus 001 Device 016: ID 0dc6:3412 Precision Squared Technology Corp.
Bus 001 Device 015: ID 046d:c535 Logitech, Inc.
Bus 001 Device 014: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 019: ID 0957:0718 Agilent Technologies, Inc.
Bus 001 Device 016: ID 0dc6:3412 Precision Squared Technology Corp.
Bus 001 Device 015: ID 046d:c535 Logitech, Inc.
Bus 001 Device 014: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Code: [Select]Bus 001 Device 019: ID 0957:0718 Agilent Technologies, Inc.
Ian.
Reading package lists... Done
Building dependency tree
Reading state information... Done
fxload is already the newest version (0.0.20081013-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Requirement already up-to-date: pip in /usr/lib/python2.7/dist-packages
Requirement already satisfied: si-prefix in /usr/local/lib/python2.7/dist-packages
pi@raspberrypi:~ $
Using /usr/lib/python2.7/dist-packages
Finished processing dependencies for Adafruit-GPIO==1.0.3
------------DONE---------------------
Run
sudo smbpasswd -a pi
to set Samba password
Added both USB ID to script. Thanks for feedback.
On github are the python scripts and also few examples of webpages with plots ( I recommends to use C3.js instead of D3.js).
Just download them and place to /pub/ folder. Or should I create separate git repository for www and python?
Added both USB ID to script. Thanks for feedback.
On github are the python scripts and also few examples of webpages with plots ( I recommends to use C3.js instead of D3.js).
Just download them and place to /pub/ folder. Or should I create separate git repository for www and python?
I'm not really sure what you mean (I'm a Pi newbie so need step by step)........I can see a bunch of html files at pub\Rpi_LogNut, so what do I do now......?
I thought for a moment those files were at the Pi webserver webroot but they are not, so assuming something else.
Ian.
In the folder pub\Rpi_LogNut is the copy of git repository. So you can copy all files in \pub\Rpi_LogNut\www to \pub\www and all files from pub\Rpi_LogNut\Python to \pub\python.
After that on the RPi you should see webpage with examples. The examples will not display graphs because there are no logs in \pub'log folder.
Scrips from \pub\Python you can run, but check in file the correct GPIB address and used interface, some examples are using the LAN-GPIB.
just type python and the name of script.
pi@raspberrypi:~ $ python /var/www/python/3458A_DCV_Log.py
libgpib: ibBoardOpen failed to open device file /dev/gpib0
libgpib: Permission denied
libgpib: error in is_cic()!
Traceback (most recent call last):
File "/var/www/python/3458A_DCV_Log.py", line 10, in <module>
inst = Gpib.Gpib(0,22, timeout=60)
File "/usr/local/lib/python2.7/dist-packages/Gpib.py", line 26, in __init__
self.id = gpib.dev(name, pad, sad, timeout, send_eoi, eos_mode)
gpib.GpibError: dev() error: Bad file descriptor (errno: 9)
In the folder pub\Rpi_LogNut is the copy of git repository. So you can copy all files in \pub\Rpi_LogNut\www to \pub\www and all files from pub\Rpi_LogNut\Python to \pub\python.
After that on the RPi you should see webpage with examples. The examples will not display graphs because there are no logs in \pub'log folder.
Scrips from \pub\Python you can run, but check in file the correct GPIB address and used interface, some examples are using the LAN-GPIB.
just type python and the name of script.
Ok, my webroot is /var/www/html
I've copied python folder one down so /var/www/python
I should note at first I got permission denied when trying to copy files to web root, but after gksudo pcmanfm (I googled it) thenb I was able to copy.
So next I tried at the command prompt:Code: [Select]pi@raspberrypi:~ $ python /var/www/python/3458A_DCV_Log.py
libgpib: ibBoardOpen failed to open device file /dev/gpib0
libgpib: Permission denied
libgpib: error in is_cic()!
Traceback (most recent call last):
File "/var/www/python/3458A_DCV_Log.py", line 10, in <module>
inst = Gpib.Gpib(0,22, timeout=60)
File "/usr/local/lib/python2.7/dist-packages/Gpib.py", line 26, in __init__
self.id = gpib.dev(name, pad, sad, timeout, send_eoi, eos_mode)
gpib.GpibError: dev() error: Bad file descriptor (errno: 9)
On my Windows Excel macro my usb 82357 address is GPIB0::22:INSTR
The python script I haven't touch, I can see it's set to 22 already, not sure about the interface selection though.
Ian.
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):
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
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 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 install
4. Install Agilent 82357a
4.1 Get Firmware
cd /usr/local/src/linux-gpib-code/ && sudo apt-get install fxload && sudo wget http://linux-gpib.sourceforge.net/firmware/gpib_firmware-2008-08-10.tar.gz && 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
//new location since r1757 (changed from /etc/gpib.conf to $(sysconfdir)/gpib.conf)
sudo vi $(sudo find / -name 'gpib.conf' | grep etc)
-> board_type = "agilent_82357a"
// hit x to delete, then copy "agilent_82357a" and insert with right click, hit ESC and type wq + Enter (saves the file and exits)
//auto download firmware
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)
//udev rules
//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?
sudo cp /usr/local/etc/udev/rules.d/* /etc/udev/rules.d/
// 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
As I and others had quite some trouble to get the current gpib version 4.2.0 (r1771) to run on raspi with the Agilent adapter, I decided to put together a guide.