Re: GPIB-USB-HS not working: unexpected data

dave penkler <[email protected]> Wed, 23 Feb 2022 17:36:03 +0100
Newsgroups gmane.linux.hardware.gpib.general
Message-ID <CAL=kjP3QxxwBQiu1EmC=+qMg1-8cCa32Xbz6ho_JEsisRj95_Q@mail.gmail.com>
Hi Mathias,
I am afraid you may have a clone, in your dmesg output  usb config
complains about a zero bInterval:

[502787.202833] usb 2-1.1: config 1 interface 0 altsetting 0 endpoint 0x81
has an invalid bInterval 0, changing to 7

We have seen this before  - see
https://sourceforge.net/p/linux-gpib/support-requests/29/?page=1
Known genuine NI adaptors have bInterval=2 on their interrupt endpoint

Currently we do not have a fix for this.
cheers,
-Dave



On Wed, 23 Feb 2022 at 16:49, Mathias Vermeire <[email protected]>
wrote:

> Hi all,
>
> I bought a NI GPIB-USB-HS and hoped that I could use it to control some
> old test equipment that I have gathered.
> I downloaded the linux-gpib-4.3.4.tar.gz and installed it. The kernel is
> "Linux 5.8.15-101.fc31.x86_64"
> I fixed the permissions for the /dev/gpib* devices and I am now in the
> process of figuring out the commands I need to control my gear.
> But sadly it is not working.
> I can do ibtest -> d -> 1 (1=address of a fluke 8842)
> Then I can send a clear command without a problem. (d)
> But nothing else works, no read, no write, All I get is "EDVR 0: OS error"
> I put debug on in the code and recompiled it, so now it generates some
> debug info.
> If there is anything that I can do to help this debugging let me know.
> You will find some debug info below.
>
> ===============
> /etc/gpib.conf:
> ================
>
> interface {
> minor = 0 /* board index, minor = 0 uses /dev/gpib0, minor = 1 uses
> /dev/gpib1, etc. */
> board_type = "ni_usb_b" /* type of interface board being used */
> name = "gpib0"
> pad = 0 /* primary address of interface             */
> sad = 0 /* secondary address of interface           */
> timeout = T3s /* timeout for commands */
>
> eos = 0xd
> /*eos = 0x0a EOS Byte, 0xa is newline and 0xd is carriage return */
> set-reos = yes /* Terminate read if EOS */
> set-bin = no /* Compare EOS 8-bit */
> set-xeos = no /* Assert EOI whenever EOS byte is sent */
> set-eot = yes /* Assert EOI with last byte on writes */
> base = 0 /* Base io ADDRESS                  */
> irq  = 0 /* Interrupt request level */
> dma  = 0 /* DMA channel (zero disables)      */
> master = yes
>
> }
>
> device {
> minor = 0
> name = "ps2520"
> pad = 6
> sad = 0
> }
>
> device {
>         minor = 0
>         name = "8842"
>         pad = 1
>         sad = 0
> timeout = T30s
> }
>
>
> some debug output:
> =======================
> plugging in the device:
> =======================
>
>
> [502786.886538] usb 2-1.1: new high-speed USB device number 77 using
> ehci-pci
> [502787.202833] usb 2-1.1: config 1 interface 0 altsetting 0 endpoint 0x81
> has an invalid bInterval 0, changing to 7
> [502787.203329] usb 2-1.1: New USB device found, idVendor=3923,
> idProduct=709b, bcdDevice= 1.01
> [502787.203331] usb 2-1.1: New USB device strings: Mfr=1, Product=2,
> SerialNumber=3
> [502787.203332] usb 2-1.1: Product: GPIB-USB-HS
> [502787.203333] usb 2-1.1: Manufacturer: National Instruments
> [502787.203334] usb 2-1.1: SerialNumber: 016BF077
> [502787.203740] ni_usb_gpib: probe succeeded for path: usb-0000:00:1d.0-1.1
> [502787.772124] gpib debug: pid 599752, gpib: opening minor 0
> [502787.772130] gpib debug: pid 599752, minor 0, ioctl 39,
> interface=ni_usb_b, use=2, onl=1
> [502787.772163] gpib debug: autospoll wait satisfied
> [502787.772164] gpib0: exiting autospoll thread
> [502787.772206] gpib debug: gpib: board offline
> [502787.772210] gpib debug: pid 599752, minor 0, ioctl 24,
> interface=ni_usb_b, use=2, onl=0
> [502787.772213] gpib debug: pid 599752, minor 0, ioctl 21,
> interface=ni_usb_b, use=2, onl=0
> [502787.772215] gpib debug: pid 599752, minor 0, ioctl 22,
> interface=ni_usb_b, use=2, onl=0
> [502787.772217] gpib debug: pid 599752, minor 0, ioctl 23,
> interface=ni_usb_b, use=2, onl=0
> [502787.772219] gpib debug: pid 599752, minor 0, ioctl 15,
> interface=ni_usb_b, use=2, onl=0
> [502787.772220] gpib debug: set primary addr to 0
> [502787.772222] gpib debug: pid 599752, minor 0, ioctl 16,
> interface=ni_usb_b, use=2, onl=0
> [502787.772223] gpib debug: set secondary addr to -96
> [502787.772225] gpib debug: pid 599752, minor 0, ioctl 32,
> interface=ni_usb_b, use=2, onl=0
> [502787.772227] gpib debug: pid 599752, minor 0, ioctl 43,
> interface=ni_usb_b, use=2, onl=0
> [502787.772236] gpib debug: pid 599752, minor 0, ioctl 39,
> interface=ni_usb_b, use=2, onl=0
> [502787.772240] ni_usb_gpib: attach
> [502787.772245] usb 2-1.1: bus 2 dev num 77 attached to gpib minor 0, NI
> usb interface 0
> [502787.772355] product id=0x709b
> [502787.772755] ni_usb_hs_wait_for_ready: board serial number is 0x16bf077
> [502787.774491] gpib debug:
> /opt/software/linux-gpib/linux-gpib-code/linux-gpib-kernel/drivers/gpib/ni_usb/ni_usb_gpib.c:
> ni_usb_hs_wait_for_ready exit retval=0
> [502787.776619] gpib debug: ni_usb_soft_update_status:
> need_monitoring_bits=0x10ff
> [502787.778397] gpib debug: ni_usb_soft_update_status: ni_usb_ibsta=0x0
> [502787.780250] gpib debug: gpib: board online
> [502787.780253] gpib debug: entering autospoll thread
> [502787.781149] gpib debug: pid 599752, gpib: opening minor 0
> [502787.781165] gpib debug: pid 599752, minor 0, ioctl 26,
> interface=ni_usb_b, use=3, onl=1
> [502787.781168] gpib debug: pid 599752, locked board 0 mutex
> [502787.781174] gpib debug: pid 599752, minor 0, ioctl 34,
> interface=ni_usb_b, use=3, onl=1
> [502787.781494] gpib debug: ni_usb_soft_update_status:
> need_monitoring_bits=0x0
> [502787.781499] gpib debug: ni_usb_soft_update_status: ni_usb_ibsta=0x0
> [502787.781514] gpib debug: pid 599752, minor 0, ioctl 5,
> interface=ni_usb_b, use=3, onl=1
> [502787.781869] gpib debug: ni_usb_soft_update_status:
> need_monitoring_bits=0x0
> [502787.781870] gpib debug: ni_usb_soft_update_status: ni_usb_ibsta=0x0
> [502787.782089] gpib debug: pid 599752, minor 0, ioctl 26,
> interface=ni_usb_b, use=3, onl=1
> [502787.782092] gpib debug: pid 599752, unlocked board 0 mutex
> [502787.782105] gpib debug: pid 599752, minor 0, ioctl 26,
> interface=ni_usb_b, use=3, onl=1
> [502787.782107] gpib debug: pid 599752, locked board 0 mutex
> [502787.782111] gpib debug: pid 599752, minor 0, ioctl 29,
> interface=ni_usb_b, use=3, onl=1
> [502787.782116] gpib debug: pid 599752, minor 0, ioctl 9,
> interface=ni_usb_b, use=3, onl=1
> [502787.782118] gpib debug: sending interface clear
> [502787.782325] gpib debug: ni_usb_soft_update_status:
> need_monitoring_bits=0x30
> [502787.782330] gpib debug: ni_usb_soft_update_status: ni_usb_ibsta=0x30
> [502787.783461] gpib debug: pid 599752, minor 0, ioctl 5,
> interface=ni_usb_b, use=3, onl=1
> [502787.783716] gpib debug: ni_usb_soft_update_status:
> need_monitoring_bits=0x30
> [502787.783724] gpib debug: ni_usb_soft_update_status: ni_usb_ibsta=0x30
> [502787.783978] gpib debug: pid 599752, minor 0, ioctl 26,
> interface=ni_usb_b, use=3, onl=1
> [502787.783981] gpib debug: pid 599752, unlocked board 0 mutex
> [502787.783995] gpib debug: pid 599752, minor 0, ioctl 26,
> interface=ni_usb_b, use=3, onl=1
> [502787.783998] gpib debug: pid 599752, locked board 0 mutex
> [502787.784007] gpib debug: pid 599752, minor 0, ioctl 29,
> interface=ni_usb_b, use=3, onl=1
> [502787.784014] gpib debug: pid 599752, minor 0, ioctl 10,
> interface=ni_usb_b, use=3, onl=1
> [502787.784211] gpib debug: ni_usb_soft_update_status:
> need_monitoring_bits=0x70
> [502787.784216] gpib debug: ni_usb_soft_update_status: ni_usb_ibsta=0x70
> [502787.784225] gpib debug: pid 599752, minor 0, ioctl 5,
> interface=ni_usb_b, use=3, onl=1
> [502787.785505] gpib debug: ni_usb_soft_update_status:
> need_monitoring_bits=0x70
> [502787.785512] gpib debug: ni_usb_soft_update_status: ni_usb_ibsta=0x70
> [502787.785730] gpib debug: pid 599752, minor 0, ioctl 26,
> interface=ni_usb_b, use=3, onl=1
> [502787.785734] gpib debug: pid 599752, unlocked board 0 mutex
> [502787.785749] gpib debug: pid 599752, gpib: closing minor 0
> [502787.786004] gpib debug: pid 599752, gpib: closing minor 0
>
>
>
>
>
>
> ==============
>     read:
> ==============
> : r
> enter maximum number of bytes to read [1024]: 100
> trying to read 100 bytes from device...
> received string: ''
> Number of bytes read: 0
> gpib status is:
> ibsta = 0x8100  < ERR CMPL >
> iberr= 0
> EDVR 0: OS error
>
> ibcntl = 5
>
>
> [502844.344638] gpib debug: pid 599797, gpib: opening minor 0
> [502844.344643] gpib debug: pid 599797, minor 0, ioctl 3,
> interface=ni_usb_b, use=2, onl=1
> [502844.344645] gpib debug: pid 599797, incrementing open count for pad 1,
> sad -96
> [502844.344647] gpib debug: pid 599797, minor 0, ioctl 26,
> interface=ni_usb_b, use=2, onl=1
> [502844.344649] gpib debug: pid 599797, locked board 0 mutex
> [502844.344651] gpib debug: pid 599797, minor 0, ioctl 5,
> interface=ni_usb_b, use=2, onl=1
> [502844.344880] gpib debug: ni_usb_soft_update_status:
> need_monitoring_bits=0x70
> [502844.344884] gpib debug: ni_usb_soft_update_status: ni_usb_ibsta=0x70
> [502844.345096] gpib debug: pid 599797, minor 0, ioctl 5,
> interface=ni_usb_b, use=2, onl=1
> [502844.345345] gpib debug: ni_usb_soft_update_status:
> need_monitoring_bits=0x70
> [502844.345348] gpib debug: ni_usb_soft_update_status: ni_usb_ibsta=0x70
> [502844.345598] gpib debug: pid 599797, minor 0, ioctl 26,
> interface=ni_usb_b, use=2, onl=1
> [502844.345599] gpib debug: pid 599797, unlocked board 0 mutex
> [502849.328222] gpib debug: pid 599797, minor 0, ioctl 26,
> interface=ni_usb_b, use=2, onl=1
> [502849.328225] gpib debug: pid 599797, locked board 0 mutex
> [502849.328230] gpib debug: pid 599797, minor 0, ioctl 19,
> interface=ni_usb_b, use=2, onl=1
> [502849.328235] gpib debug: pid 599797, minor 0, ioctl 29,
> interface=ni_usb_b, use=2, onl=1
> [502849.328239] gpib debug: pid 599797, minor 0, ioctl 29,
> interface=ni_usb_b, use=2, onl=1
> [502849.328243] gpib debug: pid 599797, minor 0, ioctl 5,
> interface=ni_usb_b, use=2, onl=1
> [502849.328533] gpib debug: ni_usb_soft_update_status:
> need_monitoring_bits=0x70
> [502849.328540] gpib debug: ni_usb_soft_update_status: ni_usb_ibsta=0x70
> [502849.328839] gpib debug: pid 599797, minor 0, ioctl 17,
> interface=ni_usb_b, use=2, onl=1
> [502849.328844] gpib debug: pid 599797, timeout set to 1000000 usec
> [502849.328858] gpib debug: pid 599797, minor 0, ioctl 102,
> interface=ni_usb_b, use=2, onl=1
> [502849.329060] gpib debug: ni_usb_soft_update_status:
> need_monitoring_bits=0x70
> [502849.329065] gpib debug: ni_usb_soft_update_status: ni_usb_ibsta=0x70
> [502849.329568] gpib debug: ni_usb_soft_update_status:
> need_monitoring_bits=0x70
> [502849.329581] gpib debug: ni_usb_soft_update_status: ni_usb_ibsta=0x70
> [502849.330936] gpib debug: ni_usb_soft_update_status:
> need_monitoring_bits=0x74
> [502849.330943] gpib debug: ni_usb_soft_update_status: ni_usb_ibsta=0x74
> [502849.330955] gpib debug: pid 599797, minor 0, ioctl 17,
> interface=ni_usb_b, use=2, onl=1
> [502849.330958] gpib debug: pid 599797, timeout set to 1000000 usec
> [502849.330962] gpib debug: pid 599797, minor 0, ioctl 100,
> interface=ni_usb_b, use=2, onl=1
> [502849.331218] gpib debug: ni_usb_soft_update_status:
> need_monitoring_bits=0x74
> [502849.331232] gpib debug: ni_usb_soft_update_status: ni_usb_ibsta=0x74
> [502849.331783] gpib debug: ni_usb_soft_update_status:
> need_monitoring_bits=0x74
> [502849.333574] gpib debug: ni_usb_soft_update_status: ni_usb_ibsta=0x20
> [502849.333904] gpib debug: ni_usb_soft_update_status:
> need_monitoring_bits=0x20
> [502849.333910] gpib debug: ni_usb_soft_update_status: ni_usb_ibsta=0x20
> [502849.334309]
> /opt/software/linux-gpib/linux-gpib-code/linux-gpib-kernel/drivers/gpib/ni_usb/ni_usb_gpib.c:
> parse_board_ibrd_readback: unexpected data: register write status id=0x4,
> expected 0x9
> [502849.334311]
> /opt/software/linux-gpib/linux-gpib-code/linux-gpib-kernel/drivers/gpib/ni_usb/ni_usb_gpib.c:
> parse_board_ibrd_readback: unexpected data: register write count=0,
> expected 2
> [502849.334313]
> /opt/software/linux-gpib/linux-gpib-code/linux-gpib-kernel/drivers/gpib/ni_usb/ni_usb_gpib.c:
> received unexpected termination block
> [502849.334315]  expected: 0x4 0x0 0x0 0x0
> [502849.334316]  received: 0x0 0x0 0x0 0x0
> [502849.334317] ni_usb_dump_raw_block:
>
> [502849.334319]  37
> [502849.334320]   0
> [502849.334320]   d
> [502849.334321]   a
> [502849.334322]   0
> [502849.334323]   0
> [502849.334324]   0
> [502849.334324]   0
>
> [502849.334325]   0
> [502849.334326]   0
> [502849.334326]   0
> [502849.334327]   0
> [502849.334328]   0
> [502849.334329]   0
> [502849.334329]   0
> [502849.334330]   0
>
> [502849.334331]   0
> [502849.334332]   0
> [502849.334332]   0
> [502849.334333]   0
> [502849.334334]   0
> [502849.334335]   0
> [502849.334335]   0
> [502849.334336]   0
>
> [502849.334337]   0
> [502849.334338]   0
> [502849.334339]   0
> [502849.334339]   0
> [502849.334340]   0
> [502849.334341]   0
> [502849.334342]   0
> [502849.334343]   0
>
> [502849.334344]  38
> [502849.334345]  20
> [502849.334345]  20
> [502849.334346]   0
> [502849.334347]  9e
> [502849.334348]  ff
> [502849.334349]  ff
> [502849.334350]  ff
>
> [502849.334351]  e0
> [502849.334352]   2
> [502849.334352]   0
> [502849.334353]   0
> [502849.334354]   4
> [502849.334355]   0
> [502849.334356]   0
> [502849.334357]   0
>
> [502849.334358]   0
> [502849.334359]   0
> [502849.334359]   0
> [502849.334360]   0
> [502849.334361]   0
> [502849.334362]   0
> [502849.334362]   0
> [502849.334363]   0
>
> [502849.334365]   0
>
> [502849.334368]
> /opt/software/linux-gpib/linux-gpib-code/linux-gpib-kernel/drivers/gpib/ni_usb/ni_usb_gpib.c:
> ni_usb_read: retval=-5 usb_bytes_read=48
> [502849.334383] gpib debug: pid 599797, minor 0, ioctl 5,
> interface=ni_usb_b, use=2, onl=1
> [502849.334562] gpib debug: ni_usb_soft_update_status:
> need_monitoring_bits=0x20
> [502849.334566] gpib debug: ni_usb_soft_update_status: ni_usb_ibsta=0x2020
> [502849.334815] gpib debug: pid 599797, minor 0, ioctl 5,
> interface=ni_usb_b, use=2, onl=1
> [502849.335055] gpib debug: ni_usb_soft_update_status:
> need_monitoring_bits=0x20
> [502849.335059] gpib debug: ni_usb_soft_update_status: ni_usb_ibsta=0x2020
> [502849.335334] gpib debug: pid 599797, minor 0, ioctl 26,
> interface=ni_usb_b, use=2, onl=1
> [502849.335337] gpib debug: pid 599797, unlocked board 0 mutex
> _______________________________________________
> Linux-gpib-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/linux-gpib-general
>

_______________________________________________
Linux-gpib-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-gpib-general