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

0 Members and 1 Guest are viewing this topic.

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 2034
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #250 on: January 15, 2017, 04:37:31 pm »
@TiN

My latest kernel on a v1 is 4.4.38+ , your's is a lower vers.
Could it be that you didn't apt-get dist-upgrade , and that might cause the header probs. you had ??

To swith to a raspbian.org kernel , just install the latest standard image , and do this.
https://www.eevblog.com/forum/metrology/raspberry-pi23-logging-platform-for-voltnuts/msg1096058/#msg1096058


/Bingo
 

Offline TheSteve

  • Supporter
  • ****
  • Posts: 3781
  • Country: ca
  • Living the Dream
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #251 on: January 15, 2017, 08:11:16 pm »
As requested by several members I have uploaded the image from my raspberry pi 1 model B to TiN's FTP server. There is nothing special about it, it is simply a 2016-05-27-raspbian-jessie-lite install after which I followed TiN's howto for the Agilent 82357B.
The login is the usual pi/raspberry
I have had it be a little picky when first booted a few times - the red LED will stay on on the GPIB adapter. When that has happened I have had to unplug the adapter and reconnect it to the pi at which point it works fine. I have never had it crash during data logging etc.
I believe forum member BFX is going to try it out, hopefully he can report how it functions for him.

I haven't good news :(
I used image on my RPi 1 (2011) it's starts OK, but on Agilent 82357B only lights up all 3 leds for a while and after that only red lights. After one second the same.
Unplug and plug adapter back didn't help. (I tried it more times also to different usb ports)
lsub doesn't show Agilent 82357B in the list.

As was already mentioned what is your power supply? I am using a high quality 5 volt supply rated for 1.5 amps(which it really can do) and it is connected to the internal headers, I am not using the micro usb jack.
VE7FM
 

Offline BFX

  • Frequent Contributor
  • **
  • Posts: 376
  • Country: sk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #252 on: January 15, 2017, 10:44:40 pm »
As was already mentioned what is your power supply? I am using a high quality 5 volt supply rated for 1.5 amps(which it really can do) and it is connected to the internal headers, I am not using the micro usb jack.
I didn't measure this power supply but it's rated for 2.1A
https://www.hej.sk/nabijacka-do-siete-emos-usbee-home-d4/

Tomorrow I will try one of my big HP beast and we will see. :box:
« Last Edit: January 15, 2017, 10:50:10 pm by BFX »
 

Offline Assafl

  • Frequent Contributor
  • **
  • Posts: 602
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #253 on: January 16, 2017, 12:33:04 pm »
Meow.

Quote
root@rpi3:/repo/linux-gpib/linux-gpib-code/linux-gpib# uname -a
Linux rpi3.xdevs.com 4.4.34-v7+ #930 SMP Wed Nov 23 15:20:41 GMT 2016 armv7l GNU/Linux

root@rpi3:/repo/linux-gpib/linux-gpib-code/linux-gpib# lsusb
Bus 001 Device 006: ID 0957:0718 Agilent Technologies, Inc.

enter maximum number of bytes to read [1024]:
trying to read 1024 bytes from device...
received string: 'KEITHLEY INSTRUMENTS INC.,MODEL 2001M,0579220,B17  /A01'
Number of bytes read: 58
gpib status is:
ibsta = 0x2100  < END CMPL >
iberr= 0

ibcnt = 58

Bingo600 hinted me that linux-gpib got updated to SVN R1654, which has fix in DMA buffers for Agilent 82357B's on linux kernels 4.x.x.
I hasted to try on plesa's Lognut image, but it didn't work.

So I reformatted SD card and wrote fresh Raspbian + Pixel from RPI site.
Installed usual things, couldn't get linux-gpib to install properly in first place (could not find modules), but after bit of poking with rpi-source python script and few reboots I finally got linux-gpib to install and gpib_config to work.



 :-+ Credits to Dave Penkler and might of open-source software. Thanks!

BFX
Try beefier PSU. I had similar issues before with 4.9V PSU 500mA. After bumping power to 5.1V 1A - all good :)

Good News!

After a fussy linux festival 4.4.38-v7+ works with R1654 on RPi 3.

Note that (as per TiN's comment) I had to run rpi-source.py prior to running ./configure, make and make install.

I can now use ibtest to communicate with the 34401A without a problem. Time for some Python.

Thank you to TiN and Bingo and plesa and all involved in this project.
« Last Edit: January 16, 2017, 12:40:42 pm by Assafl »
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 2034
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #254 on: January 16, 2017, 02:11:48 pm »
I have just tested linux-gpib (SVN) on a Raspi v3 running the raspbian.org kernel (Debian compliant)
Quote
raspi4:~ $ uname -a
Linux raspi4 4.4.0-1-rpi2 #1 SMP Debian 4.4.6-1+rpi14 (2016-05-05) armv7l GNU/Linux

And it was a success  :-+ :-+
Thank you for the support Dave Penkler - OpenSource is really showing it's worth.

Agilent GPIB Adapter:
Quote
raspi4:~ $ ./idn1.py
KEITHLEY INSTRUMENTS INC.,MODEL 2015,1043877,B15  /A02 


Beiming Adapter:
Quote
raspi4:~ $ ./idn1.py
KEITHLEY INSTRUMENTS INC.,MODEL 2015,1043877,B15  /A02 

The new udev "magic" for the The Agilent is doing all the init stuff including loading the firmware & running gpib_config.
I wasn't 100% sure if it ran the gpib_config for the Beiming too, as the Beiming identifies w. the final VID/PID on upstart, and doesn't need a firmware load.

So i ran gpib_config manually ,once for the Beiming.

Next to test on a Raspi v1

/Bingo
« Last Edit: January 16, 2017, 02:28:22 pm by bingo600 »
 
The following users thanked this post: TiN

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 2034
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #255 on: January 16, 2017, 02:58:10 pm »
Testing latest SVN on a Raspi v1

Running the latest "foundation kernel"

Quote
raspi3:~ $ uname -a
Linux raspi3 4.4.38+ #938 Thu Dec 15 15:17:54 GMT 2016 armv6l GNU/Linux

Success  :-+ :-+

Agilent :
Quote
raspi3:~ $ ./idn1.py
KEITHLEY INSTRUMENTS INC.,MODEL 2015,1043877,B15  /A02 
cfo@raspi3:~ $

Beiming:
Quote
raspi3:~ $ ./idn1.py
KEITHLEY INSTRUMENTS INC.,MODEL 2015,1043877,B15  /A02

/Bingo
 
The following users thanked this post: TiN

Offline Assafl

  • Frequent Contributor
  • **
  • Posts: 602
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #256 on: January 19, 2017, 09:01:46 am »
I am using the scripts from the plesa's RPI Voltnut GitHub (awesome work!) and didn't want to cause too much wear on the SD card. So I added a rather obvious counter to the script.

The delayed write works by counting the number of measurements (up to variable sd_buffer) - and then closes the files to commit the measurements to SD. A console notice for the SD card commit is displayed so that one can stop logging after a write - otherwise I found I had to look at the time stamp of the log file and keep refreshing... especially if you hold on for long between commits to disk.

It looks like this:


().

Setting up the interval and duration is done in the declarations above the code:
LogDir = '/pub/logs/'
LogFile = LogDir + 'BME280_Log.csv'
sd_buffer = 10 # How many measurements to commit to SD card (to limit writes)
interval = 2 # interval (seconds) between measurements


Of course a better approach would have been to hold off writing until the SD card can write an entire block, or a buffer fills up, etc.

Edit - added similar functionality to 34401A script (plus support for 1 or 2 BME280 sensors).

 
« Last Edit: January 19, 2017, 06:39:43 pm by Assafl »
 

Offline jrz126

  • Newbie
  • Posts: 2
  • Country: us
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #257 on: January 19, 2017, 03:16:29 pm »
So whats the procedure for getting a PI V3 up and running with a NI USB-GPIB?
I have one of these powersupplies:

Only interface is through GPIB, or a $500 keyboard which i dont have. Looking to make my own controller for it through GPIB.

Been screwing with this for a couple weeks off and on.  |O

First followed the steps here: https://xdevs.com/guide/ni_gpib_rpi/
Got it to talk and whatnot, but I would get a segfault while trying to run ibtest. Figured it was because i was using a V3 Pi and not a V1.

Found this thread. Tried following the steps in reply 34. But I get this error when i try to install the linux-gpib.
root@raspberrypi:/opt/linux-gpib# sudo ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for util/.scm_version.tmp... yes
checking build system type... armv7l-unknown-linux-gnueabihf
checking host system type... armv7l-unknown-linux-gnueabihf
checking Linux kernel directory... configure: WARNING: Linux kernel directory /lib/modules/4.4.38-v7+/build/ does not exist.  Specify using --with-linux-srcdir=DIR.
configure: WARNING: Kernel source tree at /lib/modules/4.4.38-v7+/build/ is not configured.  Copy the
   appropriate configuration file to /lib/modules/4.4.38-v7+/build//.config and then run 'make oldconfig'
   in the kernel source directory.
ok
checking Linux kernel compile flags... make: *** /lib/modules/4.4.38-v7+/build/: No such file or directory.  Stop.
configure: WARNING: Failed to get compile flags from Linux kernel directory.
ok
checking for gcc... gcc


Anyone else run into this issue?
 

Offline Assafl

  • Frequent Contributor
  • **
  • Posts: 602
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #258 on: January 19, 2017, 03:45:37 pm »
Did you install the headers and after run rpi-source?

I had similar issues until I ran rpi-source.

See a few pages back (run as sudo):
https://www.eevblog.com/forum/metrology/raspberry-pi23-logging-platform-for-voltnuts/msg1075495/#msg1075495
 

Offline jrz126

  • Newbie
  • Posts: 2
  • Country: us
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #259 on: January 19, 2017, 04:05:22 pm »
Yes. those are the steps i was following. Did you have to modify anything extra?
 
Attached the console log from installing the rpi-source.
 

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #260 on: January 19, 2017, 04:24:53 pm »
First followed the steps here: https://xdevs.com/guide/ni_gpib_rpi/
Got it to talk and whatnot, but I would get a segfault while trying to run ibtest. Figured it was because i was using a V3 Pi and not a V1.

You do not have kernel header or kernel source availble
Perform
sudo apt-get update
sudo apt-get upgrade
sudo apt-get raspberrypi-kernel raspberrypi-kernel-headers
And try to reinstall linux-gpib
If it will not work post kernel version.

In general if you are using iiferent kernels shoulb be enough
sudo wget https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source -O /usr/bin/rpi-source && sudo chmod +x /usr/bin/rpi-source && /usr/bin/rpi-source -q --tag-update
sudo rpi-source
sudo reboot
this will download and link kernel sources but reguire more space.


Also I can confirm that the 82357B adapter is now running with 4.4.38 and also with more recent 4.4.x.
Thanks Bingo600 and Dave.
« Last Edit: January 19, 2017, 06:38:59 pm by plesa »
 

Offline mimmus78

  • Supporter
  • ****
  • Posts: 676
  • Country: it
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #261 on: January 23, 2017, 08:15:53 pm »
Just a silly question. I know 99,99% the response is yes but worth checking ...

With this NI USB-GPIB (or any of this GPIB2USB adaptor) is it possible to have multiple scripts running on different instruments at the same time (on the same raspberry)?

Actually with my ancient "NI-ENET" adaptor I'm running a 10V data logging script on my 3458a for my LTZ1000 reference and another script for TC of resistor using a K2001 and a Siglent Power supply via USBTMC.

Two scripts and three instruments ... yes it's really a mess but this things takes forever so it's worth doing in parallel to get forever/2.
 

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #262 on: January 23, 2017, 09:24:06 pm »
Just a silly question. I know 99,99% the response is yes but worth checking ...

With this NI USB-GPIB (or any of this GPIB2USB adaptor) is it possible to have multiple scripts running on different instruments at the same time (on the same raspberry)?

Actually with my ancient "NI-ENET" adaptor I'm running a 10V data logging script on my 3458a for my LTZ1000 reference and another script for TC of resistor using a K2001 and a Siglent Power supply via USBTMC.

Two scripts and three instruments ... yes it's really a mess but this things takes forever so it's worth doing in parallel to get forever/2.

Yes, there is almost no limitations, of course do no try to control same instruments from two scripts.
I was using 3458A, 3457A,K2001M, 34401A,34420A, 34410A,34411A and E3631A on NI-GPIB HS adater and simutaneously L4411A over USBTMC. Each instrument has own logging and some of them were also logging the temperature from 2x BME280.
What was only problem was stability of kernels. The best seems to be official RPI foundation 4.4.38 running on RPI2/3.
Also try to keep at least half of instruments connected on GPIB powered on.Recommended for GPIB bus.
 

Offline mimmus78

  • Supporter
  • ****
  • Posts: 676
  • Country: it
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #263 on: January 23, 2017, 10:36:20 pm »
"fortunately" I'm using this NI GPIB-ENET adapter. Raspberry connect to GPIB adapter by Ethernet and everything is rock stable.

Unfortunately there is not kernel support for this adapter. So is usable only in Python with some library someone wrote for this adapter that connects directly via socket.

Everything comes with pro and cons ...

Inviato dal mio Nexus 6P utilizzando Tapatalk

 

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #264 on: January 23, 2017, 11:18:44 pm »
"fortunately" I'm using this NI GPIB-ENET adapter. Raspberry connect to GPIB adapter by Ethernet and everything is rock stable.

Unfortunately there is not kernel support for this adapter. So is usable only in Python with some library someone wrote for this adapter that connects directly via socket.

Everything comes with pro and cons ...

Inviato dal mio Nexus 6P utilizzando Tapatalk

The Ethernet adapters are supported, tested with E5810.
Support is writen by Alex ( member here)
http://alexforencich.com/wiki/en/python-vxi11/start

In scripts replace

Code: [Select]
import Gpib
inst = Gpib.Gpib(0,22)
by
Code: [Select]
import vxi11
inst = vxi11.Instrument("192.168.0.27", "gpib0,22")




 

Offline mimmus78

  • Supporter
  • ****
  • Posts: 676
  • Country: it
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #265 on: January 24, 2017, 12:01:28 am »
I have to check again but I don't think this adapter support any standard protocol.

Even NI software has dropped support for it long time ago. ENET 100 (the one I have is 10 Mbits) and this Agilent are another story.

Inviato dal mio Nexus 6P utilizzando Tapatalk

 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4543
  • Country: ua
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #266 on: January 24, 2017, 04:06:26 am »
Quote
With this NI USB-GPIB (or any of this GPIB2USB adaptor) is it possible to have multiple scripts running on different instruments at the same time (on the same raspberry)?

Yes, talking to multiple instruments over same GPIB dongle using linux-gpib is possible, I had runs when two python apps interfacing different instruments. But I prefer not to do that, as if error or timeout occur on one of transfers, the other one likely to fail as well, as GPIB dongle still processes requests serially.
YouTube | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline mimmus78

  • Supporter
  • ****
  • Posts: 676
  • Country: it
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #267 on: January 25, 2017, 11:36:48 pm »
TIN: Ohh that's bad but still better than nothing. Are you sure of this?

I have to check mine if this happens ... any idea how to reproduce this problem?

 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4543
  • Country: ua
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #268 on: January 26, 2017, 04:26:32 am »
Easy.
Connect two instruments on let's say GPIB 7 and GPIB 8. Run two snakes to read something in loop from either instrument. Then turnoff one instrument and watch if remaining one+it's snake still alive  :)
YouTube | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline Assafl

  • Frequent Contributor
  • **
  • Posts: 602
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #269 on: January 28, 2017, 04:14:34 pm »
Does anyone here use the free Mathematica and Wolfram Language package supplied with Raspbian to analyze and present the measurements?

I ask because it looks like a pretty capable package (albeit obtuse - I am used to Matlab).
 

Offline dr.diesel

  • Super Contributor
  • ***
  • Posts: 2214
  • Country: us
  • Cramming the magic smoke back in...
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #270 on: January 28, 2017, 06:03:34 pm »
In-case this helps others. 

I just received an E5810 LAN/GPIB Gateway and ran into an issue with the 3458A python script, was always receiving a timeout error, that I wasn't running into with the Agilent 82357B dongle.

For whatever reason the 3458A won't respond to read/query commands until END ALWAYS is sent.  Only need to send it once and your set (till you power cycle or reset), so I just modified the script with the below as the first command sent to the instrument and life is good.

inst.write("END ALWAYS")

The E5810 sure makes my life/programming easier, should have bought one eons ago!

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 2034
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #271 on: January 28, 2017, 06:15:49 pm »
For whatever reason the 3458A won't respond to read/query commands until END ALWAYS is sent.  Only need to send it once and your set (till you power cycle or reset)

Strange that you didn't encounter problems w. the other adapter.

The : END ALWAYS  is a known MUST  on the 3457 & 3458

/Bingo

PS: Thanx for the feedback
 

Offline dr.diesel

  • Super Contributor
  • ***
  • Posts: 2214
  • Country: us
  • Cramming the magic smoke back in...
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #272 on: January 28, 2017, 06:27:59 pm »
Strange that you didn't encounter problems w. the other adapter.

Further thinking, I think I set the gpib timeout to 30s, since END ALWAYS is further down the script it was probably coming around before the timeout.  Since the instrument is powered 24-7 and END ALWAYS was already enabled I never noticed the delay on subsequent data runs.

Offline guenthert

  • Frequent Contributor
  • **
  • Posts: 761
  • Country: de
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #273 on: January 31, 2017, 06:56:43 am »
Easy.
Connect two instruments on let's say GPIB 7 and GPIB 8. Run two snakes to read something in loop from either instrument. Then turnoff one instrument and watch if remaining one+it's snake still alive  :)
If it is not, then that might be actually an electrical, rather than software issue.  iirc, if multiple instruments are on the same bus, the majority on them ought to be on to ensure proper signaling.
 

Offline dr.diesel

  • Super Contributor
  • ***
  • Posts: 2214
  • Country: us
  • Cramming the magic smoke back in...
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #274 on: February 02, 2017, 06:13:20 pm »
Second 3458 refurbed, up and running.  Waiting on a 2000-Scan card for my 2010 which will be dedicated to logging board temps.

Gotta get working on a temp chamber next.

 
The following users thanked this post: TiN, CalMachine


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf