Author Topic: Using a Raspberry PI with linux-gpib - and a Beiming or Agilent USB-GPIB adapter  (Read 78346 times)

0 Members and 1 Guest are viewing this topic.

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
Jan-2017
You need linux-gpib SVN R1654 or later , in order to get it to work on Kernel 4.x.x
If using a zip package , you will need something higher than 4.0.3

See more here
https://www.eevblog.com/forum/metrology/raspberry-pi23-logging-platform-for-voltnuts/

/Bingo


I have succeded in getting linux-gpib to compile on a Raspberry PI.
This means i now have a 3..5-Watt linux computer that can be used with an Agilent compatible GPIB-USB adapter.
And i even get "networking for "free" , and can make a networked linux-gpib adapter with python bindings for approx. 80 (gpib) + 40 (RasPI) = 120 US$

The adapters i know that has a linux-gpib compatible firmware is :
1:
The real Agilents  (I got mine from here , with a "best offer") - came brand new in a sealed box , and with DHL shipping - 4 days to EU
http://www.ebay.com/itm/Agilent-82357B-USB-GPIB-Interface-High-Speed-USB-2-0-NEW-IN-BOX-/251370746065

2:
The Beimings , with their new linux-gpib compatible firmware.
S82357 the standard adapter ok for most uses - $79
http://www.ebay.com/itm/S82357-GPIB-USB-interface-compatible-with-Agilent-82357B-/181253216568

F82357 the same functions as the S82357, but uses DMA for xfer , and should be faster if you transfer large binary data chunks. -$99
http://www.ebay.com/itm/F82357-GPIB-USB-interface-compatible-with-Agilent-82357B-/171155337720
   
I have an Agilent 82357B, and also a Beiming S82357 , and both are working excellent with linux-gpib.
I have tested Linux Mint 14 , Debian 7.0 and the raspberry.org kernel used further down.
See : https://www.eevblog.com/forum/reviews/howto-get-the-raspian-kernel-installed-with-headers/


One of the annoyances of linux-gpib is that there is no build in kernel support for the package ,
meaning that one has to rebuild the linux-gpib package every time the kernel changes (updates).
This is not a big problem , provided that the kernel maintainer delivers a working kernel header package ,but it is still annoying.

This "challenge" is still present on a RasPI , but as my RasPI's are living protected on my inside lan.
I don't have to do every kernelupdate to protect it , and i can see it as a "Black Box" just running my gpib adapter.
I have chosen to install ufw (a small firewall) : apt-get install ufw
Just to get some protection ... But make sure you know what you are doing , or ssh will be blocked also.

Or one could even omit the default gateway on the RasPI , and making it unable to communicate with anything not on the local lan.

If logging a lot of GPIB data to the SD card , one can either put the data on a tmpfs
http://raspberrypi.stackexchange.com/questions/169/how-can-i-extend-the-life-of-my-sd-card

Or use the the Ramlog package.
http://www.xappsoftware.com/wordpress/2013/06/10/two-tricks-to-make-your-raspberry-pi-more-reliable/

I have chosen neither of the above , as i have a 24/7 linux mail/file server running. So i will NFS enable my RasPI and log via NFS to my fileserver.


Raspi Preparation
Edit: 14-may-2014
Note: The below kernel versions might change , look in /boot for the latest vmlinuz-x.xx.xx-rpi

For now they are
Quote
kernel=vmlinuz-3.10-3-rpi
initramfs initrd.img-3.10-3-rpi followkernel

Code: [Select]

Howto get the Raspian kernel installed with headers:

See : http://www.raspberrypi.org/phpBB3/viewtopic.php?f=66&t=57401
Entry by : by plugwash » Fri Nov 08, 2013 10:22 pm


I use a standard "Foundation Noobs" as the base boot ....
http://www.raspberrypi.org/downloads

Put that one on the SD Card , and activate their Raspbian.
Boot the RasPI , set it up , enable ssh via the "on-screen" config


Then apt-get the Raspian.org kernel below.


I use an unmodified sources.list (from the Noobs raspian)

$ cat /etc/apt/sources.list
deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi



We get the Raspbian package "metapackage linux kernel" , that has corresponding headers.

1: sudo apt-get update
2: sudo apt-get install linux-image-rpi-rpfv

3: In boot/config.txt append this at end of file , or it will boot the default "Foundation kernel"

************* SNIP ***********************
# Set params for "raspbian debian-style kernel" boot
#kernel=vmlinuz-3.2.0-4-rpi
#initramfs initrd.img-3.2.0-4-rpi followkernel
#kernel=vmlinuz-3.6-trunk-rpi
#initramfs initrd.img-3.6-trunk-rpi followkernel
kernel=vmlinuz-3.10-3-rpi
initramfs initrd.img-3.10-3-rpi followkernel
************* SNIP ***********************

4: reboot
5: login
6: apt-get install linux-headers-rpi-rpfv

Done Kernel stuff


6a: Install the needed system packages , in order for linux gpib to build
#All packages on one line
sudo apt-get install build-essential texinfo texi2html libcwidget-dev tcl8.4-dev tk8.4-dev libncurses5-dev \
     libx11-dev binutils-dev bison flex libusb-1.0-0 libusb-dev libmpfr-dev libexpat1-dev tofrodos subversion autoconf automake libtool


7: mkdir linux-gpib    (we assume in your home dir)
8: cd linux-gpib
9: svn checkout svn://svn.code.sf.net/p/linux-gpib/code/trunk linux-gpib-code
10: copy raspi.diff (patchfile) to current dir  (attached)
11: cd linux-gpib-code/linux-gpib/


My patch has been accepted by the linux-gpib maintainers  :-+
So from svn rev 1611 an onwards no patching is needed , the svn repos is updated now.

The patch is also in the new linux-gpib 3.2.20 tarball that you can get here
http://sourceforge.net/projects/linux-gpib/files/

Note (new): If you are also using ISA GPIB Cards , you now have to specificly enable that on the configure line , see readme


Nov-2014 - User falcongsr : Mentions that he had to do an apt-get install python-dev to getthe python bindings to compile

Now we are back on track , and can build normal with ./bootstrap.

Code: [Select]
./bootstrap
./configure
make | tee gpib-make-log
sudo make install

# The make install wil complain about depmod -ae , so just run a depmod -a afterwards

sudo depmod -a
sudo ldconfig

# Load the newly build module
sudo modprobe agilent_82357a


adapt /etc/gpib.conf to match your system  (once)


Attach the USB adapter to the RasPI now

Prepare the load of the usb-adapter firmware
The Agilent 82357B adapter needs the firmware loaded twice.

lsusb
It will show something like this : Bus 001 Device 007: ID 0957:0518 Agilent Technologies, Inc.
The thing to notice is the ID : 0957:0518 , this means the adapter does not have the correct firmware yet.
The adapter will show 0957:0718 when ready , and the green leds will be lit.

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.



Start/init linux-gpib (every time)
sudo gpib_config


Note : Most of the sudo's can be omitted once you get your rules correctly installed in /etc/udev/rules.d
But i'll leave this as an excercise for the reader :-)


Here is some kernel log snips , and a test session using ibtest (linux-gpib test program)
Code: [Select]
#
# From kernel-log
#
Nov 11 20:22:06 raspberrypi-3 kernel: [  184.631539] Linux-GPIB 3.2.19 Driver
Nov 11 20:22:06 raspberrypi-3 kernel: [  184.664507] agilent_82357a_gpib driver loading

*** Agilent insert

Nov 11 20:22:06 raspberrypi-3 kernel: [  184.664681] usbcore: registered new interface driver agilent_82357a_gpib
Nov 11 20:22:06 raspberrypi-3 kernel: [  184.664702] gpib: registered agilent_82357a interface
Nov 11 20:22:39 raspberrypi-3 kernel: [  218.065122] usb 1-1.3: USB disconnect, device number 4
Nov 11 20:22:41 raspberrypi-3 kernel: [  219.837498] usb 1-1.3: new high-speed USB device number 5 using dwc_otg
Nov 11 20:22:41 raspberrypi-3 kernel: [  219.937934] usb 1-1.3: New USB device found, idVendor=0957, idProduct=0518
Nov 11 20:22:41 raspberrypi-3 kernel: [  219.937963] usb 1-1.3: New USB device strings: Mfr=0, Product=0, SerialNumber=0
Nov 11 20:22:55 raspberrypi-3 kernel: [  233.427209] usb 1-1.3: USB disconnect, device number 5
Nov 11 20:22:57 raspberrypi-3 kernel: [  235.197578] usb 1-1.3: new high-speed USB device number 6 using dwc_otg
Nov 11 20:22:57 raspberrypi-3 kernel: [  235.299248] usb 1-1.3: New USB device found, idVendor=0957, idProduct=0718
Nov 11 20:22:57 raspberrypi-3 kernel: [  235.299280] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=5
Nov 11 20:22:57 raspberrypi-3 kernel: [  235.299298] usb 1-1.3: Product: 82357B ()
Nov 11 20:22:57 raspberrypi-3 kernel: [  235.299315] usb 1-1.3: Manufacturer: Agilent Technologies, Inc.
Nov 11 20:22:57 raspberrypi-3 kernel: [  235.299330] usb 1-1.3: SerialNumber: MY4945xxxx
Nov 11 20:22:57 raspberrypi-3 kernel: [  235.309402] probe succeeded for path: usb-bcm2708_usb-1.3
Nov 11 20:23:20 raspberrypi-3 kernel: [  258.549769] attached to bus interface 0, address 0xdb5e0000
Nov 11 20:23:20 raspberrypi-3 kernel: [  258.568586] agilent_82357a_attach: attached
Nov 11 20:27:21 raspberrypi-3 kernel: [  499.191299] usb 1-1.3: USB disconnect, device number 6
Nov 11 20:27:21 raspberrypi-3 kernel: [  499.191651] agilent_82357a_driver_disconnect: exit

*** Beiming insert

Nov 11 20:28:22 raspberrypi-3 kernel: [  560.873199] usb 1-1.3: new high-speed USB device number 7 using dwc_otg
Nov 11 20:28:23 raspberrypi-3 kernel: [  561.205274] usb 1-1.3: New USB device found, idVendor=0957, idProduct=0718
Nov 11 20:28:23 raspberrypi-3 kernel: [  561.205304] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=5
Nov 11 20:28:23 raspberrypi-3 kernel: [  561.205321] usb 1-1.3: Product: S82357 ()
Nov 11 20:28:23 raspberrypi-3 kernel: [  561.205337] usb 1-1.3: Manufacturer: BEIMING Technologies, Inc.
Nov 11 20:28:23 raspberrypi-3 kernel: [  561.205352] usb 1-1.3: SerialNumber: CP1001xxxx
Nov 11 20:28:23 raspberrypi-3 kernel: [  561.215169] probe succeeded for path: usb-bcm2708_usb-1.3
Nov 11 20:29:37 raspberrypi-3 kernel: [  635.696267] gpib0: exiting autospoll thread
Nov 11 20:29:37 raspberrypi-3 kernel: [  635.696388] agilent_82357a_detach: detached
Nov 11 20:29:37 raspberrypi-3 kernel: [  635.696526] attached to bus interface 0, address 0xda1b7000
Nov 11 20:29:37 raspberrypi-3 kernel: [  635.715456] agilent_82357a_attach: attached
Nov 11 20:31:32 raspberrypi-3 kernel: [  750.316900] /home/pi/raspi/linux-gpib-code/linux-gpib/drivers/gpib/agilent_82357a/agilent_82357a.c: agilent_82357a_read: agilent_82357a_receive_bulk_msg timed out, bytes_read=0, extra_bytes_read=1
pi@raspberrypi-3 ~ $


#
# Agilent fw-load
#

root@raspberrypi-3:~# lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 0957:0518 Agilent Technologies, Inc. 82357B GPIB Interface
root@raspberrypi-3:~# fxload -t fx2 -D /dev/bus/usb/001/004 -I /usr/share/usb/agilent_82357a/measat_releaseX1.8.hex

root@raspberrypi-3:~# lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 005: ID 0957:0518 Agilent Technologies, Inc. 82357B GPIB Interface
root@raspberrypi-3:~# fxload -t fx2 -D /dev/bus/usb/001/005 -I /usr/share/usb/agilent_82357a/measat_releaseX1.8.hex

root@raspberrypi-3:~# sudo gpib_config

root@raspberrypi-3:~# ls /dev/gpib*
/dev/gpib0  /dev/gpib10  /dev/gpib12  /dev/gpib14  /dev/gpib2 /dev/gpib4  /dev/gpib6  /dev/gpib8
/dev/gpib1  /dev/gpib11  /dev/gpib13  /dev/gpib15  /dev/gpib3 /dev/gpib5  /dev/gpib7  /dev/gpib9

root@raspberrypi-3:~# sudo ibtest
Do you wish to open a (d)evice or an interface (b)oard?
    (you probably want to open a device): d
enter primary gpib address for device you wish to open [0-30]: 16
trying to open pad = 16 on /dev/gpib0 ...
You can:
    w(a)it for an event
    write (c)ommand bytes to bus (system controller only)
    send (d)evice clear (device only)
    change remote (e)nable line (system controller only)
    (g)o to standby (release ATN line, system controller only)
    send (i)nterface clear (system controller only)
    ta(k)e control (assert ATN line, system controller only)
    get bus (l)ine status (board only)
    go to local (m)ode
    change end (o)f transmission configuration
    (q)uit
    (r)ead string
    perform (s)erial poll (device only)
    change (t)imeout on io operations
    request ser(v)ice (board only)
    (w)rite data string
: w*idn
enter a string to send to your device: *idn?
sending string: *idn?

gpib status is:
ibsta = 0x2100  < END CMPL >
iberr= 0

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

ibcnt = 57
You can:
    w(a)it for an event
    write (c)ommand bytes to bus (system controller only)
    send (d)evice clear (device only)
    change remote (e)nable line (system controller only)
    (g)o to standby (release ATN line, system controller only)
    send (i)nterface clear (system controller only)
    ta(k)e control (assert ATN line, system controller only)
    get bus (l)ine status (board only)
    go to local (m)ode
    change end (o)f transmission configuration
    (q)uit
    (r)ead string
    perform (s)erial poll (device only)
    change (t)imeout on io operations
    request ser(v)ice (board only)
    (w)rite data string
: q



*** Python example with my Keithley @GPIB-Addr 16 ***

root@raspberrypi-3:~# python
Python 2.7.3 (default, Jan 13 2013, 11:20:46)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>>
>>> import Gpib
>>> inst = Gpib.Gpib(0,16) # address 6
>>> inst.write("*IDN?")
>>> inst.read(100) # read 100 bytes
'KEITHLEY INSTRUMENTS INC.,MODEL 2015,104xxxx,B15  /A02  \n'
>>>

When/if your gpib adapter works ok , you could add this line : agilent_82357a 
to the file /etc/modules , and omit this step on new boots : sudo modprobe agilent_82357a

Edit:
I would like to thank plugwash and the other guyz from raspbian.org for caring enough to make the kernel and header package available.  :-+
Apparently the "foundation isn't interested in advanced users".
Apparently the "foundation has other priorities".   :'(

Ohh and the linux-gpib maintainers whom ever they are now.  :-+


Happy measuring

/Bingo
« Last Edit: January 16, 2017, 09:09:50 pm by bingo600 »
 
The following users thanked this post: Nevereven

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
I will update the post with Beiming fw load instructions , once i have gotten the procedure from Beiming , for the latest adapter types


Edit:
I have just been told by Beiming , that the new Beiming adapters comes loaded with the v1.1 i2c-eeprom firmware that's dual capable.
This means that the firmware loading step could be skipped on those adapters. As it will run either linux-gpib or windows (Agilent driver compatible visa) , "out of the box".


/Bingo
« Last Edit: November 14, 2013, 06:42:55 am by bingo600 »
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8517
  • Country: us
    • SiliconValleyGarage
pff... why can't the linux community make simple installers. one click and done ...
and why does the firmware of the box need flashing ?
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline dr.diesel

  • Super Contributor
  • ***
  • Posts: 2214
  • Country: us
  • Cramming the magic smoke back in...
pff... why can't the linux community make simple installers. one click and done ...

Keeps the Windows guys people where they belong.

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
pff... why can't the linux community make simple installers. one click and done ...
and why does the firmware of the box need flashing ?

1:
That would be no fun  ;)   , and make Bill G. a poor(er) man

2:
The adapters are Cypress-FX based , and afaik they need the firmware loaded via the "wire" ,
i think it happens behind the curtains in windooze.

One of these might actually load the fw , and execute gpib_setup , on usb insert
I can't remember witch one was functioning, as i had to remove it due to the Beiming & the Agilent having same vid/pid , but different firmware files.

I'd give the last one the first try.


Put in : /etc/udev/rules.d/77-agilent-82357b-gpib.rules

Code: [Select]
#
# Make sure you have : modprobe agilent_82357a  (put in /etc/modules)
#
# Load the Agilent 82357B (but it needs the fw twice)
# The adapter starts as ID 0957:0518 , and after first fxload it's still ID 0957:0518. But after the 2'nd fxload the adapter changes to ID 0957:0718.
# And is ready to use , after the last firmware load set /dev/gpib* permissions and do a : gpib_config  -  (/usr/local/sbin/gpib_config)
#
#
ATTRS{idVendor}=="0957", ATTRS{idProduct}=="0718", MODE="666"
SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="0957", ATTRS{idProduct}=="0518", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/usb/agilent_82357a/measat_releaseX1.8.hex -D $tempnode"
SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="0957", ATTRS{idProduct}=="0718", RUN+="/usr/local/sbin/gpib_config"

Code: [Select]
#
# File : /etc/udev/rules.d/77-agilent-82357b-gpib.rules
#
# Make sure you have : modprobe agilent_82357a  (put in /etc/modules)
#
# Load the Agilent 82357B (but it needs the fw twice)
# The adapter starts as ID 0957:0518 , and after first fxload it's still ID 0957:0518. But after the 2'nd fxload the adapter changes to ID 0957:0718.
# And is ready to use , after the last firmware load set /dev/gpib* permissions and do a : gpib_config  -  (/usr/local/sbin/gpib_config)
#
#
ATTRS{idVendor}=="0957", ATTRS{idProduct}=="0718", MODE="666"
SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="0957", ATTRS{idProduct}=="0518", RUN+="/sbin/fxload -v -t fx2 -I /usr/share/usb/agilent_82357a/measat_releaseX1.8.hex -D $tempnode"
SUBSYSTEMS=="usb", ACTION=="add", ATTRS{idVendor}=="0957", ATTRS{idProduct}=="0718", RUN+="/bin/chown root:gpib /dev/gpib*; /bin/chmod 660 /dev/gpib*; /usr/local/sbin/gpib_config"



/Bingo
 

Offline claudiux

  • Newbie
  • Posts: 8
  • Country: fr
Bingo, that's a great patch ! Many thanks for sharing it for people like me who can't make this kind of patch. :-+  I used to run linux-gpib with a 82357A on a 90W mini-ITX PC and didn't manage to use it with the raspberry until I saw your post on the time-nuts list !

Your tutorial for the Pi is very clear and works on the first try on a fresh install of raspbian. (I didn't try the rules yet)

Two remarks :

I've read before it's advisable to move the file measat_releaseX1.8.hex in /usr/share/usb/agilent_82357a directory.

I run raspbian without X (installed raspbian-installer) and it looks like we don't need theses packages :
Code: [Select]
texi2html
libcwidget-dev
tcl8.4-dev
tk8.4-dev
libncurses5-dev
libx11-dev
binutils-dev
libusb-dev
libmpfr-dev
tofrodos

Thanks again for sharing !!!






 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
Bingo, that's a great patch ! Many thanks for sharing it for people like me who can't make this kind of patch. :-+  I used to run linux-gpib with a 82357A on a 90W mini-ITX PC and didn't manage to use it with the raspberry until I saw your post on the time-nuts list !

Your tutorial for the Pi is very clear and works on the first try on a fresh install of raspbian. (I didn't try the rules yet)

Two remarks :

I've read before it's advisable to move the file measat_releaseX1.8.hex in /usr/share/usb/agilent_82357a directory.

I run raspbian without X (installed raspbian-installer) and it looks like we don't need theses packages :
Code: [Select]
texi2html
libcwidget-dev
tcl8.4-dev
tk8.4-dev
libncurses5-dev
libx11-dev
binutils-dev
libusb-dev
libmpfr-dev
tofrodos

Thanks again for sharing !!!
@claudiux

Thanx for the feedback  :-+
I was wondering if anyone actually would use it.

1:
I don't think it matters (anymore) where you put the "measat" file.
I think it was (might be) an old "hotplug" dependancy , and it seems to me that linux hotplug is obsolete.

2:
I might have been a bit "generous" in the pre-req packages.
And actually just snipped an existing apt-get list i have for building avr-gcc , and added a few needed packages.
The extra packages wasn't important to me , as i use a 16GB SD-Card , and have lots of space.

If other users want to save space , they can remove the packages you mentions.

/Bingo
« Last Edit: November 20, 2013, 08:57:29 am by bingo600 »
 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
Ohh neat

I just tested a LogiLink mini usb wireless i had in the drawer , on the RasPI
http://www.raspberrypi.org/phpBB3/viewtopic.php?p=457219#p457219

Now i have a wireless-Lan based gpib-adapter  :-+

/Bingo
 

Offline senso

  • Frequent Contributor
  • **
  • Posts: 951
  • Country: pt
    • My AVR tutorials
pff... why can't the linux community make simple installers. one click and done ...
and why does the firmware of the box need flashing ?
Must be one of those Cypress ic's that don't have any rom, just a bootloader, and ram, so on every power on, you must flash/program the little bugger.
 

Offline hari

  • Contributor
  • Posts: 40
  • Country: at
Just one thing to mention: My agilent 82357b did not change the usb id to 0718 even after loading the firmware for the second time. I've ran fxload in verbose mode, and everything looked good. It just did show up with 0518 again and again. Everything works fine after inserting a powered USB hub in the chain. The power supply that I use on the PI is supposed to deliver 2A  :wtf:
Anyway, it works fine with the hub. Thanks for the tutorial.
 

Offline ttb

  • Newbie
  • Posts: 4
Hi guys,

first of all, great procedure!  great detailes.
I'm just unfortunat that my Linux distro seems to be uncomplete.
At the step : sudo make install
i get complaints about the  .../3.6.11+/build directory.  Simply that is doesn't exist.

how or where can i download this?

I added a part of the screenshot at the end of this post, but sorry it's in dutch...

If i ignore this fail, and continue i get to a point that after loading the driver 2x, all the LEDs on the USB adapter light up.
But if i try to initialise:
pi@raspit ~/linux-gpib/linux-gpib-code/linux-gpib/gpib_firmware-2008-08-10/agilent_82357a $ sudo gpib_config
failed to open device file '/dev/gpib0'
main: No such device or address

So this only confirmed a part didn't work, and i'm totaly stuck..

Thanks in advance for any help on this...



make: Een onbekende map wordt binnengegaan    (=entering an unknown folder)
make: *** /lib/modules/3.6.11+/build/: Bestand of map bestaat niet.  Gestopt.             (= .. doesn't exist. stopped)
make: Een onbekende map wordt verlaten               (= exiting unknown folder)
make[2]: [all-local] Fout 2 (genegeerd)                       (=ingnored)
make[3]: Map '/home/pi/linux-gpib/linux-gpib-code/linux-gpib/drivers' wordt binnengegaan
make[3]: Er is niets te doen voor 'install-exec-am'.     (=nothing to do for ..)
make  install-data-hook
make[4]: Map '/home/pi/linux-gpib/linux-gpib-code/linux-gpib/drivers' wordt binnengegaan
make -C /lib/modules/3.6.11+/build/ V=1 modules_install\
                CC=" -I/home/pi/linux-gpib/linux-gpib-code/linux-gpib -I/home/pi/linux-gpib/linux-gpib-code/linux-gpib/driver/include -I/home/pi/linux-gpib/linux-gpib-code/linux-gpib/include" \
                SUBDIRS="/home/pi/linux-gpib/linux-gpib-code/linux-gpib/drivers/gpib" INSTALL_MOD_DIR="gpib"
make: Een onbekende map wordt binnengegaan
make: *** /lib/modules/3.6.11+/build/: Bestand of map bestaat niet.  Gestopt.
make: Een onbekende map wordt verlaten
make[4]: *** [install-data-hook] Fout 2
make[4]: Map '/home/pi/linux-gpib/linux-gpib-code/linux-gpib/drivers' wordt verlaten
make[3]: *** [install-data-am] Fout 2
make[3]: Map '/home/pi/linux-gpib/linux-gpib-code/linux-gpib/drivers' wordt verlaten
make[2]: *** [install-am] Fout 2
make[2]: Map '/home/pi/linux-gpib/linux-gpib-code/linux-gpib/drivers' wordt verlaten
make[1]: *** [install-recursive] Fout 1
make[1]: Map '/home/pi/linux-gpib/linux-gpib-code/linux-gpib/drivers' wordt verlaten
make: *** [install-recursive] Fout 1
« Last Edit: March 25, 2014, 12:46:54 pm by ttb »
 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
@ttb

My raspi kernel shows this :

raspi3:~$ uname -a
Linux raspi3 3.6-trunk-rpi #1 Debian 3.6.9-1~experimental.1+rpi7 armv6l GNU/Linux


I think you use the foundation kernel , and forgot to changr to the raspbian.

Please follow all the steps in the above block in the first post:

Quote
Raspi Preparation
Code: [Select]

/Bingo
 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
@hari

The early RasPi's had problems with usb powering , due to a high ohm polyfuse in the usb line.

Afaik they just used a short in the newer versions.

Do you have an early RasPi ?

My RasPi reboots if i insert a wifi adapter , or my logitech BT keyboard dongle.
So a powered USB HUB is the way to go , even though i can inser both my Agilent or Beoming GPIB wo. a reboot.

/Bingo
 

Offline hari

  • Contributor
  • Posts: 40
  • Country: at
yeah, it is from one of the first batches. Thanks for clarifying.

br Hari
 

Offline ttb

  • Newbie
  • Posts: 4
Hi Bingo600,

I used a NOOB install, but if i added

# Set params for "raspbian debian-style kernel" boot
#kernel=vmlinuz-3.2.0-4-rpi
#initramfs initrd.img-3.2.0-4-rpi followkernel
kernel=vmlinuz-3.6-trunk-rpi
initramfs initrd.img-3.6-trunk-rpi followkernel

the RPi didn't boot anymore. And the HDMI output is a nice colorpallet on the screen.

I now started from a raw rasbian installation, and came to the same problem.
And if i than proceed without editting this boot-file, everything runs up to the point where i should :
# Load the newly build module
sudo modprobe agilent_82357a

--> there it failes to find the module.
under /etc/hotplug/usb, i find 2 files for agilent_82357.  but nothing directly under /usb or Gpib..


What am i doing wrong? any ideas?
« Last Edit: March 27, 2014, 02:15:27 pm by ttb »
 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
Did you remember to perform these steps , after installing and booting from NOOBS.

1: sudo apt-get update
2: sudo apt-get install linux-image-rpi-rpfv

Before modifying the boot/config.txt , with the below parameters , and then reboot on the new raspbian kernel.

kernel=vmlinuz-3.6-trunk-rpi
initramfs initrd.img-3.6-trunk-rpi followkernel



You have to get a working Raspbian kernel up & running (booted) , before being able to get the kernel headers.
And after that  build the linuxgpib modules

It seems a bit strange that hari did the build fine , and you have those troubles.
That is if you followed all the steps correctly


 

Offline alexxx

  • Newbie
  • Posts: 4
this seems a wonderful project, can you tell me if I could use it to do the following?
I have a couple of Hall sensors that I connected to measure a magnetic field along two directions. The sensors output a DC voltage between 0 and 5V.
I'd like to connect it to an analog to digital converter, to read the voltage with the Pi (I already tested it with a simpler sensor).
Now, using linux-gpib, do you think it is possible to output this data to another PC?
I need to do it because in my lab it is this PC that performs the main measurement, using Agilent VEE. Do you think that my VEE program could recognize the Pi and read the data that it outputs with linux-gpib?

thanks for any help!

alessandro

 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
this seems a wonderful project, can you tell me if I could use it to do the following?
I have a couple of Hall sensors that I connected to measure a magnetic field along two directions. The sensors output a DC voltage between 0 and 5V.
I'd like to connect it to an analog to digital converter, to read the voltage with the Pi (I already tested it with a simpler sensor).
Now, using linux-gpib, do you think it is possible to output this data to another PC?
I need to do it because in my lab it is this PC that performs the main measurement, using Agilent VEE. Do you think that my VEE program could recognize the Pi and read the data that it outputs with linux-gpib?

thanks for any help!

alessandro

While i have heard about GPIB controlled A/D's , i dont expect you have one lying around.
They cost $$$$

The instrument you are using for the measurement , would have to have a working GPIB interface installed.
Else this solution don't make any sense.

If you don't already have a DMM , witch in fact is an A/D.

You could get one with GPIB interface (would prob. be an older used one) , but another option is to get a new one with a serial or USB out. And then drop GPIB.

GPIB isn't fantastic , it's just what a lot of older instruments have.

Newer instruments have USB or even LAN , witch is at least "just as good".

/Bingo
 

Offline ttb

  • Newbie
  • Posts: 4
I've gotten so far, that i'm now working the correct kernel.
I had to do the following download/install:
sudo apt-get install linux-image-3.6-trunk-rpi
after this i was able to boot with the correct kernel.
than everything went well until i had to load the module

# Load the newly build module
sudo modprobe agilent_82357a

--> there it failes to find the module.
Where should i find this module? i found the folder gpib_firmware-2008-08-10/agilent_82357a/
and it containes hex files, c-file and readme.
 

Offline alexxx

  • Newbie
  • Posts: 4
While i have heard about GPIB controlled A/D's , i dont expect you have one lying around.
They cost $$$$

The instrument you are using for the measurement , would have to have a working GPIB interface installed.
Else this solution don't make any sense.

If you don't already have a DMM , witch in fact is an A/D.

You could get one with GPIB interface (would prob. be an older used one) , but another option is to get a new one with a serial or USB out. And then drop GPIB.

GPIB isn't fantastic , it's just what a lot of older instruments have.

Newer instruments have USB or even LAN , witch is at least "just as good".

/Bingo

damn, I would really liked to do it all via the Raspberry.
There is no other way, not GPIB, to transmit the data to the PC, that you know of?
 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
damn, I would really liked to do it all via the Raspberry.
There is no other way, not GPIB, to transmit the data to the PC, that you know of?

This is now way off topic , please open another thread.

Title could be : How to read  0..5v from a HallSensor with a RasPI  ?

/Bingo

 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
I've gotten so far, that i'm now working the correct kernel.

--> there it failes to find the module.
Where should i find this module? i found the folder gpib_firmware-2008-08-10/agilent_82357a/
and it containes hex files, c-file and readme.

@ttb
I have run out of ansvers , so this is going to be my last.

1:
Are you sure the compile went well , in all the steps ?
It's hard to follow the output on the screen , and that's why i dit the " | tee "

2:
Did you get the  linux headers (note the new syntax , as you have gotten another kernel)
sudo apt-get install linux-headers-$(uname -r)

3:
Did you get the prerequisites for compiling kernel stuff ?
sudo apt-get install build-essential texinfo texi2html libcwidget-dev tcl8.4-dev tk8.4-dev libncurses5-dev \
     libx11-dev binutils-dev bison flex libusb-1.0-0 libusb-dev libmpfr-dev libexpat1-dev tofrodos subversion autoconf automake libtool


If this doesn't help , you can hope that user hari will step in and tell how he just did it.
https://www.eevblog.com/forum/reviews/using-a-raspberry-pi-with-linux-gpib-and-a-beiming-or-agilent-usb-gpib-adapter/msg412064/#msg412064

/Bingo
 

Offline alexxx

  • Newbie
  • Posts: 4
I guess I have not been clear:
I know how to read my signal on the Raspberry.
I want - after this - transmit its value (digital) to another PC.
I was thinking that I could do it with a GPIB-USB adapter, we have some around. Do you think that with your library I could transmit data along such a line (i.e. USB on the Raspberry, GPIB on the PC, which has a GPIB acquisition card) ???
 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
I guess I have not been clear:
I know how to read my signal on the Raspberry.
I want - after this - transmit its value (digital) to another PC.
I was thinking that I could do it with a GPIB-USB adapter, we have some around. Do you think that with your library I could transmit data along such a line (i.e. USB on the Raspberry, GPIB on the PC, which has a GPIB acquisition card) ???

I doubt you "easily" can use linux-gpib for "transmitting" data to the pc.
It was written for retreiving data from a unit , not sending data to a unit.

/Bingo
 

Offline alexxx

  • Newbie
  • Posts: 4
I doubt you "easily" can use linux-gpib for "transmitting" data to the pc.
It was written for retreiving data from a unit , not sending data to a unit.
/Bingo

oh, I see - damn ! :-)

thank you anyway...
 

Offline ttb

  • Newbie
  • Posts: 4
@Bingo 600

1. if i go trough the logfile, i see some remarks "nothing to do for all"
but i supposed this was normal??

2. i got the latest headers

3. yes, no remarks when i did that..

Thanks for your help, hope Hari or somebody else can come up with some ideas.
The main problem as far as i know anything of it.. seems to be the modules not getting created or loaded.
And i don't know where they should be created. /lib/..  /etc/.. ??
 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
Allready having done the , as described in the first post.
1: sudo apt-get update
2: sudo apt-get install linux-image-rpi-rpfv

I just updated my kernel to
Quote
bingo@raspi3:~$ uname -a
Linux raspi3 3.10-3-rpi #1 Debian 3.10.11-1+rpi6 (2014-04-27) armv6l GNU/Linu

I did the following:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade.

Edited the /boot/config.txt to load the newest kernel
In boot/config.txt append this at end of file , or it will boot the default "Foundation kernel"

************* SNIP ***********************
# Set params for "raspbian debian-style kernel" boot
#kernel=vmlinuz-3.2.0-4-rpi
#initramfs initrd.img-3.2.0-4-rpi followkernel
#kernel=vmlinuz-3.6-trunk-rpi
#initramfs initrd.img-3.6-trunk-rpi followkernel
kernel=vmlinuz-3.10-3-rpi
initramfs initrd.img-3.10-3-rpi followkernel
************* SNIP ***********************

Then i did a : rpi-update   (to get the newest firmware)
The rpi-update also pulls the newest "Foundation kernel" , but i don't use it.

And did a reboot.

Now it shows:
Quote
bingo@raspi3:~$ uname -a
Linux raspi3 3.10-3-rpi #1 Debian 3.10.11-1+rpi6 (2014-04-27) armv6l GNU/Linu

Then i rebuild the module , using the above steps.
Including a new "git clone" , as the ./bootstrap needed to get new values from scratch.

All went well  :-+

/Bingo
« Last Edit: May 14, 2014, 08:06:02 pm by bingo600 »
 

Offline macboy

  • Super Contributor
  • ***
  • Posts: 2254
  • Country: ca
this seems a wonderful project, can you tell me if I could use it to do the following?
I have a couple of Hall sensors that I connected to measure a magnetic field along two directions. The sensors output a DC voltage between 0 and 5V.
I'd like to connect it to an analog to digital converter, to read the voltage with the Pi (I already tested it with a simpler sensor).
Now, using linux-gpib, do you think it is possible to output this data to another PC?
I need to do it because in my lab it is this PC that performs the main measurement, using Agilent VEE. Do you think that my VEE program could recognize the Pi and read the data that it outputs with linux-gpib?

thanks for any help!

alessandro

VEE should be able to accept data from any arbitrary RS232/serial device. So I would focus on using that interface into VEE. You can use software (such as com2com) to create a pair of virtual loopback COM ports. Then VEE would connect to one of them, and the other connects to a program that will route the serial port data over TCP (com2tcp, part of the com2com software). You PI only needs to open a TCP connection to the other computer and send the data. It will then magically appear on the serial port that VEE is listening to.

On the PI side, I don't think you even need GPIB. It would be "easier" to connect an I2C ADC to the PI to get your data in. There are also purpose made modules ("ADC PI" for example) for ADC.
 

Offline davorin

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Hmm...according to your Python example....I just get:

Code: [Select]
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Gpib
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named Gpib

What's missing to be able to use Python with linux-gpib?

 

Offline davorin

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Got it....

Code: [Select]
sudo apt-get install libpython2.7-dev ;-)

 

Offline davorin

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Hmm....doesn't work with screendumps...

Code: [Select]
>>> inst.write("SCDP")
>>> inst.read(25000)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/Gpib.py", line 55, in read
    self.res = gpib.read(self.id,len)
gpib.GpibError: read() failed: A read or write of data bytes has been aborted, possibly due to a timeout or reception of a device clear command.
>>>
 

Offline davorin

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Apparently 25000 is too big (o;

So...just wrote my first Python script in my life *gg

Code: [Select]
#!/usr/bin/python

from Gpib import *

inst = Gpib(0,15)

f = open('dso.plt', 'w')

inst.write("SCDP")

f.write(inst.read(512))

while inst.ibcnt() == 512:
print 'Reading 512 bytes'
f.write(inst.read(512))

print 'Finished dumping...'

A little slow though with the F82357 adapter...but I guess the MC68000 is the bottleneck (o;

Code: [Select]
Finished dumping...

real 0m32.321s
user 0m0.022s
sys 0m0.047s

Then a little

Code: [Select]
hp2xx -m png -c 1234567 dso.plt
And out comes:

« Last Edit: July 28, 2014, 06:07:39 pm by davorin »
 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
@davorin  :-+

Feels good doesn't it ?

/Bingo
 

Offline davorin

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Yes it does....getting there slowly but surely (o;

Before I used a Prologix clone with a simple terminal program....and just piped the output to a log file after entering "SCDP" (o;

Guess the next step is towards small C-programs....

And finally using MRTG/Cacti to time graph current consumption measured by my 4 * 6632B (o;

 

Offline davorin

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Hmmm...what drives me nuts is now the fact I can't pipe it to hp2xx for further processing....

Code: [Select]
Traceback (most recent call last):
  File "./dump.py", line 34, in <module>
    proc = subprocess.Popen(hp2xx, stdin=subprocess.PIPE)
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

The code:

Code: [Select]
proc = subprocess.Popen(hp2xx, stdin=subprocess.PIPE)
proc.stdin.write(hpgl)

And replacing the shell command with "/bin/cat" actually does it what it should...just not with:

Code: [Select]
/usr/bin/hp2xx -m png -c 12445611 -d 100 -f lecroy.png
 

Offline davorin

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
*Uff....that was a long exercise to find out why /bin/v^cat worked but hp2xx not...

The answer I finally found here:

http://stackoverflow.com/questions/23787338/python-popen-shell-false-causes-oserror-errno-2-no-such-file-or-directory


And here's the code....called with

Code: [Select]
./dump.py lecroy
Which reads the screendump and dumps it out to hp2xx, converting to a 100 DPI PNG file...all in one (o;


Code: [Select]
#!/usr/bin/python

import sys
from subprocess import Popen, PIPE
import errno
import shlex

hpgl = ""
hp2xx = "/usr/bin/hp2xx -m png -c 12445611 -d 100 -q -f "
cat = "/bin/cat"

from Gpib import *

file_name = sys.argv[1]
hp2xx += file_name
hp2xx += ".png"

p = Popen(shlex.split(hp2xx), shell=False, stdin=PIPE)

bytes = 100

inst = Gpib(0,15)

inst.write("SCDP")

p.stdin.write(inst.read(bytes))
count = 0

while inst.ibcnt() == bytes:
print 'Reading ', count, ' bytes\r'
p.stdin.write(inst.read(bytes))
count += bytes

print 'Finished dumping...'

print hp2xx

p.stdin.close()
p.wait()

Comments and improvements welcome :-))

 

Offline falcongsr

  • Newbie
  • Posts: 1
Bingo thanks for your perseverance and taking the time documenting your progress. I just got it working on my Pi. Hugely helpful!

falcongsr
 

Offline er11

  • Newbie
  • Posts: 2
Thank you very much, Bingo
Gpib is ok
But I get a trouble with SPI, in kernel 3.12-1 SPI seems not enable.
Can you give us a kernel with SPI ?
Thank you
 

Offline chahine

  • Newbie
  • Posts: 1
Merci pour les infos grâce auxquelles on a réussi une manip présentée au lien ci dessous en français pour les francophones!
gilles-micolau.toile-libre.org/Flopy-html/Flopy.html
 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
Merci pour les infos grâce auxquelles on a réussi une manip présentée au lien ci dessous en français pour les francophones!
gilles-micolau.toile-libre.org/Flopy-html/Flopy.html

Thanx  :-+
I think it says that it works  ;)

/Bingo
 

Offline AudioplatinumService

  • Contributor
  • Posts: 43
  • Country: hr
    • www.audioplatinum.net
Hi guys!

I saw this post and I get one idea, if anybody here can help me little..
I have Tektronix AM700 Audio Measurement Set with GPIB, one very nice instrument with lot of functions for audio measurement.
I am newbie in GPIB, but I am good with linux and in my workshop I have couple of Raspberry Pi.

I wish to can read display results from AM700 when I measure something or doing some tests. Tektronix have one nice document for this AM700 with all commands and programming (SCPI thru GPIN or RS232)

http://exodus.poly.edu/~kurt/manuals/manuals/Tektronix/TEK%20AM700%20Programmer.pdf

Can someone take a look on this document and tell me if this can work with linux GPIB maybe?

Best Regards,
Damir
Audioplatinum Service
www.audioplatinum.net
A clean desk is the sign of a sick mind...
 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
Hi guys!

I saw this post and I get one idea, if anybody here can help me little..
I have Tektronix AM700 Audio Measurement Set with GPIB, one very nice instrument with lot of functions for audio measurement.
I am newbie in GPIB, but I am good with linux and in my workshop I have couple of Raspberry Pi.

I wish to can read display results from AM700 when I measure something or doing some tests. Tektronix have one nice document for this AM700 with all commands and programming (SCPI thru GPIN or RS232)

http://exodus.poly.edu/~kurt/manuals/manuals/Tektronix/TEK%20AM700%20Programmer.pdf

Can someone take a look on this document and tell me if this can work with linux GPIB maybe?

Best Regards,
Damir

Sure you can , but you'd need a supported USB-GPIB adapter , HP/Beiming/NI.  I have only tried the HP/Beiming (s)

But you also need to code your own measurement scripts , in C , Python , Perl or one of the other supported linux-gpib language extensions.

So if you can't program in one of the languages , you might be out of luck , or if you're lucky you can use LabView on Windows ($$$$) if TEK made a labview driver.

Note: There is also some gpib-controllers with serial interface , that just requires a "Comport" but still the above programming skills.


/Bingo
 

Offline AudioplatinumService

  • Contributor
  • Posts: 43
  • Country: hr
    • www.audioplatinum.net
Thanks on information Bingo

    Today I try my TEK  AM700 connect thru "usb to serial" adapter to PC and listen with serial capture software, after decoding emulated data (I setup tektronix to HP print mode) and I get nice screen capture on max speed of TEK serial port 38400.

I have to buy GPIB adapter and try make some magic with GPIB.. 

TNX all of you on inspiring posts about RPi-GPIB...

Cheers,
 Damir
Audioplatinum Service
www.audioplatinum.net
A clean desk is the sign of a sick mind...
 

Offline kuadrat

  • Newbie
  • Posts: 1
Hey Bingo,
thanks a lot for documenting your porcess of getting linux-gpib to work on the Raspberry PI and for your patch. I've been unsuccsessfully trying to install it on my own for far too long now...
Sadly, even when following your instructions, I experience the same problem as user ttb. It seems pretty clear to me that we don't have the right kernel headers, and in my case the reason for that is probably that I'm unable to do a "raspbian debian-style kernel" boot.
I'm running on a raspberry 2B, so after apt-get update and apt-get upgrade I installed the package linux-image-rpi2-rpfv.
I edited the config.txt file with the respective filenames from my /boot directory:

kernel=vmlinuz-3.18-0-trunk-rpi2
initramfs initrd.img-3.18-0-trunk-rpi2 followkernel

But my RasPi wont reboot with these settings.
I've tried several variations (linux-image-rpi-rpfv package and respective filenames in config.txt etc.) but can't get it to boot with anything but the default kernel.img.

I did start from a Raspbian image, not NOOBS, maybe this makes the difference?

Or maybe I'm missing something obvious here. Anyhow, if you (or anyone) has an idea what I'm doing wrong I'd greatly appreciate any help.

My next step would be to reformat the SD card and start from scratch, following your every step exactly, but I thought I'd ask if anyone would have a better idea before going that far.

Thanks in advance,
-kuadrat
 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
@kuadrat

I'm sorry but i don't have any rpi-2's , not even a B'
I doubt if installing Noobs or Raspbian first would make any difference, but i have only tested by installing NOOBS first, and then upgrade to raspbian.

So i can't help much out here.

Unless someone sponsors a RPI-V2  ;)



Once you succeed in making the kernel boot , get linux-gpib.
I'd recommend the tar file , as the SVN is evolving and sometimes buggy
http://sourceforge.net/projects/linux-gpib/files/

Direct link
http://sourceforge.net/projects/linux-gpib/files/latest/download?source=files

Note you don't need to do any patching , Dave P did incorporate it in the latest releases.

/Bingo
« Last Edit: June 16, 2015, 06:40:46 pm by bingo600 »
 

Offline bson

  • Supporter
  • ****
  • Posts: 2270
  • Country: us
I have an Intel NUC running Ubuntu 64-bit with the Agilent usbtmc driver - the driver was a bit out of date and needed a few updates for kernel interfaces changes to compile.  The driver does work fine with the few USB-TMC (GPIB-over-USB) devices I tested it with.  I have a Tek-USB-488 adapter on its way and plan to test with this as well.  (USB-TMC to physical GPIB.)  The Agilent usbtmc driver works with python-ivi and python-tmc.

The main thing is the Linux ehci bus driver is flaky when it comes to supporting USB2 devices on a USB3 host controller.  I'd recommend putting a 2.0 hub inbetween.  For some odd reason 1.1 devices don't cause problems, but I've found 2.0 devices do very consistently drop offline due to ehci-bus resets.
 

Offline davorin

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
I'll got a chance to try it on a newer RPi 2 model....think I have all versions lying around here...though I intend to use one of my Beiming adapter with a Wandboard Dual when I get linux-gpib to compile with PHP 5 version (o;

Still struggling with Beiming adapters not supporting remote select with linux-gpib...works on Windows though with Agilent I/O...

 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
Still struggling with Beiming adapters not supporting remote select with linux-gpib...works on Windows though with Agilent I/O...

@davorin

Try the latest SVN

After FM Hess rejoined the linux-gpib project, quite a few modifications/improvements have been made.

Try to read some of the commit notes for the latest svn releases.

NOTE: Remember to reboot after installing, as the new versions breaks backwards compatibility.
Meaning the old loaded gpib module is incompatible with the new agilentxxx.ko module, until reloaded.
Easiest with a reboot.

/Bingo
 

Offline davorin

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
I tried a svn checkout a while ago...didn't compile through at all (o;
Running now the 4.01 beta...also no luck with remote select....

Gonna try a new SVN on Thursday as I'm away tomorrow....just don't wanna go the Windows 8.1 Visual Studio way just to support my R&S CRTU (o;

 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
I tried a svn checkout a while ago...didn't compile through at all (o;
Running now the 4.01 beta...also no luck with remote select....

Gonna try a new SVN on Thursday as I'm away tomorrow....just don't wanna go the Windows 8.1 Visual Studio way just to support my R&S CRTU (o;

I have just told Dave P , that SVN 1633 breaks on my 32-bit Debian Wheezy.
And Dave has just confirmed the bug.

He'll have a look on what is causing it , and hopefully fixing it in SVN Rev 1634

A big thank you to the linux-gpib team , and especially Dave. For accepting and implementing my RasPi patch.
But not to forget FM Hess (long time maintainer), who have recently returned to the project , and is now working with Dave   :-+

/Bingo
 

Offline davorin

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Do you know who works on PHP support? Think it is still on version PHP-4.x the last time I've tried...

 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
Do you know who works on PHP support? Think it is still on version PHP-4.x the last time I've tried...

I don't know.
For quite some time linux-gpib was just being "maintained" meaning there would come no new features, only bugfixes.

I don't know if that has changed, now where FMH is back in the team.

But Dave P has just released SVN 1643, that fixed my problem when making 1633 on a 32-bit Debian machine.
I'm running 1634 SVN now on a Beiming USB GPIB adapter.
Thank you for that Dave  :-+

/Bingo


 

Offline davorin

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Just checked out the latest SVN version and isntalled it...and of course did a reboot (o;

Still the same..won't do "remote select"...

Code: [Select]
libgpib: ibsre error
Traceback (most recent call last):
  File "crtu.py", line 6, in <module>
    v.remote_enable(1)
  File "/usr/local/lib/python2.7/dist-packages/Gpib.py", line 80, in remote_enable
    gpib.remote_enable(self.id,val)
gpib.GpibError: remote_enable() failed: One or more arguments to the function call were invalid.
 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
@davorin

What's the full source (or remote select example) ?
What adapter are you using ?

I have both a Beiming and an Agilent here

/Bingo
 

Offline davorin

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
That's just a simple Python script:

Code: [Select]
from Gpib import *

v = Gpib(0,20)

v.clear()
v.remote_enable(1)

v.write("*IDN?")

print v.read(200)


There isn't much documentation regarding "remote select" though....

It's a F82357 Beiming adapter...same with a S82357 adapter....well...hardware is exactly the same...just the firmware makes it a F or S model...

 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
Are you sure that's the way to do it ??


from the py implementation in language
Code: [Select]

static char gpib_remote_enable__doc__[] =
"remote_enable -- set remote enable (board)\n"
"remote_enable(handle, enable)";

static PyObject* gpib_remote_enable(PyObject *self, PyObject *args)
{
int device;
int val;
int sta;

if (!PyArg_ParseTuple(args, "ii:remote_enable", &device,&val))
return NULL;

Py_BEGIN_ALLOW_THREADS
sta = ibsre(device,val);
Py_END_ALLOW_THREADS

if( sta & ERR){
_SetGpibError("remote_enable");
return NULL;
}

return PyInt_FromLong(sta);
}



From the doc (attached)  pg. 47

Quote
ibsre

Description
If enable is nonzero, then the board specified by the board descriptor ud asserts the REN line. If
enable is zero, the REN line is unasserted. The board must be the system controller.
Return value
The value of ibsta is returned.


I think the systemcontroller is your adapter (beiming) , usually addr 0.


Btw: I use gpib.find , to open the devices with
It has the advantage of using the gpib.conf file , and the names/settings from that one is automaticly set when the device is found/opened (ie. eos/eot values etc)


Code: [Select]
RQS=0x0800 #
SPOLL=0x0400        #


BOARD=gpib.find("agilent_82357b") # The GPIB Controller Board
PM6680=gpib.find("PM6680B")             # defined in /etc/gpib.conf - Phillips PM6680

gpib_conf(BOARD,gpib.IbcAUTOPOLL,1) # Enable Auto Spoll, for RQS detection
gpib_conf(BOARD,gpib.IbcSPollBit,1) # Enable Serial Spoll bit usage.
gpib_conf(PM6680,gpib.IbcSPollTime,gpib.T30s) # Enable Serial Spoll timeout , must match


gpib_timeout(PM6680,gpib.T30s)

print query(PM6680,"*IDN?")



/Bingo
« Last Edit: June 18, 2015, 07:29:57 pm by bingo600 »
 

Offline davorin

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Hmm...you might be right....that I have to specify the Beiming adapter to set rsel...not the end device...as the line is common to all devices....

 

Offline davorin

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Okay..this snippet doesn't show this error anymore...it just times out during reading back from the device...

Code: [Select]
#!/usr/bin/python

import Gpib

a = Gpib.Gpib('crtu')
b = Gpib.Gpib('agilent')

b.remote_enable(1)

a.write("*IDN?")

print a.read(200)

Guess now it's time to hook up some DSO to see what happens (o;

 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
Okay..this snippet doesn't show this error anymore...it just times out during reading back from the device...

Code: [Select]
#!/usr/bin/python

import Gpib

a = Gpib.Gpib('crtu')
b = Gpib.Gpib('agilent')

b.remote_enable(1)

a.write("*IDN?")

print a.read(200)

Guess now it's time to hook up some DSO to see what happens (o;

EOI or EOS/EOT definition problems ?

/Bingo
 

Offline davorin

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Hmm...tried some combinations now...still no luck...

But the REN line is asserted correctly....dunno what this "extra_bytes_read=1" means in the dmesg output...
 

Offline davorin

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Odd....it gives the 3 seconds timeout both during write and during read....

BTW: is /etc/gpib.conf always reloaded when doing "sudo gpib_config" ?
 

Offline davorin

  • Supporter
  • ****
  • Posts: 922
  • Country: ch
Tried now all configurations possible in gpib.conf......so meaning 2 * 16 different configurations with either eos 0x0a or 0x0d...

Just won't answer...but answers quickly as soon I plug it into the WIn8.1 machine with Agilent I/O installed...

 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
Odd....it gives the 3 seconds timeout both during write and during read....

BTW: is /etc/gpib.conf always reloaded when doing "sudo gpib_config" ?

I have no idea

Have you tried to "scope" the EOI line on a working windows, and then on linux ?

Ohh and the doc says that the Agilent USB's can only do 8-bit (binary) compare  (might be actual for eos/eot)

/Bingo
/Bingo
« Last Edit: June 20, 2015, 07:57:41 am by bingo600 »
 

Offline bang007

  • Newbie
  • Posts: 4
Hi guys,

First thanks to bingo600 for this documentation. I can now communicate with my tektronix TDS 3052 with my RPi B+ via GPIB :-+.
Every thing is ok except the hardcopy.
I  try to write a script in python to save the screenshoot in a png file but I get some errors. If any body can have a look on this. I am new in Python.
Many thanks for your help.

Code: [Select]
import visa

rm=visa.ResourceManager('@py')
scope = rm.open_resource('GPIB::6::0')

scope.write('HARDCOPY:FILENAME "test.png"')
scope.write('HARDCOPY:FORMAT PNG')
scope.write('HARDCOPY:LAYOUT LANDSCAPE')
scope.write('HARDCOPY:PORT GPIB')
scope.write('HARDCOPY START')

raw_data=scope.read()

fid=open('/home/pi/test.png','wb')
fid.write(raw_data)
fid.close()

And I got this error
Quote
File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/pyvisa/resources/messagebased.py", line 312, in read
    message = self.read_raw().decode(enco)
UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 1031: ordinal not in range(128)
« Last Edit: June 24, 2015, 10:00:53 am by bang007 »
 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
Hi guys,

First thanks to bingo600 for this documentation. I can now communicate with my tektronix TDS 3052 with my RPi B+ via GPIB :-+.
Every thing is ok except the hardcopy.
I  try to write a script in python to save the screenshoot in a png file but I get some errors. If any body can have a look on this. I am new in Python.
Many thanks for your help.

Code: [Select]
import visa

rm=visa.ResourceManager('@py')
scope = rm.open_resource('GPIB::6::0')

scope.write('HARDCOPY:FILENAME "test.png"')
scope.write('HARDCOPY:FORMAT PNG')
scope.write('HARDCOPY:LAYOUT LANDSCAPE')
scope.write('HARDCOPY:PORT GPIB')
scope.write('HARDCOPY START')

raw_data=scope.read()

fid=open('/home/pi/test.png','wb')
fid.write(raw_data)
fid.close()

And I got this error
Quote
File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/pyvisa/resources/messagebased.py", line 312, in read
    message = self.read_raw().decode(enco)
UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 1031: ordinal not in range(128)

Have a look here
https://www.eevblog.com/forum/testgear/new-rigol-ds1054z-oscilloscope/msg675845/#msg675845

This is the one for reading Rigols , and raw reads work

Snip that read from the rigol one , and use for the TEK

/Bingo
 

Offline bang007

  • Newbie
  • Posts: 4
Thanks bingo600
I will try it and give  a feedback later  :-BROKE
 

Offline bang007

  • Newbie
  • Posts: 4

I still have a problem with the encodage. I use python 2.7 and pyVisa 1.7.
When I make a read_raw(), I have no error but my png image is empty (black background).
I've also tried  scope.read(encoding='UTF-8') but I got this error   :-//

Quote
File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/pyvisa/resources/messagebased.py", line 312, in read
    message = self.read_raw().decode(enco)
  File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xb4 in position 3: invalid start byte

 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk

I still have a problem with the encodage. I use python 2.7 and pyVisa 1.7.
When I make a read_raw(), I have no error but my png image is empty (black background).
I've also tried  scope.read(encoding='UTF-8') but I got this error   :-//

Quote
File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/pyvisa/resources/messagebased.py", line 312, in read
    message = self.read_raw().decode(enco)
  File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xb4 in position 3: invalid start byte

I think you have to ask a python expert in another message.
They prob. dont read gpib stuff

/Bingo
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4543
  • Country: ua
    • xDevs.com
Revive, revive!  :-+

Many thanks, Bingo600 for your thread for GPIB-linux.

Spend some time and got my RaspberryPi talking well on GPIB using NI GPIB-USB-HS.

Step-by-step guide (click on photo) :

« Last Edit: August 15, 2015, 06:44:37 pm by TiN »
YouTube | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
@TIN  :-+

Well done, now you can produce some nice Linux/Python scripts for measuring deviations on our DMM's.
Then us with Linux can play along.

/Bingo
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4543
  • Country: ua
    • xDevs.com
Well, sorry for necroposting, but I think this one is bit important.

I got HP/Agilent 4142B mainframe which sports HP-IB interface and since this thing does not have any controls on it's FP, only way to use it talk via GPIB.
Oki-doki I thought, no problems, my RPI+linux-gpib is ready.

But bleeeep... Failed at first attempt. ibtest was working well and nice, instrument was accepting commands and reading feedback, just like it should be.

First I ran ibtest program to check if Raspberry Pi with linux-gpib package can talk with the instrument and read data back.

Code: [Select]
enter a string to send to your device: *IDN?
sending string: *IDN?
trying to read 40 bytes from device...
received string: 'HEWLETT PACKARD,4142B,0,4.30'

But attempt of using same thing in the usual Python binding thru linux-gpib rendered no good results, 4142B just entering TALK mode and does not feedback or execute any commands.

My python test app:

Code: [Select]
cat ./test.py
# xDevs.com Python test GPIB app
# http://xdevs.com/fix/a4142b/
import sys
import Gpib

inst = Gpib.Gpib(0,14) # 4142B GPIB Address = 27
inst.clear()
inst.write("*RST")
inst.write("*TST? 2")
str = inst.read(40)
print str

This should reset the instrument and issue command to perform self-test on module in slot 2. Nop, nothing, just TLK LED lit up and nothing happening. App give timeout error on inst.read command afterwards.

How I fixed it? Just add \n in write strings, and it works well now!

Code: [Select]
...
inst.write("*IDN?\n")
str = inst.read(40)
print str

Code: [Select]
root@pi2:/repo/3458# python ./test.py
HEWLETT PACKARD,4142B,0,4.30

Hope this helps someone.
YouTube | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
@TIN

This is often needed on old HP equipment (the \n).
I seem to remember my 5384 needs it too.

/Bingo
 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4543
  • Country: ua
    • xDevs.com
Well, HP 3458A obviously fine without \n, as well as all my Keithley folks...  So it was new to me.
YouTube | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
Often the need for \n , is if/when EOI is not used by the instrument or adapter (or not set up correctly)
Then the instruments trigger on \n as a last resort.

/Bingo
 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
@TiN

Nice find  :-+ - About how to get kernel source & headers for the newer kernels (jessie) , in your NI GPIB section
https://xdevs.com/guide/ni_gpib_rpi/

I just build and installed the Agilent modules for my Raspi V3 & old Raspi V1 (jessie)
uname -a
Linux raspi-4 4.1.19-v7+ #858 SMP Tue Mar 15 15:56:00 GMT 2016 armv7l GNU/Linux


I haven't tested them on the adapter yet , but i can load (modprobe) the modules
sudo modprobe agilent_82357a


/Bingo
« Last Edit: April 16, 2016, 08:03:48 pm by bingo600 »
 

Offline z01z

  • Regular Contributor
  • *
  • Posts: 151
Thanks a lot for documenting what setup is needed. It seems like even more became standard in later packages, I've noticed that even the udev magic was already there.

Despite this I'm having a problem with using an 82357B on a raspberry pi3.

The adapter seems to be initialized correctly, gpib_config runs without any error (one green LED is lit):
Code: [Select]
[12627.478991] usb 1-1.2: new high-speed USB device number 29 using dwc_otg
[12627.579385] usb 1-1.2: New USB device found, idVendor=0957, idProduct=0518
[12627.579405] usb 1-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[12627.755720] usb 1-1.2: USB disconnect, device number 29
[12629.529008] usb 1-1.2: new high-speed USB device number 30 using dwc_otg
[12629.629413] usb 1-1.2: New USB device found, idVendor=0957, idProduct=0518
[12629.629431] usb 1-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[12629.803990] usb 1-1.2: USB disconnect, device number 30
[12631.579035] usb 1-1.2: new high-speed USB device number 31 using dwc_otg
[12631.679905] usb 1-1.2: New USB device found, idVendor=0957, idProduct=0718
[12631.679929] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=5
[12631.679942] usb 1-1.2: Product: 82357B ()
[12631.679954] usb 1-1.2: Manufacturer: Agilent Technologies, Inc.
[12631.679966] usb 1-1.2: SerialNumber: MY48200000
[12631.680945] probe succeeded for path: usb-3f980000.usb-1.2
[12631.713960] gpib0: exiting autospoll thread
[12631.714029] agilent_82357a_detach: detached
[12631.714109] attached to bus interface 0, address 0xb8383600
[12632.099541] agilent_82357a_attach: attached

However when trying to send a command in ibtest (w), there's a timeout:
Code: [Select]
gpib status is:
ibsta = 0xc100  < ERR TIMO CMPL >
iberr= 14
EBUS 14: Bus error

The adapter is working fine on Windows, talking to my equipment (K2000).
I was thinking maybe the gpib config is wrong, I've tried several setting to no avail.
This is the current gpib.conf:
Code: [Select]
interface {
        minor = 0       /* board index, minor = 0 uses /dev/gpib0, minor = 1 uses /dev/gpib1, etc. */
        board_type = "agilent_82357a"   /* type of interface board being used */
        master = yes
        name = "agilent"        /* optional name, allows you to get a board descriptor using ibfind() */
        pad = 30        /* primary address of interface             */
        timeout = T3s   /* timeout for commands */
        set-bin = yes /* Compare EOS 8-bit */
}

Any idea what to try?
 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
Thanks a lot for documenting what setup is needed. It seems like even more became standard in later packages, I've noticed that even the udev magic was already there.

Despite this I'm having a problem with using an 82357B on a raspberry pi3.

The adapter seems to be initialized correctly, gpib_config runs without any error (one green LED is lit):
Code: [Select]
[12627.478991] usb 1-1.2: new high-speed USB device number 29 using dwc_otg
[12627.579385] usb 1-1.2: New USB device found, idVendor=0957, idProduct=0518
[12627.579405] usb 1-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[12627.755720] usb 1-1.2: USB disconnect, device number 29
[12629.529008] usb 1-1.2: new high-speed USB device number 30 using dwc_otg
[12629.629413] usb 1-1.2: New USB device found, idVendor=0957, idProduct=0518
[12629.629431] usb 1-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[12629.803990] usb 1-1.2: USB disconnect, device number 30
[12631.579035] usb 1-1.2: new high-speed USB device number 31 using dwc_otg
[12631.679905] usb 1-1.2: New USB device found, idVendor=0957, idProduct=0718
[12631.679929] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=5
[12631.679942] usb 1-1.2: Product: 82357B ()
[12631.679954] usb 1-1.2: Manufacturer: Agilent Technologies, Inc.
[12631.679966] usb 1-1.2: SerialNumber: MY48200000
[12631.680945] probe succeeded for path: usb-3f980000.usb-1.2
[12631.713960] gpib0: exiting autospoll thread
[12631.714029] agilent_82357a_detach: detached
[12631.714109] attached to bus interface 0, address 0xb8383600
[12632.099541] agilent_82357a_attach: attached

However when trying to send a command in ibtest (w), there's a timeout:
Code: [Select]
gpib status is:
ibsta = 0xc100  < ERR TIMO CMPL >
iberr= 14
EBUS 14: Bus error

The adapter is working fine on Windows, talking to my equipment (K2000).
I was thinking maybe the gpib config is wrong, I've tried several setting to no avail.
This is the current gpib.conf:
Code: [Select]
interface {
        minor = 0       /* board index, minor = 0 uses /dev/gpib0, minor = 1 uses /dev/gpib1, etc. */
        board_type = "agilent_82357a"   /* type of interface board being used */
        master = yes
        name = "agilent"        /* optional name, allows you to get a board descriptor using ibfind() */
        pad = 30        /* primary address of interface             */
        timeout = T3s   /* timeout for commands */
        set-bin = yes /* Compare EOS 8-bit */
}

Any idea what to try?

I'd change the "Controllers PAD to 0"

        pad = 0                         /* primary address of interface */

/Bingo
 

Offline z01z

  • Regular Contributor
  • *
  • Posts: 151
Thanks for the suggestion, unfortunately I've already tried that and it didn't work either.

I've noticed that the remote and listen indicators are turned on the meter when trying to send a message, so I suppose something gets there.
 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
Smells of EOI error

Have you seen Dave's new ibterm program , you can set eoi/eot on that one

ibterm -d 5  -i1  -e10 -x1 -r1 -b1
Attempting to open /dev/gpib0
pad = 5, sad = 0, timeout = 10, send_eoi = 1, eos_mode = 0x1c0a
ibterm>ID
HP5384A
ibterm> <ctrl-D> for exit
ibterm: Done.
 

Offline z01z

  • Regular Contributor
  • *
  • Posts: 151
Smells of EOI error

Have you seen Dave's new ibterm program , you can set eoi/eot on that one

ibterm -d 5  -i1  -e10 -x1 -r1 -b1
Sadly this gives the same error for me.

I've also reinstalled everything from scratch in the meantime but the same happens.
I've checked with tcpdump that the GPIB command is not sent out. I've also tried strace (sudo strace -ttT ibterm -d 1  -i1  -e10 -x1 -r1 -b1), the result is attached. It appears that strace shows the same trace when the existing device address is specified and when not, so in reality there is no GPIB communication at all.

I suspect that I do something wrong with building/installation. You've previously mentioned that TiN's NI guide worked for you. Was it a 4.0.x version, or the older 3.2.21 TiN used?
Might it cause a problem that I have a PI 3 B?
 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
I have used both 3x & 4x kernels , but only tested/used on a Rpi 1 (512MB)

/Bingo
 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk

Here is a snip from my gpib.config.

Controller & K2015 (should be like your K2000)

Code: [Select]
interface {
        minor = 0                       /* board index, minor = 0 uses /dev/gpib0, minor = 1 uses /dev/gpib1, etc. */
        board_type = "agilent_82357a"   /* type of interface board being used */
        name = "agilent_82357b"
        master = yes                    /*interface board is system controller*/
        pad = 0                         /* primary address of interface */
        sad = 0                         /* secondary address of interface */
        timeout = T3s                   /* timeout for commands */
        eos = 0xa                       /* EOS Byte, 0xa is newline and 0xd is carriage return */
        set-reos = yes                  /* Terminate read if EOS */
        set-bin = yes                   /* Compare EOS 8-bit */
        set-xeos = no                   /* Assert EOI whenever EOS byte is sent */
        set-eot = yes                   /* Assert EOI with last byte on writes */

}


device {
        minor = 0               /* minor number for interface board this device is connected to */
        name = "KEITHLEY2015"   /* device mnemonic */
        pad = 16                        /* The Primary Address */
        sad = 0                 /* Secondary Address */
        eos = 0xa               /* EOS Byte, 0xa is newline and 0xd is carriage return */
        set-reos = yes          /* Terminate read if EOS */
        set-bin = yes           /* Compare EOS 8-bit */
        set-xeos = no           /* Assert EOI whenever EOS byte is sent */
        set-eot = yes           /* Assert EOI with last byte on writes */
}

 

Offline TiN

  • Super Contributor
  • ***
  • Posts: 4543
  • Country: ua
    • xDevs.com
I had similar issues with python binding to linux-gpib with HPAK 4142B. ibtest was working fine, but python app was giving timeouts. Adding \n in write strings fixed the problem.
Tested on both RPI1 and RPI3 with NI GPIB-HS.

I'm still having issue with linux-gpib + python hanging from time to time with NI USB-GPIB-HS.
YouTube | Metrology IRC Chat room | Let's share T&M documentation? Upload! No upload limits for firmwares, photos, files.
 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
I had similar issues with python binding to linux-gpib with HPAK 4142B. ibtest was working fine, but python app was giving timeouts. Adding \n in write strings fixed the problem.
Tested on both RPI1 and RPI3 with NI GPIB-HS.

I'm still having issue with linux-gpib + python hanging from time to time with NI USB-GPIB-HS.

I haven't experienced any hangups with the Agilent/Beiming USB adapter.
I occationally see a few Kernel driver errors , but they don't cause any noticeable effects.

/Bingo
 

Offline msraya

  • Supporter
  • ****
  • Posts: 107
  • Country: es
  • EA7EE
Hello all!!

After much headache installing and configuring linux-gpib in Raspy2 i succeeded at it  |O

So, my compilation of linux-gpib was not working because a silly problem with svnversion, and after take care of this, the ibtest program doesn't worked well... Nothing strange in linux  :-//

However, the python library is working well, and I've been able to program my Keithley 2015 without problem... I not try serious programing in python yet...

I use the configuration files from Bingo user, linux-4.4.0-1-rp2 kernel, linux-gpib.4.0.3 last version and a not fake Agilent 82357B USB-GPIB Adapter.

Thank You all users that contribute to make this possible...

By the way the python gpib module is lacking documentation..

P.D: I just installed python-ivi and It is working well with my Keithley 2015, I changed init to no send clear instruction that in my setup it timeout..

Manuel

« Last Edit: August 03, 2016, 07:30:17 pm by msraya »
 

Offline Assafl

  • Frequent Contributor
  • **
  • Posts: 600
Hi -

Did you ever figure out what caused the iberr 14?

I am pulling hair trying to resolve it. Tried Ubuntu, tried the Metrology distribution, tried reinstalling again... Works a charm on Windows... an Agilent 82357B (not a clone).

Is it just an RPi2 issue? 

Assaf
 

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
I just tried to build linux-gpib under Raspbian Jessie
I also get the error 14 , something is broken in the new kernels.

That worked under Raspbian Wheezy on my Raspi V1


See here for more info
https://www.eevblog.com/forum/metrology/raspberry-pi23-logging-platform-for-voltnuts/msg1092798/#msg1092798

/Bingo
 

Offline Assafl

  • Frequent Contributor
  • **
  • Posts: 600
Thank you for testing this.
 

Offline niner_007

  • Frequent Contributor
  • **
  • Posts: 256
  • Country: us
I have it working with Raspbian Stretch on a Pi 3 B+, I did not have to recompile the kernel or patch it in any way (so you shouldn't have to touch that either).
 

Offline bitseeker

  • Super Contributor
  • ***
  • Posts: 9057
  • Country: us
  • Lots of engineer-tweakable parts inside!
Wow, it's been a while since there was any activity in this thread. Thanks for the status update, niner. Good to hear that linux-gpib is better supported in Raspbian now.
TEA is the way. | TEA Time channel
 

Offline Zigzar

  • Newbie
  • Posts: 8
  • Country: gb
Heyo,

I know this is a dead thread, but any help would be great.

I'm using a raspberry Pi 3 with the latest version of raspbian.

When ever I try to use "sudo modprobe agilent_82357a"

this error throws up "modprobe: FATAL: Module agilent_82357a not found in directory /lib/modules/4.14.71-v7+"

any suggestions?

Thanks.
« Last Edit: November 20, 2018, 02:37:15 pm by Zigzar »
 

Offline alm

  • Super Contributor
  • ***
  • Posts: 2881
  • Country: 00
That would mean the linux-gpib modules were not installed for the kernel you are currently running. Any errors during "make install"? Did you update the kernel or reboot to a different kernel version after installing linux-gpib?

Offline Zigzar

  • Newbie
  • Posts: 8
  • Country: gb
Doesn't appear to be!

According to the post a bit above, I shouldn't have to change the kernel?

Thanks for any help!

This is the output when i run make install:

Code: [Select]
pi@raspberrypi:~/linux-gpib/linux-gpib-code/linux-gpib-user $ sudo make install
Making install in include
make[1]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/include'
Making install in gpib
make[2]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/include/gpib'
make[3]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/include/gpib'
make[3]: Nothing to be done for 'install-exec-am'.
 /bin/mkdir -p '/usr/local/include/gpib'
 /usr/bin/install -c -m 644 gpib_user.h ib.h '/usr/local/include/gpib'
make[3]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/include/gpib'
make[2]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/include/gpib'
make[2]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/include'
make[3]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/include'
make[3]: Nothing to be done for 'install-exec-am'.
make[3]: Nothing to be done for 'install-data-am'.
make[3]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/include'
make[2]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/include'
make[1]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/include'
Making install in lib
make[1]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/lib'
make  install-recursive
make[2]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/lib'
Making install in .
make[3]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/lib'
make[4]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/lib'
 /bin/mkdir -p '/usr/local/lib'
 /bin/bash ../libtool   --mode=install /usr/bin/install -c   libgpib.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libgpib.so.0.3.0 /usr/local/lib/libgpib.so.0.3.0
libtool: install: (cd /usr/local/lib && { ln -s -f libgpib.so.0.3.0 libgpib.so.0 || { rm -f libgpib.so.0 && ln -s libgpib.so.0.3.0 libgpib.so.0; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libgpib.so.0.3.0 libgpib.so || { rm -f libgpib.so && ln -s libgpib.so.0.3.0 libgpib.so; }; })
libtool: install: /usr/bin/install -c .libs/libgpib.lai /usr/local/lib/libgpib.la
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
 /bin/mkdir -p '/usr/local/lib/pkgconfig'
 /usr/bin/install -c -m 644 libgpib.pc '/usr/local/lib/pkgconfig'
make[4]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/lib'
make[3]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/lib'
Making install in gpib_config
make[3]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/lib/gpib_config'
make[4]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/lib/gpib_config'
 /bin/mkdir -p '/usr/local/sbin'
  /bin/bash ../../libtool   --mode=install /usr/bin/install -c gpib_config '/usr/local/sbin'
libtool: install: /usr/bin/install -c .libs/gpib_config /usr/local/sbin/gpib_config
make[4]: Nothing to be done for 'install-data-am'.
make[4]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/lib/gpib_config'
make[3]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/lib/gpib_config'
make[2]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/lib'
make[1]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/lib'
Making install in drivers
make[1]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/drivers'
make[2]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/drivers'
make[2]: Nothing to be done for 'install-exec-am'.
make  install-data-hook
make[3]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/drivers'
test -e /usr/local/etc/gpib.conf || \
/usr/bin/install -c -m 644 -D ../util/templates/gpib.conf /usr/local/etc/gpib.conf
make[3]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/drivers'
make[2]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/drivers'
make[1]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/drivers'
Making install in examples
make[1]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/examples'
make[2]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/examples'
 /bin/mkdir -p '/usr/local/bin'
  /bin/bash ../libtool   --mode=install /usr/bin/install -c ibtest ibterm '/usr/local/bin'
libtool: install: /usr/bin/install -c .libs/ibtest /usr/local/bin/ibtest
libtool: install: /usr/bin/install -c .libs/ibterm /usr/local/bin/ibterm
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/examples'
make[1]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/examples'
Making install in test
make[1]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/test'
make[2]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/test'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/test'
make[1]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/test'
Making install in doc
make[1]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/doc'
make[2]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/doc'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/doc'
make[1]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/doc'
Making install in language
make[1]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/language'
Making install in python
make[2]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/language/python'
make[3]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/language/python'
make[3]: Nothing to be done for 'install-exec-am'.
/usr/bin/python setup.py install --prefix=/usr/local
running install
running build
running build_py
running build_ext
running install_lib
copying build/lib.linux-armv7l-2.7/Gpib.py -> /usr/local/lib/python2.7/dist-packages
copying build/lib.linux-armv7l-2.7/gpib.so -> /usr/local/lib/python2.7/dist-packages
byte-compiling /usr/local/lib/python2.7/dist-packages/Gpib.py to Gpib.pyc
running install_egg_info
Writing /usr/local/lib/python2.7/dist-packages/gpib-1.0-py2.7.egg-info
make[3]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/language/python'
make[2]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/language/python'
make[2]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/language'
make -C perl all
make[3]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/language/perl'
Running Mkbootstrap for LinuxGpib ()
chmod 644 "LinuxGpib.bs"
Manifying 1 pod document
make[3]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/language/perl'
make[3]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/language'
make[3]: Nothing to be done for 'install-exec-am'.
make[3]: Nothing to be done for 'install-data-am'.
make[3]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/language'
make[2]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/language'
make[1]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/language'
Making install in usb
make[1]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/usb'
Making install in agilent_82357a
make[2]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/usb/agilent_82357a'
make[3]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/usb/agilent_82357a'
make[3]: Nothing to be done for 'install-exec-am'.
/bin/sed -e 's,[@]sbindir[@],/usr/local/sbin,g' -e 's,[@]datadir[@],/usr/local/share,g' -e 's,[@]hotplug_usb_conf_dir[@],/usr/local/etc/hotplug/usb,g' < ./99-agilent_82357a.rules.in >99-agilent_82357a.rules
/bin/sed -e 's,[@]sbindir[@],/usr/local/sbin,g' -e 's,[@]datadir[@],/usr/local/share,g' -e 's,[@]hotplug_usb_conf_dir[@],/usr/local/etc/hotplug/usb,g' < ./agilent_82357a.in >agilent_82357a
test -e /usr/local/etc/hotplug/usb/agilent_82357a ||\
/usr/bin/install -c -D agilent_82357a /usr/local/etc/hotplug/usb/agilent_82357a
test -e /usr/local/etc/hotplug/usb/agilent_82357a.usermap ||\
/usr/bin/install -c -m 644 -D ./agilent_82357a.usermap /usr/local/etc/hotplug/usb/agilent_82357a.usermap
/usr/bin/install -c -d /usr/local/share/usb/agilent_82357a
test -d /usr/local/etc/udev/rules.d && test -e /usr/local/etc/udev/rules.d/99-agilent_82357a.rules ||\
/usr/bin/install -c -m 644 -D 99-agilent_82357a.rules /usr/local/etc/udev/rules.d/99-agilent_82357a.rules
make[3]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/usb/agilent_82357a'
make[2]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/usb/agilent_82357a'
Making install in ni_usb_gpib
make[2]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/usb/ni_usb_gpib'
make[3]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/usb/ni_usb_gpib'
make[3]: Nothing to be done for 'install-exec-am'.
/bin/sed -e 's,[@]sbindir[@],/usr/local/sbin,g' -e 's,[@]datadir[@],/usr/local/share,g' -e 's,[@]hotplug_usb_conf_dir[@],/usr/local/etc/hotplug/usb,g' < ./99-ni_usb_gpib.rules.in >99-ni_usb_gpib.rules
/bin/sed -e 's,[@]sbindir[@],/usr/local/sbin,g' -e 's,[@]datadir[@],/usr/local/share,g' -e 's,[@]hotplug_usb_conf_dir[@],/usr/local/etc/hotplug/usb,g' < ./ni_usb_gpib.in >ni_usb_gpib
test -e /usr/local/etc/hotplug/usb/ni_usb_gpib ||\
/usr/bin/install -c -D ni_usb_gpib /usr/local/etc/hotplug/usb/ni_usb_gpib
test -e /usr/local/etc/hotplug/usb/ni_usb_gpib.usermap ||\
/usr/bin/install -c -m 644 -D ./ni_usb_gpib.usermap /usr/local/etc/hotplug/usb/ni_usb_gpib.usermap
/usr/bin/install -c -d /usr/local/share/usb/ni_usb_gpib
test -d /usr/local/etc/udev/rules.d && test -e /usr/local/etc/udev/rules.d/99-ni_usb_gpib.rules ||\
/usr/bin/install -c -m 644 -D 99-ni_usb_gpib.rules /usr/local/etc/udev/rules.d/99-ni_usb_gpib.rules
make[3]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/usb/ni_usb_gpib'
make[2]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/usb/ni_usb_gpib'
make[2]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/usb'
make[3]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/usb'
make[3]: Nothing to be done for 'install-exec-am'.
test -d /usr/local/etc/udev/rules.d && test -e /usr/local/etc/udev/rules.d/99-gpib-generic.rules ||\
/usr/bin/install -c -m 644 -D ./99-gpib-generic.rules /usr/local/etc/udev/rules.d/99-gpib-generic.rules
make[3]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/usb'
make[2]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/usb'
make[1]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user/usb'
make[1]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user'
make[2]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user'
make[1]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-user'
 

Offline alm

  • Super Contributor
  • ***
  • Posts: 2881
  • Country: 00
That's the user part (application support). What about the kernel part (hardware drivers)? You also need to run bootstrap ... make install there.

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1988
  • Country: dk
What version of linux-gpib are you using ?

I think the latest , at least SVN. Has been modified quite a lot to make a totally new kernel/userspace layer.
That's quite new software

/Bingo
 

Offline alm

  • Super Contributor
  • ***
  • Posts: 2881
  • Country: 00
Not just SVN, also the latest release (4.2.0). Aren't the current changes mostly about moving things around, rather than about substantial changes?

The bottom line is that you need to install both the user and kernel parts. Looks like the installation instructions for each are similar (bootstrap, configure, make, make install). So try doing those steps (as described in the first post) in the linux-gpib-kernel directory now, and then continue with depmod etc.

Offline Zigzar

  • Newbie
  • Posts: 8
  • Country: gb
Installing the kernel parts seems to be having problems.

./bootstrap :
Code: [Select]
pi@raspberrypi:~/linux-gpib/linux-gpib-code/linux-gpib-kernel $ sudo ./bootstrap
configure.ac:19: installing './config.guess'
configure.ac:19: installing './config.sub'
configure.ac:7: installing './install-sh'
configure.ac:7: installing './missing'

./configure :
Code: [Select]
pi@raspberrypi:~/linux-gpib/linux-gpib-code/linux-gpib-kernel $ 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 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.14.79-v7+/build/ does not exist.  Specify using --with-linux-srcdir=DIR.
configure: WARNING: Kernel source tree at /lib/modules/4.14.79-v7+/build/ is not configured.  Copy the
appropriate configuration file to /lib/modules/4.14.79-v7+/build//.config and then run 'make oldconfig'
in the kernel source directory.
ok
checking Linux kernel compile flags... make: *** /lib/modules/4.14.79-v7+/build/: No such file or directory.  Stop.
configure: WARNING: Failed to get compile flags from Linux kernel directory.
ok
checking for depmod... /sbin/depmod
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating drivers/Makefile
config.status: creating config.h

make :
Code: [Select]
pi@raspberrypi:~/linux-gpib/linux-gpib-code/linux-gpib-kernel $ sudo make
make  all-recursive
make[1]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-kernel'
Making all in drivers
make[2]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-kernel/drivers'
make -C /lib/modules/4.14.79-v7+/build/ V=1 modules\
CC=" -I/home/pi/linux-gpib/linux-gpib-code/linux-gpib-kernel -I/home/pi/linux-gpib/linux-gpib-code/linux-gpib-kernel/compat/include" \
CONFIG_GPIB_ISA="no" \
SUBDIRS="/home/pi/linux-gpib/linux-gpib-code/linux-gpib-kernel/drivers/gpib"
make[3]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-kernel/drivers'
make[3]: *** /lib/modules/4.14.79-v7+/build/: No such file or directory.  Stop.
make[3]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-kernel/drivers'
Makefile:416: recipe for target 'all-local' failed
make[2]: [all-local] Error 2 (ignored)
make[2]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-kernel/drivers'
make[2]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-kernel'
make[2]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-kernel'
make[1]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-kernel'

make install :
Code: [Select]
pi@raspberrypi:~/linux-gpib/linux-gpib-code/linux-gpib-kernel $ sudo make install
Making install in drivers
make[1]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-kernel/drivers'
make -C /lib/modules/4.14.79-v7+/build/ V=1 modules\
CC=" -I/home/pi/linux-gpib/linux-gpib-code/linux-gpib-kernel -I/home/pi/linux-gpib/linux-gpib-code/linux-gpib-kernel/compat/include" \
CONFIG_GPIB_ISA="no" \
SUBDIRS="/home/pi/linux-gpib/linux-gpib-code/linux-gpib-kernel/drivers/gpib"
make[2]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-kernel/drivers'
make[2]: *** /lib/modules/4.14.79-v7+/build/: No such file or directory.  Stop.
make[2]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-kernel/drivers'
Makefile:416: recipe for target 'all-local' failed
make[1]: [all-local] Error 2 (ignored)
make[2]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-kernel/drivers'
make[2]: Nothing to be done for 'install-exec-am'.
make  install-data-hook
make[3]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-kernel/drivers'
make -C /lib/modules/4.14.79-v7+/build/ V=1 modules_install\
CC=" -I/home/pi/linux-gpib/linux-gpib-code/linux-gpib-kernel -I/home/pi/linux-gpib/linux-gpib-code/linux-gpib-kernel/compat/include" \
SUBDIRS="/home/pi/linux-gpib/linux-gpib-code/linux-gpib-kernel/drivers/gpib" INSTALL_MOD_DIR="gpib"
make[4]: Entering directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-kernel/drivers'
make[4]: *** /lib/modules/4.14.79-v7+/build/: No such file or directory.  Stop.
make[4]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-kernel/drivers'
Makefile:427: recipe for target 'install-data-hook' failed
make[3]: *** [install-data-hook] Error 2
make[3]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-kernel/drivers'
Makefile:348: recipe for target 'install-data-am' failed
make[2]: *** [install-data-am] Error 2
make[2]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-kernel/drivers'
Makefile:303: recipe for target 'install-am' failed
make[1]: *** [install-am] Error 2
make[1]: Leaving directory '/home/pi/linux-gpib/linux-gpib-code/linux-gpib-kernel/drivers'
Makefile:364: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1

If it wasn't already painfully obvious, i'm a complete newbie to most of this stuff!
So the help is really appreciated.

Thanks!
 

Offline alm

  • Super Contributor
  • ***
  • Posts: 2881
  • Country: 00
I won't be able to give you step-by-step instructions, since I don't use a Raspberry PI. You are trying to build drivers for the specific kernel you are currently running. Linux is developed with the idea that all drivers will be integrated in the mainline kernel. There is no generic interface that allows the same driver binaries to work on different versions / machines, like the Windows Driver Model. You have to build the binary drivers from source for the exact version and configuration of the kernel you are running. For the drivers to be able to do this, they need headers of the kernel version that you are running.

First try if these instructions work: sudo apt-get install raspberrypi-kernel-headers. That make take quite a while. If that appears to succeed, try to run configure etc again for linux-gpib-kernel.

If that doesn't work, try option #2 from these instructions.
 
The following users thanked this post: Zigzar

Offline Zigzar

  • Newbie
  • Posts: 8
  • Country: gb
That worked!
Modprobe runs happily, thank you!

Now after I update the firmware with fxload twice, the adapter lights come on.

gpib_config is erroring out, like below:
Code: [Select]
pi@raspberrypi:~ $ sudo gpib_config
failed to configure boardtype: ni_pci
failed to configure board
main: Invalid argument

I copied the /etc/gpib.conf from above.
So looks like this:
Code: [Select]
interface {
        minor = 0                       /* board index, minor = 0 uses /dev/gpib0, minor = 1 uses /dev/gpib1, etc. */
        board_type = "agilent_82357a"   /* type of interface board being used */
        name = "agilent_82357b"
        master = yes                    /*interface board is system controller*/
        pad = 0                         /* primary address of interface */
        sad = 0                         /* secondary address of interface */
        timeout = T3s                   /* timeout for commands */
        eos = 0xa                       /* EOS Byte, 0xa is newline and 0xd is carriage return */
        set-reos = yes                  /* Terminate read if EOS */
        set-bin = yes                   /* Compare EOS 8-bit */
        set-xeos = no                   /* Assert EOI whenever EOS byte is sent */
        set-eot = yes                   /* Assert EOI with last byte on writes */

}

Any ideas?

As always, thank you so much for the help!
 

Offline z01z

  • Regular Contributor
  • *
  • Posts: 151
Please make sure you don't have an interface section with an 'ni_pci' board in your config file.
 

Offline alm

  • Super Contributor
  • ***
  • Posts: 2881
  • Country: 00
Great that you got the kernel driver working. Indeed, the reference to ni_pci is really odd, especially since the Pi doesn't even have a PCI bus. My guess is also a reference to ni_pcb somewhere in the config file. I don't think linux-gpib has more than just /etc/gpib.conf.

Offline MattSR

  • Regular Contributor
  • *
  • Posts: 95
  • Country: au
In Linux, you can search for files containing a text string using the following command:-

Code: [Select]
grep -R ni_pci
This will recursively search the current directory and any subdirectories for the string “ni_pci”.

Cheers,
Matt
 

Offline Zigzar

  • Newbie
  • Posts: 8
  • Country: gb
Heya,

So i'm looking in /etc and there doesn't appear to be a config file.

If i create one named gpib.conf and paste:

Code: [Select]
interface {
        minor = 0                       /* board index, minor = 0 uses /dev/gpib0, minor = 1 uses /dev/gpib1, etc. */
        board_type = "agilent_82357a"   /* type of interface board being used */
        name = "agilent_82357b"
        master = yes                    /*interface board is system controller*/
        pad = 0                         /* primary address of interface */
        sad = 0                         /* secondary address of interface */
        timeout = T3s                   /* timeout for commands */
        eos = 0xa                       /* EOS Byte, 0xa is newline and 0xd is carriage return */
        set-reos = yes                  /* Terminate read if EOS */
        set-bin = yes                   /* Compare EOS 8-bit */
        set-xeos = no                   /* Assert EOI whenever EOS byte is sent */
        set-eot = yes                   /* Assert EOI with last byte on writes */

}

I still get the same error?

Any suggestions?
 

Offline MiDi

  • Frequent Contributor
  • **
  • Posts: 600
  • Country: ua
What does lsusb say?
Did you follow TiNs guide?
This worked for me on rpi b+ about half a year back - despite the fact that I did shortcut with kernel-headers.
I recently got a pi 3, will test it asap...
« Last Edit: November 29, 2018, 01:04:20 am by MiDi »
 

Offline MiDi

  • Frequent Contributor
  • **
  • Posts: 600
  • Country: ua
You have to edit /usr/local/etc/gpib.conf, seems it changed location...
 

Offline picburner

  • Frequent Contributor
  • **
  • Posts: 500
  • Country: it
I also tried using the new linux-gpib 4.2.0 version with a pi3.
While with the old 4.1.0 I had no problems whatsoever with ni_gpib_usb_hs and with agilent 82357b,
with the new 4.2.0 I managed to make ni_gpib_hs work only and in root mode only (with 4.1.0 I had solved this with the
command "sudo usermod -a -G gpib pi" but it doesn't work anymore with 4.2.0).
Agilent 82357b doesn't seem to load the firmware with 4.2.0.
In practice I'm back to the good old 4.1.0 , it works!

P.S. Yes, the new location for gpib.conf is /usr/local/etc/gpib.conf
 

Offline Zigzar

  • Newbie
  • Posts: 8
  • Country: gb
Yes, the config file has moved!

After  editing the config file to the below, the ready LED is lit Green and it appears we're ready to go!

Code: [Select]
/***********************************************************************
                 GPIB.CONF IEEE488 library config file
                             -------------------

   copyright            : (C) 2002 by Frank Mori Hess
                          (C) 1994 by C.Schroeter
   email                : fmhess@users.sourceforge.net
 ***************************************************************************/
/***************************************************************************
 *   
 *   Syntax:
 *
 *         interface { ... } starts new interface board section
 *         device {...} device configuration
 *
 ***************************************************************************/

/* This section configures the configurable driver characteristics
 * for an interface board, such as board address, and interrupt level.
 * minor = 0 configures /dev/gpib0, minor = 1 configures /dev/gpib1, etc.
 */

interface {
        minor = 0                     /* board index, minor = 0 uses /dev/gpib0, minor = 1 uses /dev/gpib1, etc. */
        board_type = "agilent_82357a" /* type of interface board being used, agilent_82357a or ni_usb_b for NI USB-GPIB-HS */
        name = "agilent"               /* optional name, allows you to get a board descriptor using ibfind() */
        pad = 0                       /* primary address of interface             */
        sad = 0                       /* secondary address of interface           */
        timeout = T100s               /* timeout for commands, 100s for slow stuff like DMMs with filtering on */

/* settings for boards that lack plug-n-play capability */
        base = 0        /* Base io ADDRESS                  */
        irq  = 0        /* Interrupt request level */
        dma  = 0        /* DMA channel (zero disables)      */

        master = yes/* interface board is system controller */
eos = 0xa                       /* EOS Byte, 0xa is newline and 0xd is carriage return */
        set-reos = yes                  /* Terminate read if EOS */
        set-bin = yes                   /* Compare EOS 8-bit */
        set-xeos = no                   /* Assert EOI whenever EOS byte is sent */
        set-eot = yes                   /* Assert EOI with last byte on writes */
}

/* This is how you might set up a pcIIa board on /dev/gpib1, uncomment to use. */
/*******************
interface {
minor = 1
board_type = "pcIIa"
pad = 0
sad = 0
timeout = T3s

eos = 0x0a
set-reos = yes
set-bin = no

base = 0x2e1
irq  = 7
dma  = 1

master = yes
}
*********************/

/* Now the device sections define the device characteristics for each device.
 * These are only used if you want to open the device using ibfind() (instead
 * of ibdev() )
 */

device {
        minor = 0               /* minor number for interface board this device is connected to */
        name = "VNA"   /* device mnemonic */
        pad = 16                        /* The Primary Address */
        sad = 0                 /* Secondary Address */
        eos = 0xa               /* EOS Byte, 0xa is newline and 0xd is carriage return */
        set-reos = yes          /* Terminate read if EOS */
        set-bin = yes           /* Compare EOS 8-bit */
        set-xeos = no           /* Assert EOI whenever EOS byte is sent */
        set-eot = yes           /* Assert EOI with last byte on writes */
}

However, running Ibtest and trying to write a string, throws up this error:
Code: [Select]
Do you wish to open a (d)evice or an interface (b)oard?
(you probably want to open a device): d
enter primary gpib address for device you wish to open [0-30]: 0
trying to open pad = 0 on /dev/gpib0 ...
You can:
w(a)it for an event
write (c)ommand bytes to bus (system controller only)
send (d)evice clear (device only)
change remote (e)nable line (system controller only)
(g)o to standby (release ATN line, system controller only)
send (i)nterface clear (system controller only)
ta(k)e control (assert ATN line, system controller only)
get bus (l)ine status (board only)
go to local (m)ode
change end (o)f transmission configuration
(q)uit
(r)ead string
perform (s)erial poll (device only)
change (t)imeout on io operations
request ser(v)ice (board only)
(w)rite data string
send group e(x)ecute trigger (device only)
: w
enter a string to send to your device: *IDN?
sending string: *IDN?

gpib status is:
ibsta = 0xc100  < ERR TIMO CMPL >
iberr= 6
EABO 6: Operation aborted

ibcntl = 0

As always, thank you all for the help!
 

Offline picburner

  • Frequent Contributor
  • **
  • Posts: 500
  • Country: it
EABO indicates that an I/O operation has been cancelled for some reason, like a timeout.
Are you using ibtest in super user mode or as simple user?
 

Offline Zigzar

  • Newbie
  • Posts: 8
  • Country: gb
Yes, I believe so:

Code: [Select]
root@raspberrypi:/home/pi/linux-gpib/gpib_firmware-2008-08-10/agilent_82357a# ibtest
Do you wish to open a (d)evice or an interface (b)oard?
(you probably want to open a device): d
enter primary gpib address for device you wish to open [0-30]: 0
trying to open pad = 0 on /dev/gpib0 ...
You can:
w(a)it for an event
write (c)ommand bytes to bus (system controller only)
send (d)evice clear (device only)
change remote (e)nable line (system controller only)
(g)o to standby (release ATN line, system controller only)
send (i)nterface clear (system controller only)
ta(k)e control (assert ATN line, system controller only)
get bus (l)ine status (board only)
go to local (m)ode
change end (o)f transmission configuration
(q)uit
(r)ead string
perform (s)erial poll (device only)
change (t)imeout on io operations
request ser(v)ice (board only)
(w)rite data string
send group e(x)ecute trigger (device only)
: w
enter a string to send to your device: *IDN?
sending string: *IDN?

gpib status is:
ibsta = 0xc100  < ERR TIMO CMPL >
iberr= 6
EABO 6: Operation aborted

ibcntl = 0

Thanks,
Zigzar
 

Offline Zigzar

  • Newbie
  • Posts: 8
  • Country: gb
Dear All!

Turns out I needed to use gpib address 6!

Code: [Select]
Do you wish to open a (d)evice or an interface (b)oard?
(you probably want to open a device): d
enter primary gpib address for device you wish to open [0-30]: 6
trying to open pad = 6 on /dev/gpib0 ...
You can:
w(a)it for an event
write (c)ommand bytes to bus (system controller only)
send (d)evice clear (device only)
change remote (e)nable line (system controller only)
(g)o to standby (release ATN line, system controller only)
send (i)nterface clear (system controller only)
ta(k)e control (assert ATN line, system controller only)
get bus (l)ine status (board only)
go to local (m)ode
change end (o)f transmission configuration
(q)uit
(r)ead string
perform (s)erial poll (device only)
change (t)imeout on io operations
request ser(v)ice (board only)
(w)rite data string
send group e(x)ecute trigger (device only)
: w
enter a string to send to your device: *IDN?
sending string: *IDN?

gpib status is:
ibsta = 0x2100  < END CMPL >
iberr= 0

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

ibcntl = 29


Thank you all, I certainly owe you all a pint at some point in the future.
 

Offline MiDi

  • Frequent Contributor
  • **
  • Posts: 600
  • Country: ua
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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf