Hi,
based on MiDis description I set up a simple script which fully installs GPIB on a Raspberry Pi based on Rasperry Pi OS (with or without GUI).
The goal was to provide an as simple as possible solution to setup a Pi with everything you need to use GPIB with an Agilent or NI USB-GPIB adaptor.
After installing the Raspberry Pi OS on your Pi (by using Raspberry Pi Imager for example) you just need to copy&paste these two lines into the console:
sudo apt update && sudo apt -y upgrade && sudo apt-get -y install --reinstall raspberrypi-bootloader raspberrypi-kernel && sudo apt-get -y install raspberrypi-kernel-headers git
reboot the Pi (This is unfortunately neccessary, because there a sometimes problems to have the right kernel headers for the running kernel)
sudo reboot
and then this line (without the [ url ] tags. Better go to the GitHub page and copy from there):
mkdir ~/repos && cd ~/repos && git clone [url]https://github.com/PhilippCo/meas_rpi.git[/url] && meas_rpi/install.sh
The script, examples and so on are hosted on GitHub
https://github.com/PhilippCo/meas_rpi Please check that URL for the latest instructions!
The script will not only compile and install linux-GPIB to work with Agilent and NI adaptors, it will also install the following:
- PyVISA for Python3 (no it isn't big, it is just a couple of 100kB)
- a Vxi11 Server which acts as a poor mans Agilent E5810. With that you can use the Pi as a GPIB to Ethernet bridge
- my testgear lib to control instruments (no need to use it, but it makes many things easier)
- Jupyter Lab as a Service. This provides a web based development enviroment to control your instruments and run data analysis completely on the Pi without the need to install something else than a browser on your PC (http://<Pi IP>:8888 password:1281)
- Everything you need to do some data analysis in Python: Numpy, SciPy, Pandas, Matplotlib and so on
If you don't like pyvisa (for whatever reason) you can also use vxi11:
>>> import vxi11
>>> instr = vxi11.Instrument('TCPIP::192.168.2.48::gpib0,4::INSTR')
>>> instr.ask("*IDN?")
'HEWLETT-PACKARD,34401A,0,10-5-2'
If you run your meaurement script in Jupyter Lab, it will go on even if you close the browser.
I tested it on Raspberry Pi 4, Raspberry Pi 3B and Raspberry Pi 400
Best regards
Philipp