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

0 Members and 1 Guest are viewing this topic.

Offline bingo600Topic starter

  • Super Contributor
  • ***
  • Posts: 1977
  • 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: 1977
  • 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: 8515
  • 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: 1977
  • 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: 1977
  • 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: 1977
  • 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: 1977
  • 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: 1977
  • 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: 1977
  • 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: 1977
  • 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: 1977
  • 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: 1977
  • 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: 1977
  • 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...
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf