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 144591 times)

0 Members and 2 Guests are viewing this topic.

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #325 on: March 08, 2017, 09:10:29 pm »
Updated to kernel 4.4.50 and latest Raspbian with usage linux gpib 4.0.4 rc2
Script update RPI to latest tree, download linux GPIB, VXI, USBTMC and change configuration accordingly.
So to make your Volnut iamege, just download the
https://downloads.raspberrypi.org/raspbian/images/raspbian-2017-03-03/2017-03-02-raspbian-jessie.zip
Restore it to SD card and after automatic resize run script in terminal
Code: [Select]
curl https://raw.githubusercontent.com/PlesaEEVBlog/RPi_LogNut/master/Install_GPIB_Support.sh | sudo bashthis will check the version update it and reboot if needed and run script again ( in case the kernel is different than 4.4.50.
Your GPIB adapter should be connected to set gpib.conf properly.
Otherwise modify gpib.conf manually
 
The following users thanked this post: eliocor, bingo600, ManateeMafia, VK5RC, CalMachine

Offline blackdog

  • Frequent Contributor
  • **
  • Posts: 736
  • Country: nl
  • Please stop pushing bullshit...
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #326 on: April 14, 2017, 10:58:12 am »
Hi,

I loaded the last "plesa image" on a disk and run the script from March-9
I have connected my Agilent_82357A to te PI and try to edit the gpib.conf file.
But there is so much other stuf in this gpib.conf file about a PCi devices...

Can someone show me how to make the gpib.conf workable for the Agilent_82357A?

And then, lets say the Agilent_82357A is detected, i cant find how to use the PI with the GPIB software.
It is difficult to filter the basic stuff from al the pages of this project.
Can some one show me howe to use the PI for logging a 3458A of 34401A?

Kind regards,
Blackdog
Necessity is not an established fact, but an interpretation.
 

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #327 on: April 14, 2017, 11:47:57 am »
Download latest image
https://downloads.raspberrypi.org/raspbian_latest
perform (upddate ( sudo apt-get update && sudo apt-get -y upgrade )
The latest kernel which is tested is 4.4.50 ( to check run uname -a)
Code: [Select]
curl https://raw.githubusercontent.com/PlesaEEVBlog/RPi_LogNut/master/Install_GPIB_Support.sh | sudo bash
Because the image you restored contain the previous version of linux-gpib which does not work with 82357B and maybe 82357A. I do not know.

82357A adapter is not in script but if you send me the USB ID I can add it.
Or modify

Code: [Select]
if lsusb | grep -q '0957:0518'; then
sudo sed -i 's/ni_pci/agilent_82357a/g' /etc/gpib.conf
echo "Agilent 82357B found"
sudo modprobe agilent_82357a
fi

When you finish this run the ibtest to check the communication with GPIB instruments.
For basic logging task  there are few basic scripts
https://github.com/PlesaEEVBlog/RPi_LogNut
You just needs to modify paths
 

Offline blackdog

  • Frequent Contributor
  • **
  • Posts: 736
  • Country: nl
  • Please stop pushing bullshit...
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #328 on: April 14, 2017, 12:15:47 pm »
Hi plesa,

Thanks for your quick response, is appreciated.  :)

I wil run your code and wil tell it here if its working.

Kind regards,
Blackdog
Necessity is not an established fact, but an interpretation.
 

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #329 on: April 14, 2017, 08:30:02 pm »
C3js extension of D3js seems to be the way to go. It is much easier for configuration compare to D3js.For examples check http://c3js.org/

Code: [Select]
<!DOCTYPE html>
<html lang="en">
<head>
    <title>C3 Test for RPi LogNut</title>
    <meta charset="utf-8" />
    <link href="c3js.org/c3.min.css" rel="stylesheet" />
    <script src="c3js.org/d3.min.js"></script>
    <script src="c3js.org/c3.min.js"></script>
</head>
<body>
    <div id="chart"></div>

    <script>

    var chart = c3.generate({
        data: {
            url: 'logs/K2604B_K6517B_K6485_Comparison_Log.csv',
            type: 'line' 
        }
       
    });
    </script>

</body>
</html>
 

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #330 on: April 15, 2017, 12:06:54 pm »
Another test page with comparison of K6517B and K6485. I can easily display data on mouse over, easier scaling than D3, secondary axis also possible.

Code: [Select]
<!DOCTYPE html>
<html lang="en">
<head>
    <title>C3js Test Page</title>
    <meta charset="utf-8" />
    <link href="c3js.org/c3.min.css" rel="stylesheet" />
    <script src="c3js.org/d3.min.js"></script>
    <script src="c3js.org/c3.min.js"></script>
</head>
<body>
<div id="chart"></div>
     
<script>
    window.chart = c3.generate({
    bindto: '#chart',
    size: {
        height: 950,
        width: 1700
    },
    data: {
        x: 'TimeStamp',
        url: 'logs/K2604B_K6517B_K6485_Comparison_Log.csv',
        //url: 'logs/K2604B_K6517B_K6485_Comparison_Log2.csv',
        xFormat: '%d/%m/%Y-%H:%M:%S'
        //xFormat: '%Y-%m-%dT%H:%M:%S'
    },
    point: {
        show: false
    },
    axis: {
        x: {
            type: 'timeseries',
            tick: {
                count: 20,
                format: '%H:%M:%S'
            }
        }
    }
});
    </script>

</body>
</html>
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4543
  • Country: ua
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #331 on: April 15, 2017, 12:12:00 pm »
Hm, cool. Want some bulky dataset of 11 days 5xLTZ logging to try performance too? :)
Do you have 6220/6221? I'd be interested to see how it compare vs 6517B/6485 too. :)

Also scientific notation usually looks much better than all those eye-breaking stashes of zeros ;).
YouTube | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #332 on: April 15, 2017, 03:52:06 pm »
Hehe, you are calling 1MB file bulky :) Processing time with Chromium is 13s :)
So it is faster than D3js ( C3 is using D3).
Additional benefit is much easier configuration.

I do not have 6220/6221, but I will expect similar behavioral like 2636B. I can run the same test with this unit.
The 2602B is also better than 2400 series.

Scientific notation is ongoing, I'm using it in Python ( si_prefix si_format)  be patient, when it will be finished I will put in on GitHub.
 

Offline SvanGool

  • Regular Contributor
  • *
  • Posts: 135
  • Country: nl
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #333 on: April 15, 2017, 04:17:40 pm »
@Plesa

The "https://downloads.raspberrypi.org/raspbian_latest" won't work it has just been updated and is not compatible with your script (has kernel version "4.4.50+").
I changed the script (deleting the "V7"), but testing it, it only produces a time-out (error 19), the adapter is recognized and does work with the KS software under Win10.
Meanwhile, I saw you advising an older RPI image (2017-03-02-raspbian-jessie) in an older email, so I will try that. To be sure that my configuration was correct.
# Don't hurry, the past will wait. #
 

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #334 on: April 15, 2017, 04:20:55 pm »
« Last Edit: April 15, 2017, 04:23:48 pm by plesa »
 

Offline SvanGool

  • Regular Contributor
  • *
  • Posts: 135
  • Country: nl
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #335 on: April 15, 2017, 04:26:02 pm »
It does work, but not with your script ! The script doesn't recognize the kernel version reported by the latest RPI image and tries to update the kernel.
« Last Edit: April 15, 2017, 04:30:40 pm by SvanGool »
# Don't hurry, the past will wait. #
 

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #336 on: April 15, 2017, 05:48:43 pm »
It does work, but not with your script ! The script doesn't recognize the kernel version reported by the latest RPI image and tries to update the kernel.

You mentioned that you needs to remove v7, which seems that you are using the RPi1 or Raspberry Zero.
Script mentioned above is only for RPi2 and higher ( not for PRi1 or RPi0).
 

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #337 on: April 15, 2017, 07:47:56 pm »
Hm, cool. Want some bulky dataset of 11 days 5xLTZ logging to try performance too? :)
Do you have 6220/6221? I'd be interested to see how it compare vs 6517B/6485 too. :)

Also scientific notation usually looks much better than all those eye-breaking stashes of zeros ;).
 

Offline SvanGool

  • Regular Contributor
  • *
  • Posts: 135
  • Country: nl
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #338 on: April 16, 2017, 09:07:39 pm »
@Plesa

You were fully right: I thought I had a RPI 2, but after I opened the box, I checked again and it is a 1B+, sorry for causing confusion !
# Don't hurry, the past will wait. #
 

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #339 on: April 16, 2017, 09:10:38 pm »
@Plesa

You were fully right: I thought I had a RPI 2, but after I opened the box, I checked again and it is a 1B+, sorry for causing confusion !

It is OK, just delete the kernel check and it should work. I just run it on RPi0.Or post your message if needed.
 

Offline SvanGool

  • Regular Contributor
  • *
  • Posts: 135
  • Country: nl
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #340 on: April 17, 2017, 12:47:28 pm »
Indeed that does the job + restarting the system before you continue  :)

Don't forget (I did) to run /usr/local/sbin/gpib_config once after boot or put it in /etc/rc.local if you have the gpib adapter always connected.


[Edited to add note on gpib_config]
« Last Edit: April 17, 2017, 10:08:37 pm by SvanGool »
# Don't hurry, the past will wait. #
 

Offline vindoline

  • Supporter
  • ****
  • Posts: 324
  • Country: us
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #341 on: August 04, 2017, 08:09:04 pm »
Hi Plesa and the group,

I'm a complete RasPi beginner but I'm very interested in getting one set up for datalogging! I've followed the instructions to:

download raspbian-2017-03-03/2017-03-02-raspbian-jessie.zip, Restore it to SD card and run script in terminal:
curl https://raw.githubusercontent.com/PlesaEEVBlog/RPi_LogNut/master/Install_GPIB_Support.sh | sudo bash

It took quite a while to execute the script - longer than I was willing to watch. When I returned some time later the last entries on my terminal were:

Collecting si-prefix
  Downloading si-prefix-0.5.tar.gz (49kB)
    100% |????????????????????????????????| 51kB 467kB/s
Building wheels for collected packages: si-prefix
  Running setup.py bdist_wheel for si-prefix ... done
  Stored in directory: /root/.cache/pip/wheels/7b/e3/f0/6c628d1ed2fe11531947b4d759bb61a39f45bf50da106d15f1
Successfully built si-prefix
Installing collected packages: si-prefix
Successfully installed si-prefix-0.5
depmod: ERROR: could not open directory /lib/modules/4.4.50-v7+: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
failed to open device file '/dev/gpib0'
main: No such device or address
pi@raspberrypi:~ $

It seems to have stopped due to an error. I looked in the file system and /dev/gpib0 does exist. However I have /lib/modules/4.9.35-v7+ NOT 4.4.50-v7+
Any advice would be greatly appreciated!
Also, how do I use the raspberry Pi once everything is installed happily? Sorry, but I need the hand-holding (at least to begin)
 

Offline vindoline

  • Supporter
  • ****
  • Posts: 324
  • Country: us
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #342 on: August 05, 2017, 01:54:56 am »
OK, I re-downloaded the most recent rasping and re-ran the install_gpib_support script. This time it seemed to complete OK without errors.

Now what? How does one use this tool? I'm hoping to be able to use an Arduino based GPIB adapter with my Keithley 196 meter as well as setting up logging of environmental temp/humidity etc. Any advice is greatly appreciated!
 

Offline Assafl

  • Frequent Contributor
  • **
  • Posts: 600
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #343 on: August 05, 2017, 08:26:56 am »
196 Isn't SCPI. So you'll have to program all of the mashed up commands....
 

Offline alm

  • Super Contributor
  • ***
  • Posts: 2840
  • Country: 00
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #344 on: August 05, 2017, 10:35:37 am »
Neither is the 3458A. Just means you need the more cryptic but simpler command set that mostly maps GPIB commands to front panel button presses, e.g. F0 is the left most function button, F1 the second from the left. Documentation is important, because a command like F1R5Q0M1T5X is not easy to decipher.

Mapping one of those meters to the IVI triggering model is good fun ;). But it does not look like this project cares about abstractions, so that is a hurdle you will not have to overcome.

Offline vindoline

  • Supporter
  • ****
  • Posts: 324
  • Country: us
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #345 on: August 05, 2017, 03:53:38 pm »
OK, at a really basic level, I don't know what I'm doing.
Via SSH I ran the install script again. It ends with:

failed to configure boardtype: ni_pci
failed to configure board
main: Invalid argument

I'm not surprised as I don't have an National Instruments board, it's an arduino based unit (http://egirland.blogspot.cz/2014/03/arduino-uno-as-usb-to-gpib-controller.html).

When I reboot the pi it just sits there. There appears that no logging program is running. There is no web server running. Is there a program I'm supposed to run? Am I supposed to access it via a web browser?

I am able to get the Arduino GPIB adapter talking to my Mac via a Python in terminal. My goal is to get it working on the RPi with environmental logging, which I thought was worked out here.

Thanks in advance to anyone who can help me out!
 

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #346 on: August 06, 2017, 03:06:10 pm »
The script on github is detecting NI USB HS, etc and Agilent 82357b adapters and according to connected adapter it will set the .conf file.
So it is OK that you received such error.

The script does not install web server (nginx + samba) for this your will needs to use this script Web_Samba.sh
You can run it same way like GPIB install script
curl https://raw.githubusercontent.com/PlesaEEVBlog/RPi_LogNut/master/Web_Samba.sh | sudo bash

For Arduino you will needs to rewrite the python scripts from Github, I did not reach point to release them with support for Prologix or Arduino GPIB adapters.




 
The following users thanked this post: vindoline

Offline alm

  • Super Contributor
  • ***
  • Posts: 2840
  • Country: 00
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #347 on: August 06, 2017, 03:27:31 pm »
The ugliest thing is to write a Keithley_196_Prologix_Log.py script that accesses the emulated serial port directly.

The slightly less ugly way is to write a GpibPrologix module that implements the same interface as the standard Gpib module. I have done something similar in the past for a scope that could be accessed through GPIB or RS-232 by implementing a GpibSerial module that emulated the GPIB interface. See attachment. To use it I would use:
Code: (Python) [Select]
import GpibSerial as Gpib
#import Gpib

scope = gpib.find('tds200')
gpib.clear(scope)
gpib.write(scope,'measu:meas1:typ PK2;:measu:meas1:sou CH1')
gpib.write(scope,'measu:meas1:val?')
pk2 = float(gpib.read(scope,80))
It would not be a drop-in replacement because it does not send the Prologix command (this was a direct RS-232 connection) and may not implement all functionality that this code expects.

A nicer way is to actually use a generic backend like PyVISA. Unfortunately it does not look like PyVISA currently supports the Prologix interface, but it would abstract the hardware interface from the logging code. Adding proper Prologix support to PyVISA does not look too difficult.

And if you also want to abstract the instrument itself, you could use python-ivi on top of PyVISA. That is the way I am going for any new instrument control code I write.
 
The following users thanked this post: vindoline

Offline vindoline

  • Supporter
  • ****
  • Posts: 324
  • Country: us
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #348 on: August 07, 2017, 02:43:06 pm »
Pleasa, thank you very much for your response. I didn't realize that you hadn't yet implemented Prologix support.

alm, thank you too. I'll take a look at doing this, but I'm afraid it may be well over my head programming wise. I'll give a shot at figuring it out though!
 

Offline nisma

  • Regular Contributor
  • *
  • Posts: 87
  • Country: it
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #349 on: August 09, 2017, 11:39:34 pm »
I only have rpi1, so i cannot test this logging platform.
Prologix works with  pySerial and wanglib . 
The 3.3V arduino works very well with rpi on hw rs232 and speed set at 4Mbit/sec.
I don't use orginal Prologix, just arduino with similar firmware.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf