Ha, managed to miss this thread completely over the last week while setting up a pi to do 3458A data logging. Oops.
As for linux-gpib, I agree that it's been a little involved to get setup. I did a bit of work over the weekend and have made Debian packages for the kernel module and userspace library. I need to make one for the firmware and then do a bit of polishing, but it should be available in the next Debian and Ubuntu releases through apt. Rasbian builds their packages from the Debian repo but since this has a kernel module I'm guessing there'll be some additional work needed.
In the meanwhile I'm in the middle of pushing the packages to a PPA so it will be available for at least 16.04 onwards. The link below should work in the next day or so.
https://launchpad.net/~dkozel/+archive/ubuntu/linux-gpib
After image recovery run
curl https://raw.githubusercontent.com/PlesaEEVBlog/RPi_LogNut/master/Install_GPIB_Support.sh | sudo bash
For settng web and Samba
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.
Plesa, Thank you for you hard work to make this project working.
I prepare sdcard today and there is some changes:
1. Current version of raspbian is 2019-04-08-raspbian-stretch with kernel 4.14.98+
2. linux-gpib-4.0.4 is not available any more. Please, update your script Install_GPIB_Support.sh to download
https://downloads.sourceforge.net/project/linux-gpib/linux-gpib%20for%203.x.x%20and%202.6.x%20kernels/4.1.0/linux-gpib-4.1.0.tar.gz and change according followed commands.
3. For script Web_Samba.sh change python-wxglade to wxglade (name was changed). During creation of directory in pub you made small typo and create 'log' instead of 'log
s' .
I can confirm that this setup working fine with counterfeit 82357B and Raspberry Pi Model B Rev 2 and talk with Amrel PPS 30-2.5 .
Note for the other users - don't use
sudo rpi-update
because it upgrade the kernel to 4.19.37+, but apt-get still download 4.14.98+ source and compilation of linux-gpib finish with errors.
Hi,
with the support of Santa's little helper I was able to get RPi3 up and running with linux-gpib and GPIB-USB-adapter. I can strongly recommend this solution and have to say thanks to the guys that helped not only to get the adapter running, but also snake script controlling GPIB devices and serial interface for my ambient sensors.
My tool chain is RPi3 running the Python script in the background, which writes all data I need into a file, Bitwise on my Windows10 laptop to grap latest data via SSH and control RPi and GNU Octave on my Windows machine to visualize data with nice plots. So a complete open source solution/tool chain. I won't become a Python fanboy, but it's doing it's job reliable by now.
-branadic-
Has anyone tried to install the new Linux-GPIB 4.3.0 drivers?
Hi,
with a little help of a voltnut I got the latest GPIB driver 4.3.0 up and running on a RPi4 with EEPROM update, so power consupmtion and CPU temperature already dropped.
A very nice solution for longterm logging and visualization is the installation of the TICK stack (or at least influxdb plus Chronograf), saving time series data such as output of a voltage reference together with ambient sensor data into an influxdb database, a time series database (TSDB). Chronograf can be used to get fast access to the data and to plot them, without any line of code.
Here is how you install the stack:
https://iotbyhvm.ooo/tick-satck-on-raspberry-pi/ I can share python skript and how to's to get it up and running.
Simply use a browser, enter the database directly on the system, drag and drop the graphs you need. Or access the data from any other computer in the network with a browser. I have nice little 10" displays 1280x800 all over the place to show what's going on during measurements or inside temperature controlled labs. We now have multiple systems up and running and also added an OPCUA server based on free opc ua (
https://github.com/FreeOpcUa) so that data are also available over an industrial standard interface in a bigger network or if you prefer for AI based analysis.
It's fairly simple especially for people not experienced with Linux. I strongly recommend this solution and it is running stable.
-branadic-
Hi,
with a little help of a voltnut I got the latest GPIB driver 4.3.0 up and running on a RPi4 with EEPROM update, so power consupmtion and CPU temperature already dropped.
A very nice solution for longterm logging and visualization is the installation of the TICK stack (or at least influxdb plus Chronograf), saving time series data such as output of a voltage reference together with ambient sensor data into an influxdb database, a time series database (TSDB). Chronograf can be used to get fast access to the data and to plot them, without any line of code.
Here is how you install the stack: https://iotbyhvm.ooo/tick-satck-on-raspberry-pi/ I can share python skript and how to's to get it up and running.
Simply use a browser, enter the database directly on the system, drag and drop the graphs you need. Or access the data from any other computer in the network with a browser. I have nice little 10" displays 1280x800 all over the place to show what's going on during measurements or inside temperature controlled labs. We now have multiple systems up and running and also added an OPCUA server based on free opc ua (https://github.com/FreeOpcUa) so that data are also available over an industrial standard interface in a bigger network or if you prefer for AI based analysis.
It's fairly simple especially for people not experienced with Linux. I strongly recommend this solution and it is running stable.
-branadic-
How has this still been working for you @branadic? I just got raspbian 10 "buster" running with the Keysight 82357B on pi3. I'm looking at the TICK stack link and it looks like good instructions. Is anyone else using and tried this?
I went ahead and installed it... figuring it out now. It looks like the connection is refused to webserver port 8083 by default. I'm sure it's security on the pi3.
Thnx,
B
It works fine for me, though I use the TICK stack only at work. If you like I can share a complete image, with everything set up. It is based on Raspbian buster too. The port for Chronograf is 8888.
-branadic-
That worked when I tried 8888 instead of the other port 8083 I was trying... thanks! I built my image from scratch. I've got the GPIB working with Keysight adapter with a few tips from TiN's blog... thanks Illya!
This looks like some totally legit modern data scientist stack to me! The ratings prove that...now I gotta learn this SQL like language and figure out how to ingest the 3458 and see if I can get the USB-PA (BME280) in here too.
Bill
What do you use at home? This is pretty awesome how it works and I'm totally new with this. I see the pi3 machine stats can show up really easily! The dashboards stuff is really sweet.
Can you share some python scripts you use with 3458 with python and pyvisa? If it can dump to even a csv Chronograf can suck it right in since the TICK stack is a real database wow this is legit... thanks for the tip branadic!
Bill
If I had known before I would have just taken you up on the image but since I've got it all running now... maybe no point? IDK you're the expert here lololol... well you've use this more than me.
I found the xDevs.com Python test GPIB app script and it's a start. Perhaps if I get a group of scripts together that work I'll make a post about it. TiN's stuff is about the best compilation I've found so far.
It works fine for me, though I use the TICK stack only at work. If you like I can share a complete image, with everything set up. It is based on Raspbian buster too. The port for Chronograf is 8888.
-branadic-
Branadic, can you post a python script that you use to write to TICK stack. Thank you in advance!
Attached is an example script, that reads BMP085 and SHT21 via I²C and writes them into an influxdb database.
Rename it to *.py
The script is started with the command line:
python AmbientSensors.py -db="your database name" -sn="your measurement series"
example:
python AmbientSensors.py -db=AmbientData -sn=test
You need to create a database first:
1. sudo service inflxudb start
2. sudo netstat -lp|grep 8086 --> check if everything is working as expected, port 8086 should be in use
3. influx -precision rfc3339
4. create database "your database name"
(show databases and drop database are relevant commands)
5. leave the influxdb with "exit"
Hope that helps.
-branadic-
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.
The base - without the specific Agilent adapter part - should be universal for all adapters.
I am not the brightest light on linux, so if there is something to improve, your contribution is welcome!
Install GPIB on Linux with Agilent USB-GPIB adapter (tested with raspbian stretch 2018-12-03 (4.14.79-v7+) and linux gpib 4.2.0 (r1771) on pi3 & pi b+):
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 libpython-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 ./bootstrap && sudo ./configure && 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
//Alternative, for version < 4.2.0 (<=r1730, in r1731 the gpib is splitted into kernel and usermode)
//3.2 Build & install GPIB 4.1.0 with latest fixes
//sudo svn checkout -r 1730 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/ && 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 [url]http://linux-gpib.sourceforge.net/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 vi $(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
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
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), if not there is a problem
//after plug-in the adapter all leds should be lit (2x green, red), if not there is a problem
5.2 Test with connected equiptment (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
Hi everyone!
When I try to connect my rpi3 and Agilent gpib on the point 3.2 from this guide I have an error on command ./bootstrap command not found
have any ideas?
What is the content of your /usr/local/src/linux-gpib-code/linux-gpib-kernel/ folder?
Never mind. I just checked on my installation. The kernel module only requires a make -> sudo make install
Edit 2:
You might also want to change step 3.3 from
.configure to ./configure --sysconfdir=/etc
Looking at the repository, I don't think the kernel driver uses autoconf (anymore?). For step 3.2, try getting rid of ./bootstrap and ./configure, so just cd ... && make && sudo make install.
Hi together,
Many thanks to MiDi, with his guide it was very easy to set up a Rapsberry Pi 4 with the Agilent GPIB Adaptor, but...
I would like to use both of my Agilent GPIB adaptors as before with windows (I have more than 14 instruments connected with a lot of cable and I had problems by using only a single GPIB bus in the past).
I simply added (copied the whole interface section) another interface with minor=1 in the gpib.conf
lsusb showed the changed IDs, therefore it seems that both adaptors has gotten the firmware. If I connect just one adaptor the LEDs turn into green and it works (ibtest, python etc). As soon as I connect the second one, the LEDs from the first one turn off and the second one becomes green. It doesn't matter which one I connect first, only the latest one is working.
Does anyone have experience with that or any idea?
Best regards
Philipp
Very much appreciated Philipp, glad the guide is helpful.
As stated earlier, the guide needs some modifications for new linuxgpib version 4.3 as there were major changes.
I would have to dive into it, but at the moment there is not the required spare time for this.
If someone would post needed modifications to get it work, I would update the guide.
Now to your problem Philipp:
Editing /usr/local/etc/hotplug/usb/agilent_82357a seems to do the trick:
# Multi-board with serial numbers
# Uncomment and edit the code below to setup the serial numbers and minors
# that correspond to your system.
#
#case $SERIAL in
# A0000001) GPIB_CONFIG_OPTIONS="--minor 0"
# ;;
# A0000002) GPIB_CONFIG_OPTIONS="--minor 1"
# ;;
#esac
#
To get the Serial to replace A0000001 and A0000002 for each device:
lsusb -d 0957:0518
lsusb -d 0957:0718
//Gives e.g.: Bus 001 Device 030: ID 0957:0718 Agilent Technologies, Inc.
sudo lsusb -v -s [Device e.g. 030]
//do this for each device listed and get the iSerial (e.g.: MX42480527)
Hi MiDi,
thank you very much for your fast help. Yes, the guide isn't up to date and you cannot just copy and paste the commands, but it leads you very quick to the desired results.
It is similiar with your tip: I don't have this hotplug folder, but I edited the 98-gpib-generic.rules (there was already an example).
SUBSYSTEM=="usb", ACTION=="add|change", ATTRS{idVendor}=="0957", ATTRS{idProduct}=="0718", ATTRS{serial}=="MY53xxxxx1", ENV{GPIB_CONFIG_OPTIONS}="--minor 0"
SUBSYSTEM=="usb", ACTION=="add|change", ATTRS{idVendor}=="0957", ATTRS{idProduct}=="0718", ATTRS{serial}=="MY53xxxxx2", ENV{GPIB_CONFIG_OPTIONS}="--minor 1"
That helped with the adaptors itself and both are green now and dmesg is telling me that it attaches one with minor 0 and the other with minor 1, but the rest isn't working anymore. Python3 doesn't connect to any device and even ibtest isn't working anymore.
Sounds like a stupid mistake at some point...
Go through #6 of my guide, hopefully that helps.
hmmm all working good with ni_usb. But now when I type gpib_config I have this: failed to open device file '/dev/gpib0'
main: No such file or directory
can some advice?