Poll

Interested/Instrument/Interface

Yes,3458A,GPIB
17 (23.9%)
Yes,3458A,Prologix
10 (14.1%)
Yes,K2001/K2002,GPIB
11 (15.5%)
Yes, post type of instrument and type of interface (GPIB,Prologix,USB,LAN, RS232)
29 (40.8%)
Not interested, why?
4 (5.6%)

Total Members Voted: 44

Voting closed: December 13, 2016, 11:12:53 am

Author Topic: Raspberry Pi2/3 logging platform for Voltnuts  (Read 145804 times)

0 Members and 2 Guests are viewing this topic.

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2365
  • Country: de
    • Frank Buss
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #350 on: August 10, 2017, 06:03:09 am »
I only have rpi1, so i cannot test this logging platform.

It should run on your Rapsberry Pi 1, too, works for me.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2365
  • Country: de
    • Frank Buss
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #351 on: August 18, 2017, 08:26:42 pm »
I bought an Agilent 82357B GPIB interface, probably a clone because it was cheap, and tried to use it with the logging platform. For this first I downloaded the latest Raspbian image, based on Debian 9 (Stretch), from this week, 2017-08-16-raspbian-stretch-lite.img. I've done the steps from https://raw.githubusercontent.com/PlesaEEVBlog/RPi_LogNut/master/Install_GPIB_Support.sh (maybe this should be renamed, because it does more, like updating the distribution, installing USBTMC etc.) manually to see if something went wrong and it worked mostly, even the linux-gpib driver could be compiled with the new Linux kernel version 4.9.41. One thing missing was the "pip" package (needs an additiona "sudo apt-get -y install python-pip"). Note: to enable SSH remote login, create an empty file "ssh" on the "boot" partition. Then you can login with the user "pi" and the password "raspberry" with ssh (or use putty from Windows).

Then I had problem to use the GPIB interface. When plugged in, "lsusb" showed "Bus 001 Device 004: ID 0957:0518 Agilent Technologies, Inc. 82357B GPIB Interface". I think the firmware load step was necessary, as described here: https://xdevs.com/guide/agilent_gpib_rpi/ . Bus 1 and Device 4 means, I had to do this:

Quote
fxload -t fx2 -D /dev/bus/usb/001/004 -I /opt/gpib_firmware/gpib_firmware-2008-08-10/agilent_82357a/measat_releaseX1.8.hex

After this command, the RPi hung, and stopped always after reboot. Turns out I had a power problem, maybe because of my cheap GPIB clone, or it needs really a lot of power. I could fix this by desoldering F3 on the RPi, near the power supply USB port, and short it with a nice big 1 mm silver wire, and then powering it with a good 3A USB power supply. You can see the location here:

http://www.tooms.dk/forum/topic.asp?TOPIC_ID=286

My RPi (a Raspberry Pi 1 Model B) doesn't have fuses near the output USB ports, but mounting holes, but if you have a model with F1 and F2, you might need to bridge these fuses as well. No more crashes now after shorting the fuse!

After the first flash (and some reboots because of the power problem), lsusb showed "Bus 001 Device 010: ID 0957:0718 Agilent Technologies, Inc.". So the second flash, as described on the website, was this: "fxload -t fx2 -D /dev/bus/usb/001/010 -I /opt/gpib_firmware/gpib_firmware-2008-08-10/agilent_82357a/measat_releaseX1.8.hex". Then another power cycle, just to be safe. Now lsusb shows this: "Bus 001 Device 009: ID 0957:0718 Agilent Technologies, Inc.".

And then the gpib_config command succeeded. Output of /var/log/syslog:

Quote
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

After this I could mount my samba share of my NAS system as usual with "mount.cifs //my-nas/share /mnt -o user=user,pass=password", which makes it easier to edit programs on my host PC. Then I started the Test_GPIB.py script. I tested it with my new Fluke 8842A, which doesn't have the "*IDN?", but sending a "G8" resulted in "FLUKE,8842A,0,V3.0"  :phew:

Finally I wrote a simple test script, which selects the 20 V range and prints the voltage measurement every second, see this file:

https://github.com/FrankBuss/RPi_LogNut/blob/master/pub/python/Fluke-8842A.py

(I really like the Fluke, 100 uV resolution in the 20 V range)

This will be available in plesa's repository, together with some other scripts and bugfixes by me and others, when he merges my pull request:

https://github.com/PlesaEEVBlog/RPi_LogNut/pull/1

plesa, if you merge the pull request, you might need to move the files from /pub/python to /python, if different or new, because in your repository is no /pub/python directory.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 
The following users thanked this post: TiN, DiligentMinds.com, 2N3055

Online IanJ

  • Supporter
  • ****
  • Posts: 1608
  • Country: scotland
  • Full time EE & Youtuber
    • IanJohnston.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #352 on: August 21, 2017, 04:48:57 pm »
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.
Ian Johnston - Original designer of the PDVS2mini || Author of the free WinGPIB app.
Website - www.ianjohnston.com
YT Channel (electronics repairs & projects): www.youtube.com/user/IanScottJohnston, Twitter (X): https://twitter.com/IanSJohnston
 
The following users thanked this post: Svgeesus

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #353 on: August 21, 2017, 05:07:27 pm »
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.

After image recovery run
Code: [Select]
curl https://raw.githubusercontent.com/PlesaEEVBlog/RPi_LogNut/master/Install_GPIB_Support.sh | sudo bashFor settng web and Samba
Code: [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.

 
The following users thanked this post: TiN, velik_kazakov

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4543
  • Country: ua
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #354 on: August 22, 2017, 04:26:09 am »
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  :-DD.

Perhaps I should update it with "Automated install" section.
YouTube | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Online IanJ

  • Supporter
  • ****
  • Posts: 1608
  • Country: scotland
  • Full time EE & Youtuber
    • IanJohnston.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #355 on: August 22, 2017, 10:40:21 am »
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  :-DD.

Perhaps I should update it with "Automated install" section.

Will do.

Btw, I presume Raspian OS will work ok?.......I see on your site some mention of OS build issues/incompatibilities?

Ian.
Ian Johnston - Original designer of the PDVS2mini || Author of the free WinGPIB app.
Website - www.ianjohnston.com
YT Channel (electronics repairs & projects): www.youtube.com/user/IanScottJohnston, Twitter (X): https://twitter.com/IanSJohnston
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4543
  • Country: ua
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #356 on: August 22, 2017, 11:05:33 am »
In theory any linux-based OS should work, but you may run into some packets/lib dependency conflicts, which you may need to resolve.
I'm using Raspbian since Pi1, but also tried NOOBs once on which all worked fine.
Also have NI GPIB + linux-gpib working fine on Linaro , running on FPGA SOC board (DE1-SoC).

Once you get familiar with main tidbits, it's fairly easy to get things running on another platforms.
YouTube | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Online IanJ

  • Supporter
  • ****
  • Posts: 1608
  • Country: scotland
  • Full time EE & Youtuber
    • IanJohnston.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #357 on: August 27, 2017, 04:42:37 pm »

After image recovery run
Code: [Select]
curl https://raw.githubusercontent.com/PlesaEEVBlog/RPi_LogNut/master/Install_GPIB_Support.sh | sudo bashFor settng web and Samba
Code: [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.

Ok, so I have my Pi3 running, used Noobs to install Raspbian (with desktop).
Connected my 82357B clone & BM-280.
Then at command prompt ran
Code: [Select]
curl https://raw.githubusercontent.com/PlesaEEVBlog/RPi_LogNut/master/Install_GPIB_Support.sh | sudo bashAnd after a few minutes got this at the very end:
Code: [Select]
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.

Is this looking ok?.....or is there an issue?

Ian.
Ian Johnston - Original designer of the PDVS2mini || Author of the free WinGPIB app.
Website - www.ianjohnston.com
YT Channel (electronics repairs & projects): www.youtube.com/user/IanScottJohnston, Twitter (X): https://twitter.com/IanSJohnston
 

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #358 on: August 27, 2017, 08:06:45 pm »
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.

 

Online IanJ

  • Supporter
  • ****
  • Posts: 1608
  • Country: scotland
  • Full time EE & Youtuber
    • IanJohnston.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #359 on: August 27, 2017, 09:26:12 pm »
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.

Here is lsusb, this is done on same session, i.e. just after script fails.

Code: [Select]
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

I notice also that the red light is ON the adaptor.....so I unplug the adaptor USB then plug it in again and I get a green light ON.....and then run lsusb again:

Code: [Select]
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

So, right now i am running script again.

Ian.
« Last Edit: August 27, 2017, 09:32:53 pm by IanJ »
Ian Johnston - Original designer of the PDVS2mini || Author of the free WinGPIB app.
Website - www.ianjohnston.com
YT Channel (electronics repairs & projects): www.youtube.com/user/IanScottJohnston, Twitter (X): https://twitter.com/IanSJohnston
 

Online 2N3055

  • Super Contributor
  • ***
  • Posts: 6631
  • Country: hr
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #360 on: August 27, 2017, 09:38:53 pm »

Code: [Select]
Bus 001 Device 019: ID 0957:0718 Agilent Technologies, Inc.


Ian.

Ian,

I had same problem, since adapter didn't load firmware (you have to replug it first time)
GPIB part of script didn't recognize it..
I opened Plesa script in editor, and copy-pasted last few lines that deal with GPIB setup again line by line into terminal... And then it went trough...

Also before that I had to also manually execute first few lines that do kernel upgrade, wait for it to finish and restart Pi.... Then Plesa script in full, reconnect GPIB, and repeat last few GPIB lines... It seems my Raspberry was a bit out sync....

It works perfectly now..
 

Online IanJ

  • Supporter
  • ****
  • Posts: 1608
  • Country: scotland
  • Full time EE & Youtuber
    • IanJohnston.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #361 on: August 27, 2017, 09:50:37 pm »
Ok after running the script again I now get this:

Code: [Select]
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:~ $

So I am assuming this is now ok, and I can run 2nd script next, here:

Code: [Select]
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

So I assume thats it done.......so now how do I run the logger etc (samba pass is set, and I can access)?

Update: Ahhhh, I can see the Pi is now a webserver and the 3458a logging is web based as can see the files........just trying to work out the URL now.

Ian.
« Last Edit: August 27, 2017, 10:03:54 pm by IanJ »
Ian Johnston - Original designer of the PDVS2mini || Author of the free WinGPIB app.
Website - www.ianjohnston.com
YT Channel (electronics repairs & projects): www.youtube.com/user/IanScottJohnston, Twitter (X): https://twitter.com/IanSJohnston
 

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #362 on: August 27, 2017, 10:06:45 pm »
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?
 
The following users thanked this post: 2N3055

Online IanJ

  • Supporter
  • ****
  • Posts: 1608
  • Country: scotland
  • Full time EE & Youtuber
    • IanJohnston.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #363 on: August 27, 2017, 10:16:02 pm »
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.
Ian Johnston - Original designer of the PDVS2mini || Author of the free WinGPIB app.
Website - www.ianjohnston.com
YT Channel (electronics repairs & projects): www.youtube.com/user/IanScottJohnston, Twitter (X): https://twitter.com/IanSJohnston
 

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #364 on: August 27, 2017, 10:26:14 pm »
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.
 

Online IanJ

  • Supporter
  • ****
  • Posts: 1608
  • Country: scotland
  • Full time EE & Youtuber
    • IanJohnston.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #365 on: August 28, 2017, 05:24:06 pm »
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.
« Last Edit: August 28, 2017, 05:52:59 pm by IanJ »
Ian Johnston - Original designer of the PDVS2mini || Author of the free WinGPIB app.
Website - www.ianjohnston.com
YT Channel (electronics repairs & projects): www.youtube.com/user/IanScottJohnston, Twitter (X): https://twitter.com/IanSJohnston
 

Offline z01z

  • Regular Contributor
  • *
  • Posts: 151
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #366 on: August 28, 2017, 06:14:12 pm »
I came across the command "sudo usermod -a -G gpib pi", which might help.
What about sudo python ...?
 

Offline vindoline

  • Supporter
  • ****
  • Posts: 324
  • Country: us
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #367 on: August 28, 2017, 06:41:49 pm »
OK, I'm also still struggling to get this up and running. Right now I'm trying to get the BME280 sensor graphing to work.

1) I have a new 16 GB card with latest Raspbian installed.
     a. I add an empty file called "ssh" to the root directory of the SD card to enable SSH upon boot
     b. I add a "wpa_supplicant.conf" file with my wifi info in it to enable wifi access upon boot.

2) Power up the RPi and SSH in from my Mac.
     a. run sudo raps-config and set new password, hostname, VNC access, I2C enable, screen resolution, etc.
     b. reboot RPi

3) SSH into RPi from my Mac
     a. run sudo apt-get update
     b. run sudo apt-get upgrade
     c. run curl https://raw.githubusercontent.com/PlesaEEVBlog/RPi_LogNut/master/Install_GPIB_Support.sh | sudo bash
          => this seems to run/install OK. I get several errors at the very end because I don't have a supported GPIB adapter attached.
     d. run curl https://raw.githubusercontent.com/PlesaEEVBlog/RPi_LogNut/master/Update_GPIB.sh | sudo bash
          => as above, this seems to run/install OK
     e. run curl https://raw.githubusercontent.com/PlesaEEVBlog/RPi_LogNut/master/Web_Samba.sh | sudo bash
          => I believe I've found several errors in this script (at least for me):
                line 13 reads: "sudo mkdir log" I believe it should be "sudo mkdir logs"
                line 19 ("sudo rmdir /var/www/html") fails to remove the directory html because a file is in it. This then seems to both the symlinks created. If the file (index.lighttpd.html) is removed first, it works fine.

As Plesa noted above, I copy the files in \pub\Rpi_LogNut\www to \pub\www and copy the files from  pub\Rpi_LogNut\Python to \pub\python.

I can go to the directory /pub/python and run the script "python BME_v2_Log.py" and it fails because there needs to be a file named "BME280_Log.csv" already existing in the logs directory. Once I create an empty file named BME280_Log.csv the script runs fine and collects data. Yea!

If I now open a web browser and go to "VoltNutter.local" I get the index page with all of the different instrument logging options. Yea! However, clicking on "BME280_Logs.html" gives a blank page. If I look in the debugging console I see the error "TypeError: undefined is not an object (evaluating 'e.length')" in the d3.v3.min.js file. I have no idea what any of this means or how to proceed. Any advice?  :-//

 

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #368 on: August 29, 2017, 10:10:12 pm »
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.

Try to run sudo gpib_config and post results. After that you can run sudo ibtest to test the GPIB device in terminal.
 

Online TheSteve

  • Supporter
  • ****
  • Posts: 3753
  • Country: ca
  • Living the Dream
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #369 on: August 30, 2017, 04:03:39 am »
plesa - thanks for posting the latest version of your pi image. I installed it last night without too much drama on a pi3. It did fail at the end but I just ran the gpib script again after a reboot and it worked. I did have to disconnect and reconnect my 82357B when done. However I doubt I will be using the USB interface much as I have the E5810A now and decided to try some vxi11. So far it is working great. I added a "inst.write("END ON")" to get it to talk to my 3458A. No luck with the serial port on the E5810A though. I am wondering if possibly the output level shifter might be bad.

For anyone not using a monitor/kb/mouse on their pi I recommend running sudo raspi-config and turning off the graphical login to save resources.

edit - Got serial working - had to make sure the Keithley 2400 required no flow control and that it wanted a LF as a terminator. I then added the "\n" to the *IDN? and it works 100% of the time. I tried the same with carriage return and it didn't work. A scope with serial decode sure was handy.

#!/usr/bin/python2
# Test Agilent E5810A with serial port connected to Keithley 2400
import vxi11
instr = vxi11.Instrument("192.18.1.134", "COM1:488")
print(instr.ask("*IDN?\n"))
« Last Edit: August 30, 2017, 05:50:26 am by TheSteve »
VE7FM
 

Offline voltampere

  • Regular Contributor
  • *
  • Posts: 58
  • Country: de
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #370 on: September 14, 2017, 04:55:56 pm »
I just want to share a bit of information for those who would like to set everything up on their own.
Without just copying a whole image and running some "magic" script!

On my first try i stumbled a lot because i read at different locations that you need to install the kernel sources.
( i think this advice is also on Tin's website )

I can confirm that it is possible to compile the linux-gpib package without the kernel-sources installed.
( at least this worked with Raspberry Pi 3 and latest Raspbian image )
I only needed to install the raspberry-kernel-headers.

apt-get install raspberry-kernel-headers

After that you will have two directories under /usr/src:

linux-headers-4.9.41+
linux-headers-4.9.41-v7+

Since the PDF doc on the linux-gpib sourcefourge archive says that the headers should be enough i gave it a try.

Of course you will need all the other packages like :
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

I installed all of them according to Tin's Guide on xDevs.com.

After the first ./configure the Script did not confirm configuration of the Python bindings.
So i figured that some Python package was missing...
apt-get install  libpython3-dev did not do the job.
So i also installed libpython-dev.
After that the ./configure script confirmed the Python bindings setup.

make was successful but showed this Error multiple times while running:

ERROR : Kernel configuration is invalid.
  include/generated/autoconf.h or include/config/auto.conf are missing.
  Run ´make oldconfig && make prepare´ on kernel src to fix it.

Since i did not want to struggle with getting kernel sources again ( and setting up and, and, ... )
i just tried to do a make oldconfig and make prepare in the kernel-headers directory.
make oldconfig went through but make prepare was impossible.
I just ledt it at that point and went on with `make install` in the linux-gpib directory.

After some more errors that i could all fix with info from Tin's website ( running ldconfig again , editing gpib.conf, ... ) i had a working gpib package on my system.

Bottom line:

-You don't need the complete kernel-sources to compile linux-gpib (only the headers)

-don't worry about the Error: kernel configuration is invalid

Best regards

Joerg

 

Offline MiDi

  • Frequent Contributor
  • **
  • Posts: 600
  • Country: ua
Linux-GPIB on Raspi - a guide
« Reply #371 on: December 03, 2018, 12:32:39 am »
UPDATED 2023-09-25
2023-09-25: fixed url for FW, formatting for easier C&P

Alternatives to this guide:
https://xdevs.com/doc/xDevs.com/linux_gpib/install_linux_gpib.sh from https://xdevs.com/guide/ni_gpib_rpi/
or https://github.com/PhilippCo/meas_rpi from https://www.eevblog.com/forum/metrology/raspberry-pi-for-gpib-and-data-analysis-very-easy-and-fully-equipped/msg3624833/#msg3624833

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!

Code: [Select]
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
« Last Edit: September 25, 2023, 01:04:06 pm by MiDi »
 

Offline bitseeker

  • Super Contributor
  • ***
  • Posts: 9057
  • Country: us
  • Lots of engineer-tweakable parts inside!
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #372 on: December 03, 2018, 07:06:58 am »
Thanks, MiDi. I hadn't tried using my Agilent USB-GPIB with RPi, yet.
TEA is the way. | TEA Time channel
 

Offline pansku

  • Regular Contributor
  • *
  • Posts: 60
  • Country: fi
Re: Linux-GPIB on Raspi - a guide
« Reply #373 on: December 04, 2018, 03:48:58 pm »
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.

Thank you so much, I finally got the thing working on 3B+ !!  :-+

Now I just need to figure out why my HP6632A and K2015 work perfectly fine seperately, but only the Keithley works when they are daisy-chained and the Agilent pod is on either of those 2  :-/O
 

Offline MiDi

  • Frequent Contributor
  • **
  • Posts: 600
  • Country: ua
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #374 on: December 05, 2018, 10:29:42 am »
Nice, so for now all raspis are covered as I did successful test on pi 2 too.
Perhaps I will do test on current debian/ubuntu sometimes...
If someone did, would be nice to get the results.

@TiN: Your guides for linux-gpib show up on top of (google) search, so feel free to use my guide and update your guides.
To reveal: You get my permission without need for reference to me.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf