jarjuk / ebench

An extensible toolset to control e-instruments
15 stars 1 forks source link

Found a device whose serial number cannot be read... UTG962E does not work #1

Closed barrydegraaff closed 2 years ago

barrydegraaff commented 2 years ago

When I try and use ebUnit to get a screenshot, it does not work, it seems the software does not understand my device serial

ebUnit list_resources 
W0817 09:20:35.124661 140123448411968 usb.py:266] Found a device whose serial number cannot be read. The partial VISA resource name is: USB0::26198::2100::???::0::INSTR
('ASRL/dev/ttyS0::INSTR', 'ASRL/dev/ttyUSB0::INSTR')
ebUnit screen
E0817 09:20:52.068319 140081757009728 ebench.py:1118] No device found.
E0817 09:20:52.068435 140081757009728 ebench.py:1177] write 'Display:Data?' failed - self.instrument is None
E0817 09:20:52.271260 140081757009728 ebench.py:1118] No device found.
E0817 09:20:52.271696 140081757009728 ebench.py:1193] read_raw failed - self.instrument is None

from dmesg:

[ 8427.124706] usb 1-2.3: new full-speed USB device number 13 using xhci_hcd
[ 8427.219866] usb 1-2.3: New USB device found, idVendor=6656, idProduct=0834, bcdDevice= 1.00
[ 8427.219885] usb 1-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 8427.219894] usb 1-2.3: Product: UTG900E
[ 8427.219900] usb 1-2.3: Manufacturer: uni-trend
[ 8427.219906] usb 1-2.3: SerialNumber: 3836110621
jarjuk commented 2 years ago

Hello Barry,

It has been a while since I had to debug my installation.

Luckily I did take some notes, when I have problems,

TL;DR; My problems were resolved by adding udev rule. Your problem may be similar. Please refer emacs -org snippets below.

Hope that helps

BR, Jukka

*Notice iVendor NOT visible*
#+BEGIN_SRC bash :eval no-export :results output
lsusb -v -v -d 6656:0834  
#+END_SRC

#+begin_example

Bus 003 Device 040: ID 6656:0834  
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x6656
  idProduct          0x0834
  bcdDevice            1.00
  iManufacturer           1
  iProduct                2
  iSerial                 3
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          4
    bmAttributes         0xc0
      Self Powered
    MaxPower                2mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       254 Application Specific Interface
      bInterfaceSubClass      3 Test and Measurement
      bInterfaceProtocol      1 TMC
      iInterface              5
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
#+end_example

#+BEGIN_SRC bash :eval no-export :results output
ls /etc/udev/rules.d
#+END_SRC

#+RESULTS:
#+begin_example
49-stlinkv1.rules
49-stlinkv2-1.rules
49-stlinkv2.rules
49-stlinkv3.rules
56-hpmud.rules
59-smfp_samsung.rules
70-snap.core.rules
70-snap.foobar2000.rules
70-snap.gimp.rules
70-snap.gnome-calculator.rules
70-snap.gnome-characters.rules
70-snap.gnome-logs.rules
70-snap.gnome-system-monitor.rules
70-snap.pinta-james-carroll.rules
70-snap.sigrok-suite.rules
70-snap.webots.rules
99-jlink.rules
S99-2000S1.rules
#+end_example

#+BEGIN_SRC bash :eval no-export :results output :dir /sudo::
  #
  cat <<EOF > /etc/udev/rules.d/50-unit.rules
  SUBSYSTEM=="usb", ATTR{idVendor}=="6656", ATTR{idProduct}=="0834", MODE="0666"    
  EOF
#+END_SRC

#+RESULTS:

After

#+BEGIN_SRC bash :eval no-export :results output :dir /sudo::
ls /etc/udev/rules.d/50-*
cat /etc/udev/rules.d/50-unit.rules
#+END_SRC

#+RESULTS:
: /etc/udev/rules.d/50-unit.rules
: SUBSYSTEM=="usb", ATTR{idVendor}=="6656", ATTR{idProduct}=="0834", MODE="0666"    

*Notice iVendor visible*
#+BEGIN_SRC bash :eval no-export :results output
lsusb -v -v -d 6656:0834  
#+END_SRC

#+RESULTS:
#+begin_example

Bus 003 Device 041: ID 6656:0834  
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x6656
  idProduct          0x0834
  bcdDevice            1.00
  iManufacturer           1 uni-trend
  iProduct                2 UTG900
  iSerial                 3 1485061822
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          4 UTG900
    bmAttributes         0xc0
      Self Powered
    MaxPower                2mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       254 Application Specific Interface
      bInterfaceSubClass      3 Test and Measurement
      bInterfaceProtocol      1 TMC
      iInterface              5 UTG900
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
Device Status:     0x0002
  (Bus Powered)
  Remote Wakeup Enabled
#+end_example
barrydegraaff commented 2 years ago

Thanks the solution is:

https://techoverflow.net/2019/08/09/how-to-fix-pyvisa-found-a-device-whose-serial-number-cannot-be-read-the-partial-visa-resource-name-is-usb0-0instr/

groupadd usbusers
usermod -a -G usbusers ADD-YOUR-USERNAME

echo 'SUBSYSTEM=="usb", MODE="0666", GROUP="usbusers"' | tee /etc/udev/rules.d/99-usbusers.rules
# Try to reload - if that does not work, reboot!
udevadm control --reload
udevadm trigger

LOGOUT AND LOGIN AND TRY AGAIN