Difference between revisions of "UNI-T UT61D/Info"

From sigrok
Jump to navigation Jump to search
(lsusb)
 
(Fix bogus HID parts of the lsusb.)
Line 1: Line 1:
== How to get a proper lsusb ==
As [http://erste.de/UT61/index.html documented by Ralf Burger] the [[Multimeter_cables#UNI-T_UT-D04|UT-D04]] USBHID-to-serial cable (at least the one with WCH CH9325 chip) that comes with the UT61D multimeter has some issues on Linux. Apparently you need to [http://www.lesswatts.org/projects/devices-power-management/usb.php put it into a (auto)suspend first], before you can properly use it.
Here's a script (written by Ralf Burger) which you can run before using the chip and/or doing an lsusb:
<small>
$ '''cat suspend.HE2325U.sh'''
#!/bin/bash
for dat in /sys/bus/usb/devices/*; do
  if test -e $dat/manufacturer; then
    grep "WCH.CN" $dat/manufacturer > /dev/null && echo auto > ${dat}/power/level && echo 0 > ${dat}/power/autosuspend
  fi
done
</small>
== lsusb ==
== lsusb ==


Line 5: Line 21:
<small>
<small>
  $ '''lsusb -vvv'''
  $ '''lsusb -vvv'''
  Bus 003 Device 002: ID '''1a86:e008 QinHeng Electronics HID-based serial adapater'''
  Bus 003 Device 023: ID '''1a86:e008 QinHeng Electronics HID-based serial adapater'''
  Device Descriptor:
  Device Descriptor:
   bLength                18
   bLength                18
Line 17: Line 33:
   idProduct          0xe008 '''HID-based serial adapater'''
   idProduct          0xe008 '''HID-based serial adapater'''
   bcdDevice          11.00
   bcdDevice          11.00
   iManufacturer          1  
   iManufacturer          1 '''WCH.CN �'''
   iProduct                2  
   iProduct                2 '''USB to Serial'''
   iSerial                0  
   iSerial                0  
   bNumConfigurations      1
   bNumConfigurations      1
Line 38: Line 54:
       bNumEndpoints          2
       bNumEndpoints          2
       bInterfaceClass        3 '''Human Interface Device'''
       bInterfaceClass        3 '''Human Interface Device'''
       bInterfaceSubClass      0 No Subclass
       bInterfaceSubClass      0 '''No Subclass'''
       bInterfaceProtocol      0 None
       bInterfaceProtocol      0 '''None'''
       iInterface              0  
       iInterface              0  
         HID Device Descriptor:
         HID Device Descriptor:
Line 49: Line 65:
           bDescriptorType        34 Report
           bDescriptorType        34 Report
           wDescriptorLength      37
           wDescriptorLength      37
           Report Descriptor: (length is 99)
           Report Descriptor: (length is 37)
             Item(reserved): (null), data= [ 0x0f 0x00 0x00 0x00 ] 15
             Item(Global): Usage Page, data= [ 0xa0 0xff ] 65440
            Item(Main  ): (null), data=none
                            (null)
             Item(Main  ): (null), data=none
             Item(Local ): Usage, data= [ 0x01 ] 1
            Item(Main  ): (null), data=none
                            (null)
             Item(Main  ): (null), data= [ 0xd7 0x45 0xd5 0x00 ] 13977047
             Item(Main  ): Collection, data= [ 0x01 ] 1
             Item(reserved): (null), data= [ 0x00 0x00 0xe0 0x68 ] 1759510528
                            Application
            Item(Main  ): (null), data= [ 0x58 0xff ] 65368
             Item(Local ): Usage, data= [ 0x01 ] 1
             Item(reserved): (null), data= [ 0x00 0x00 0xc0 0x05 ] 96468992
                            (null)
             Item(Local ): (null), data= [ 0xd4 0x00 ] 212
             Item(Global): Logical Minimum, data= [ 0x00 ] 0
             Item(reserved): (null), data= [ 0x00 0x00 0x01 0x80 ] -2147418112
             Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
             Item(reserved): (null), data= [ 0xfb ] 251
             Item(Global): Report Size, data= [ 0x08 ] '''8'''
             Item(Main  ): (null), data=none
             Item(Global): Report Count, data= [ 0x08 ] '''8'''
            Item(Main  ): (null), data=none
             Item(Main  ): '''Input''', data= [ 0x02 ] 2
            Item(Main  ): (null), data=none
                            Data Variable Absolute No_Wrap Linear
            Item(Main  ): (null), data=none
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Main  ): (null), data=none
             Item(Local ): Usage, data= [ 0x02 ] 2
             Item(Local ): (null), data=none
                            (null)
            Item(Main  ): (null), data= [ 0x58 0xff ] 65368
             Item(Global): Report Size, data= [ 0x08 ] '''8'''
            Item(reserved): (null), data= [ 0x00 0x00 0xe0 0x68 ] 1759510528
             Item(Global): Report Count, data= [ 0x08 ] '''8'''
             Item(Main  ): (null), data= [ 0x58 0xff ] 65368
             Item(Main  ): '''Output''', data= [ 0x02 ] 2
             Item(reserved): (null), data= [ 0x00 0x00 0xe0 0x68 ] 1759510528
                            Data Variable Absolute No_Wrap Linear
             Item(Main  ): (null), data= [ 0x58 0xff ] 65368
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(reserved): (null), data= [ 0x00 0x00 0xe0 0x68 ] 1759510528
             Item(Local ): Usage, data= [ 0x03 ] 3
             Item(Main  ): (null), data= [ 0x58 0xff ] 65368
                            (null)
            Item(reserved): (null), data= [ 0x00 0x00 0xfe 0x68 ] 1761476608
             Item(Global): Report Size, data= [ 0x08 ] '''8'''
             Item(Main  ): (null), data= [ 0x58 0xff ] 65368
             Item(Global): Report Count, data= [ 0x05 ] '''5'''
             Item(reserved): (null), data= [ 0x00 0x00 0xdf 0x78 ] 2027880448
             Item(Main  ): '''Feature''', data= [ 0x02 ] 2
             Item(Main  ): (null), data= [ 0x58 0xff ] 65368
                            Data Variable Absolute No_Wrap Linear
            Item(reserved): (null), data= [ 0x00 0x00 0xe0 0x68 ] 1759510528
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Main  ): (null), data= [ 0x58 0xff ] 65368
             Item(Main  ): End Collection, data=none
            Item(reserved): (null), data= [ 0x00 0x00 0xdf 0x78 ] 2027880448
             Item(Main  ): (null), data= [ 0x58 0xff ] 65368
       Endpoint Descriptor:
       Endpoint Descriptor:
         bLength                7
         bLength                7
         bDescriptorType        5
         bDescriptorType        5
         bEndpointAddress    0x82  EP 2 IN
         bEndpointAddress    0x82  '''EP 2 IN'''
         bmAttributes            3
         bmAttributes            3
           Transfer Type            Interrupt
           Transfer Type            '''Interrupt'''
           Synch Type              None
           Synch Type              None
           Usage Type              Data
           Usage Type              Data
Line 95: Line 109:
         bLength                7
         bLength                7
         bDescriptorType        5
         bDescriptorType        5
         bEndpointAddress    0x02  EP 2 OUT
         bEndpointAddress    0x02  '''EP 2 OUT'''
         bmAttributes            3
         bmAttributes            3
           Transfer Type            Interrupt
           Transfer Type            '''Interrupt'''
           Synch Type              None
           Synch Type              None
           Usage Type              Data
           Usage Type              Data
         wMaxPacketSize    0x0008  1x 8 bytes
         wMaxPacketSize    0x0008  1x 8 bytes
         bInterval              5
         bInterval              5
  Device Status:    0x8d40
  Device Status:    0x0000
   (Bus Powered)
   (Bus Powered)
  Debug Mode
</small>
</small>

Revision as of 14:24, 9 September 2012

How to get a proper lsusb

As documented by Ralf Burger the UT-D04 USBHID-to-serial cable (at least the one with WCH CH9325 chip) that comes with the UT61D multimeter has some issues on Linux. Apparently you need to put it into a (auto)suspend first, before you can properly use it.

Here's a script (written by Ralf Burger) which you can run before using the chip and/or doing an lsusb:

$ cat suspend.HE2325U.sh
#!/bin/bash
for dat in /sys/bus/usb/devices/*; do
  if test -e $dat/manufacturer; then
    grep "WCH.CN" $dat/manufacturer > /dev/null && echo auto > ${dat}/power/level && echo 0 > ${dat}/power/autosuspend
  fi
done

lsusb

This is the lsusb ouput on Linux:

$ lsusb -vvv
Bus 003 Device 023: ID 1a86:e008 QinHeng Electronics HID-based serial adapater
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x1a86 QinHeng Electronics
  idProduct          0xe008 HID-based serial adapater
  bcdDevice           11.00
  iManufacturer           1 WCH.CN �
  iProduct                2 USB to Serial
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           41
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          4 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.00
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      37
          Report Descriptor: (length is 37)
            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= [ 0x01 ] 1
                            (null)
            Item(Global): Logical Minimum, data= [ 0x00 ] 0
            Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Report Count, data= [ 0x08 ] 8
            Item(Main  ): Input, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Local ): Usage, data= [ 0x02 ] 2
                            (null)
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Report Count, data= [ 0x08 ] 8
            Item(Main  ): Output, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Local ): Usage, data= [ 0x03 ] 3
                            (null)
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Report Count, data= [ 0x05 ] 5
            Item(Main  ): Feature, data= [ 0x02 ] 2
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Non_Volatile Bitfield
            Item(Main  ): End Collection, data=none
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               5
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               5
Device Status:     0x0000
  (Bus Powered)