Poll

Interested/Instrument/Interface

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

Total Members Voted: 44

Voting closed: December 13, 2016, 11:12:53 am

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

0 Members and 2 Guests are viewing this topic.

Offline Dwaine

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

Dwaine

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

http://99.232.17.239/U1272A_Logs.html

Dwaine
 

Offline plesaTopic starter

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

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

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

Offline FrankBuss

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

Offline z01z

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

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

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

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

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

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

Offline z01z

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

Offline Dwaine

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

Dwaine
 

Offline bingo600

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

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

@Plesa

Dave has ordered a v3

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

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

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

/Bingo
 

Offline FrankBuss

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

I use following sequence to initialise the thing.

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

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

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

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

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

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

Offline mimmus78

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

I use following sequence to initialise the thing.

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

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

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

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

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

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

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

Inviato dal mio Nexus 6P utilizzando Tapatalk

 

Offline bingo600

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

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

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

Rebuilt linux-gpib , and tested wo. any luck

Still err 14  :'( :'(

Edit: Corrected the followkernel

This was done on a Raspi v3 , and boots ok

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

Offline Dwaine

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

http://99.232.17.239/BMP085_Logs.html
 

Offline TiN

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

Working well OOB, NI USB-GPIB-HS is ok too, but clone fake Agilent pot is no go, err 14 timeout, but instrument itself does go into REM/TALK.
YouTube | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline plesaTopic starter

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

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

Hi TiN,

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

Offline plesaTopic starter

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

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

Offline Dwaine

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

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

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

Offline plesaTopic starter

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

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

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

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

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

Offline Dwaine

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

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

Offline plesaTopic starter

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

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

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

Offline bingo600

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



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

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

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

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

Offline Dwaine

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

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

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

Rigol DM3068
Keysight U1272a
BMP085 Sensor

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

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

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4543
  • Country: ua
    • xDevs.com
Re: Raspberry Pi2/3 logging platform for Voltnuts
« Reply #170 on: December 30, 2016, 11:14:22 am »
I'll try to find my Pi1 and get wheezy up to get file/dumps.
YouTube | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline bingo600

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

Thanx TiN

I think i misunderstood Dave.

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

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

/Bingo
 

Offline BFX

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

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

Offline plesaTopic starter

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

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

Offline bingo600

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

That message seems more like one or both of these:

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

What does a lsusb say ?

What does a uname -a say ?

/Bingo
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf