Find the answer to your Linux question:
Results 1 to 2 of 2
Hi All, I'm in a bit of a fix; I need to get data off of a Textronix 2432A DSO using a Softmark dongle. The scope has a GPIB bus ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2009
    Location
    Oregon
    Posts
    51

    Exclamation usbtmc, usb HID device, and Softmark GPIB dongle


    Hi All,
    I'm in a bit of a fix; I need to get data off of a Textronix 2432A DSO using a Softmark dongle.
    The scope has a GPIB bus on the back (only choice), I have sample code for reading the information from a TekScope using a functioning GPIB device under Un*x....

    I don't have a pci slot for a GPIB card, but I do have a Softmark GPIB to USB dongle --- with no Linux drivers. Softmark doesn't appear to support Linux... so, I am seeing if I can get it working using the Softmark Dongle and no information. (I am C/python/kernel hacking familiar...)

    The dongle itself comes up as a USB device, and lsusb -v tells me:
    Code:
    ...
    Interface Descriptor:
    ...
     bNumEndpoints           1
          bInterfaceClass         3 Human Interface Device
          bInterfaceSubClass      0 No Subclass
          bInterfaceProtocol      0 None
    ...
            HID Device Descriptor:
              bLength                 9
              bDescriptorType        33
              bcdHID               1.00
              bCountryCode            0 Not supported
              bNumDescriptors         1
              bDescriptorType        34 Report
              wDescriptorLength      52
             Report Descriptors: 
          Item(Global): Usage Page, data= [ 0xa0 0xff ] 65440
                                (null)
                Item(Local ): Usage, data= [ 0x01 ] 1
                                (null)
                Item(Main  ): Collection, data= [ 0x01 ] 1
                                Application
                Item(Local ): Usage, data= [ 0x02 ] 2
                                (null)
                Item(Main  ): Collection, data= [ 0x00 ] 0
                                Physical
                Item(Global): Usage Page, data= [ 0xa1 0xff ] 65441
                                (null)
                Item(Local ): Usage, data= [ 0x03 ] 3
                                (null)
                Item(Local ): Usage, data= [ 0x04 ] 4
                                (null)
                Item(Global): Logical Minimum, data= [ 0x80 ] 128
                Item(Global): Logical Maximum, data= [ 0x7f ] 127
                Item(Global): Physical Minimum, data= [ 0x00 ] 0
                Item(Global): Physical Maximum, data= [ 0xff ] 255
                Item(Global): Report Size, data= [ 0x08 ] 8
                Item(Global): Report Count, data= [ 0x02 ] 2
                Item(Main  ): Input, data= [ 0x02 ] 2
                                Data Variable Absolute No_Wrap Linear
                                Preferred_State No_Null_Position Non_Volatile Bitfield
                Item(Local ): Usage, data= [ 0x05 ] 5
                                (null)
                Item(Local ): Usage, data= [ 0x06 ] 6
                                (null)
                Item(Global): Logical Minimum, data= [ 0x80 ] 128
                Item(Global): Logical Maximum, data= [ 0x7f ] 127
                Item(Global): Physical Minimum, data= [ 0x00 ] 0
                Item(Global): Physical Maximum, data= [ 0xff ] 255
                Item(Global): Report Size, data= [ 0x08 ] 8
                Item(Global): Report Count, data= [ 0x08 ] 8
                Item(Main  ): Output, data= [ 0x08 ] 8
                                Data Array Absolute Wrap Linear
                                Preferred_State No_Null_Position Non_Volatile Bitfield
                Item(Main  ): End Collection, data=none
                Item(Main  ): End Collection, data=none
    
    ...
    As you can see, it claims to be an HID device, and not a test and measurement class device. Although it really should be usb488 device -- it doesn't report itself that way. For GPIB applications, the universal standard is supposed to be the kernel driver -- "usbtmc" for usb test and measurement "???control???"; in any event the driver can't find the Softmark card because... well it doesn't report itself right.

    I'm unfortunately in a hurry -- and doing Google searches all yesterday basically led to the conclusion that I won't get any help. So, if you are familiar with the HID protocol and how to query it, or with GPIB driver internals... I would appreciate any time saving tips....

    This is what I know:

    The linux kernel auto-configures the device as an HID device, although issuing 'dmesg' replies
    Code:
    "usbserial_generic 1-2:1.0: usb_probe_interface
    usbserial_generic 1-2:1.0: usb_probe_interface - got id
    usbhid 1-2:1.0: usb_probe_interface
    usbhid 1-2:1.0: usb_probe_interface - got id
    generic-usb 0003:0CB2:0014.0014: claimed by neither input, hiddev nor hidraw
    hub 4-0:1.0: state 7 ports 6 chg 0000 evt 0004"
    So, it isn't a true HID compatible device either (duh?) -- but only a faux HID. I made a /dev/udev/rules.d rule to bring it up as /dev/softmark for convenience. eg:

    SUBSYSTEM!="usb_device", ACTION!="add", GOTO="endGPIB"
    # SoftMark usb-gpib
    SYSFS{idVendor}=="0cb2", SYSFS{idProduct}=="0014", NAME="softmark", GROUP="users", MODE="0666"
    LABEL="endGPIB"

    When I do a cat "/dev/softmark | hexdump" , it replies with a binary string converted to a hexdump:

    0000000 0112 0110 0000 0800 mfrId=0cb2 prod=0014 bcdDevice?=0001 0201
    0000010 0100 0209 0022 0101 8000 0932 0004 0100
    0000020 0003 0000 2109 0100 0100 3422 0700 8105
    0000030 0603 0a00
    """

    Other than the italicized labels (my additions), I am not sure what the numbers all mean. I can't write to the device /dev/softmark although I can read from it. Edit: (It isn't permissions)

    What other information is there in this hexdump that people might know from the HID standard;

    Help!

    Edit: After tinkering with lsusb, and using lsusb -vvv I am able to determine that the Softmark GPIB interface chip is crippled and only capable of supporting one endpoint; "cheap??" I think it must be a mouse/keyboard type peripheral chip that runs at a slow rate.

    I have downloaded 'libhid' and installed it, which -- if the comments are correct -- will allow me to gain some insight into the types of data being passed.

    I'm not sure how Softmark transfers information out -- whether it is done by sending messages to the control endpoint, or whether it is encoded in the requests sent to the single data "in" endpoint.

    Unfortunately, I misplaced the windows software which runs the dongle, so I can't run it from wine -- which would make decoding this dongle trivial, if it runs.
    If anyone has a backup...or a dump of the USB messages sent from wine to a Softmark dongle. private message me, please!
    Thanks.
    Last edited by andrewr; 06-21-2011 at 05:23 PM. Reason: Getting technical specs for device number: 0003:0CB2:0014,000A

  2. #2
    Just Joined!
    Join Date
    May 2009
    Location
    Oregon
    Posts
    51
    I have found the hidlib to be a bit buggy.... during a parse/examination of USB devices it will cause them to cease functioning and although there is an example in the test directory for accessing the report structure, it is too simple for me to apply to the softmark dongle. However, it does indicate that the softmark dongle has both an output and input usage under the "report" heading.

    Looking around, I came across the existence of "/usr/include/linux/hiddev.h" which has an example at the end that is good enough to do all I want to do; it defines ioctl() macros for accessing an hid device.
    In order to operate an ioctl(), a file needs to be opened.... so I tried it on /dev/input/mouse0 to see if I could get the device's information. Although the program compiled and opened the device driver for the mouse, the ioctl caused an error "inappropriate ioctl for device."; Now a mouse is clearly an HID device, so could any one explain to me why I am getting this error?
    Edit: I didn't have the hidraw or hiddev interfaces compiled into my kernel.
    These drivers produce separate interfaces for quasi-hmi devices....
    I'm about to recompile.
    Last edited by andrewr; 06-22-2011 at 04:50 AM. Reason: additional information

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •