Author Topic: [solved] Keysight 82357B with linux  (Read 1647 times)

0 Members and 2 Guests are viewing this topic.

Offline claudiux

  • Contributor
  • Posts: 8
  • Country: fr
[solved] Keysight 82357B with linux
« on: January 20, 2019, 04:58:09 pm »
Hello,

I am trying to get a 82357B GPIB/USB interface to work with linux using linux-gpib. I've already done that for this kind of device in the past. But with this new device I get a kernel error when I load the firmware on the device :
Code: [Select]
device descriptor read/64, error -110
The way I do is :
1. plug usb in, three LED light :
Code: [Select]
$uname -a
Linux waka 4.9.0-8-686-pae #1 SMP Debian 4.9.130-2 (2018-10-27) i686 GNU/Linux

$ lsusb | grep Age
Bus 001 Device 033: ID 0957:0718 Agilent Technologies, Inc.
Code: [Select]
# dmesg[ 3461.604020] usb 1-4: new high-speed USB device number 37 using ehci-pci
[ 3461.752384] usb 1-4: New USB device found, idVendor=0957, idProduct=0518
[ 3461.752390] usb 1-4: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 3461.778800] usb 1-4: USB disconnect, device number 37
[ 3463.548017] usb 1-4: new high-speed USB device number 38 using ehci-pci
[ 3463.696329] usb 1-4: New USB device found, idVendor=0957, idProduct=0518
[ 3463.696335] usb 1-4: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 3463.727620] usb 1-4: USB disconnect, device number 38
[ 3465.496022] usb 1-4: new high-speed USB device number 39 using ehci-pci
[ 3465.644910] usb 1-4: New USB device found, idVendor=0957, idProduct=0718
[ 3465.644917] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=5
[ 3465.644920] usb 1-4: Product: 82357B ()
[ 3465.644923] usb 1-4: Manufacturer: Agilent Technologies, Inc.
[ 3465.644925] usb 1-4: SerialNumber: MY56153375
[ 3465.645320] probe succeeded for path: usb-0000:00:10.4-4
Code: [Select]
$ lsmod | grep agi
agilent_82357a         24576  0
gpib_common            32768  1 agilent_82357a
usbcore               184320  5 usbhid,ehci_hcd,uhci_hcd,agilent_82357a,ehci_pci


2. Load the firmware with fxload:
Code: [Select]
# fxload -t fx2 -D /dev/bus/usb/001/039 -I /usr/share/usb/agilent_82357a/measat_releaseX1.8.hex
The fail LED is now ON, the two others are OFF. And the device is no more listed in lsusb.
And the messages of the kernel :
Code: [Select]
[ 3796.568275] usb 1-4: USB disconnect, device number 39
[ 3796.568362] agilent_82357a_driver_disconnect: exit
[ 3798.336021] usb 1-4: new high-speed USB device number 40 using ehci-pci
[ 3803.480023] usb 1-4: device descriptor read/64, error -110
[ 3819.096023] usb 1-4: device descriptor read/64, error -110
[ 3819.324029] usb 1-4: new high-speed USB device number 41 using ehci-pci
[ 3824.472022] usb 1-4: device descriptor read/64, error -110
[ 3840.088025] usb 1-4: device descriptor read/64, error -110
[ 3840.196042] usb usb1-port4: attempt power cycle
[ 3840.632017] usb 1-4: new high-speed USB device number 42 using ehci-pci
[ 3845.859229] usb 1-4: device descriptor read/8, error -110
[ 3851.235258] usb 1-4: device descriptor read/8, error -110
[ 3851.460021] usb 1-4: new high-speed USB device number 43 using ehci-pci
[ 3856.611283] usb 1-4: device descriptor read/8, error -110
[ 3861.987306] usb 1-4: device descriptor read/8, error -110
[ 3862.092043] usb usb1-port4: unable to enumerate USB device
[ 3862.348027] usb 3-2: new full-speed USB device number 18 using uhci_hcd

So here I can't load the firmware a second time because the device is not seen by the kernel.  I've tried on two machines and get the same error. I don't have a window PC to test.
Does anyone had this error before ? (device descriptor read/64, error -110).

Thanks for any advice.  ;)
« Last Edit: January 20, 2019, 09:40:55 pm by claudiux »
 

Online MarkL

  • Supporter
  • ****
  • Posts: 1685
  • Country: us
Re: Keysight 82357B with linux
« Reply #1 on: January 20, 2019, 08:43:53 pm »
It looks like the firmware has already loaded successfully by running fxload twice.

You would not see "SerialNumber: MY56153375" if the second fxload was not successful.  Also, idProduct=0518 changes to idProduct=0718 after the second fxload.  All three LEDs would normally be lit at this point, which is what you're seeing.

In this state, it's time for "gpib_config --minor 0" (NOT fxload).  After that, only the green READY LED should be lit and the adapter is ready.

I tried running fxload three times like you seem to be doing, and I get the same single FAIL LED, and the same "device descriptor" errors.

You shouldn't need to manually run fxload anyway.  Your hotplug script, /etc/hotplug/usb/agilent_82357a, should be doing everything for you, including the gpib_config.
 

Online MarkL

  • Supporter
  • ****
  • Posts: 1685
  • Country: us
Re: Keysight 82357B with linux
« Reply #2 on: January 20, 2019, 08:54:54 pm »
If it's of any help, here's my /etc/hotplug/usb/agilent_82357a, modified from the 4.0.2 linux-gpib distribution.  It appends debug output endlessly to /tmp/hotplug.log.  Change it to /dev/null if you don't want it the log building up forever.

This runs on CentOS 6.8, kernel 2.6.32-504.30.3.el6.x86_64, which is fairly old.  YMMV.

Code: [Select]
#!/bin/sh

exec >> /tmp/hotplug.log 2>&1
echo ""
date
echo "log output from $0"
echo "args: $*"

# echo "not doing anything (test)"
# exit

echo "PATH=$PATH"

GPIB_CONFIG_OPTIONS="--minor 0"
DATADIR=/usr/share
FXLOAD=fxload
FXLOAD_OPTIONS=

export PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin
FIRMWARE=

echo "PATH=$PATH"

# pre-renumeration device IDs
case $PRODUCT in
# 82357a with firmware already loaded
957/107/*)
        echo "detected 82357a with firmware already loaded"
        echo "running: gpib_config $GPIB_CONFIG_OPTIONS"
gpib_config $GPIB_CONFIG_OPTIONS
;;

# 82357a without firmware
957/7/*)
        echo "detected 82357a without firmware"
FIRMWARE=$DATADIR/usb/agilent_82357a/82357a_fw.hex
;;

# 82357b with firmware already loaded
957/718/*)
        echo "detected 82357b with firmware already loaded"
        echo "running: gpib_config $GPIB_CONFIG_OPTIONS"
gpib_config $GPIB_CONFIG_OPTIONS
;;

# 82357b without firmware
957/518/*)
        echo "detected 82357b without firmware"
FIRMWARE=$DATADIR/usb/agilent_82357a/measat_releaseX1.8.hex
FXLOAD_OPTIONS="-t fx2"
;;

esac


# quit unless we were called to download some firmware
if [ "$FIRMWARE" = "" ]; then
    # OR:  restructure to do other things for
    # specific post-renumeration devices
    exit 0
fi

echo "selected FIRMWARE=$FIRMWARE"

# missing firmware?
if [ ! -r $FIRMWARE ]; then
    if [ -x /usr/bin/logger ]; then
/usr/bin/logger -t $0 "missing $FIRMWARE for $PRODUCT ??"
    fi
    exit 1
fi

echo "scanning for fxload..."
# missing fxload?
if ! which $FXLOAD; then
    if [ -x /usr/bin/logger ]; then
/usr/bin/logger -t $0 "missing $FXLOAD ??"
    fi
    exit 1
fi

echo "fxload found."

if [ -x /usr/bin/logger ]; then
    /usr/bin/logger -t $0 "load $FIRMWARE for $PRODUCT to $DEVICE"
fi

echo DEVICE: $DEVICE
echo DEVNAME: $DEVNAME

echo running: $FXLOAD -D $DEVNAME $FXLOAD_OPTIONS -I $FIRMWARE

$FXLOAD -D $DEVNAME $FXLOAD_OPTIONS -I $FIRMWARE

exit
 
The following users thanked this post: claudiux

Offline claudiux

  • Contributor
  • Posts: 8
  • Country: fr
Re: Keysight 82357B with linux
« Reply #3 on: January 20, 2019, 09:39:49 pm »
Great  :-+

I didn't notice the change of IdProduct in the messages  |O

I've used linux-gpib for a long time on Debian and used to load the firmware twice for the 82357B and once for the 82357A ! I've never seen this hotplug script before ...
Things have changed, the firmware is loaded by this script and gpib.conf is now in /usr/local/etc (it was in /etc/ before) ...

Well, all works fine now. Thanks for your help !  :-+ I will try youtr modified script tomorrow



 
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf