Electronics > Metrology

Raspberry Pi for GPIB and data analysis: very easy and fully equipped

(1/10) > >>


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:

--- Code: ---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
--- End code ---

reboot the Pi (This is unfortunately neccessary, because there a sometimes problems to have the right kernel headers for the running kernel)

--- Code: ---sudo reboot
--- End code ---

and then this line (without the [ url ] tags. Better go to the GitHub page and copy from there):

--- Code: ---mkdir ~/repos && cd ~/repos && git clone [url]https://github.com/PhilippCo/meas_rpi.git[/url] && meas_rpi/install.sh
--- End code ---

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:

--- Code: --->>> import vxi11
>>> instr = vxi11.Instrument('TCPIP::,4::INSTR')
>>> instr.ask("*IDN?")
--- End code ---

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

Hello e61_phil - this is a major achievement (milestone) for Voltnuts community - unfortunately a lot of people have not yet understood the impact of your work !

GREAT JOB - well done !

Un saludo / Best regards

Yeah thanks Phil... I'll try your setup too.  Love to see more of this kind of thing here!  :-+


Thanks for your feedback!

I added a very simple Jupyter Notebook to update all the repos on the Pi. This way it is easy to add more examples and so on without setting up the Pi again.

Just open the Jupyter Lab (<RPI IP>:8888 in your browser) and click "Restart Kernel and run all".

There is also an even simpler Notebook to shutdown the Pi. There is no need to use the linux console if you just want to control some testgear.

I also added a analysis subdirectory with a simple example of an INL calculation. That notebook takes the Transmile data from TiNs Server (branadic showed it another thread) and calculates the INL. Everything happens on the Pi. You can interactely zoom in and out into the graph, resize ist and everything you know from MATLAB or similar tools. Just to show that it is really simple to start with Jupyter.

Thank you for posting this, great work!!
Installation went fine on a Raspberry Pi Zero W V1.1 as far as I can tell, only JupyterLab is slow on that kind of hardware.

Unfortunately my Cheap (139.33 EUR) Fake NI GPIB-USB-HS bought on eBay in Feb 2020 refuses to cooperate. Curiously it works fine with a fresh, up to date LabView under Windows. But after multiple attempts at getting it to work with linux-GPIB on all the Raspberry Pi models (3, 4, zero) with all available Kernels and OS versions (even the new 64 bit Raspberry Pi OS for the 4) I have to conclude that it's not meant to be. Gotta stick with my TAMS L488 and its noisy PoE for now.

Here's how it looks. I would stay clear of cheap eBay listings in 'New' condition. Perhaps the cheap fake Agilent adapter works better?  :-//


[0] Message Index

[#] Next page

There was an error while thanking
Go to full version