jnweiger / led-name-badge-ls32

Upload tool for an led name tag with USB-HID interface
GNU General Public License v2.0
230 stars 86 forks source link

Crash after first use #1

Closed muebau closed 5 years ago

muebau commented 5 years ago

The first use works fine, after that I get different errors:

Traceback (most recent call last):
  File "./led-badge-11x44.py", line 347, in <module>
    print("using [%s %s] bus=%d dev=%d" % (dev.manufacturer, dev.product, dev.bus, dev.address))
  File "/usr/lib/python3/dist-packages/usb/core.py", line 852, in manufacturer
    self._manufacturer = util.get_string(self, self.iManufacturer)
  File "/usr/lib/python3/dist-packages/usb/util.py", line 314, in get_string
    raise ValueError("The device has no langid")
ValueError: The device has no langid

dmsg is fine

[ 1623.818891] usb 3-2: new full-speed USB device number 24 using xhci_hcd
[ 1623.967869] usb 3-2: New USB device found, idVendor=0416, idProduct=5020, bcdDevice= 0.00
[ 1623.967873] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1623.967874] usb 3-2: Product: LS32 Custm HID
[ 1623.967876] usb 3-2: Manufacturer: LSicroelectronics
[ 1623.968925] input: LSicroelectronics LS32 Custm HID as /devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0/0003:0416:5020.0004/input/input28
[ 1623.969089] hid-generic 0003:0416:5020.0004: input,hidraw2: USB HID v1.10 Device [LSicroelectronics LS32 Custm HID] on usb-0000:00:14.0-2/input0
muebau commented 5 years ago

There may be some correlation with the power states of the USB bus. A USB hub may or may not help to solve some parts of the problem. I found it helps to use a different USB port (or hub) and disconnect the device after every use.

jnweiger commented 5 years ago

That is an error from within the USB library. Nothing that I can fix or workaround in my code. As you have mixed results depending on the power supply quality, I'd argue it is actually a hardware issue. Bad cables may also play a role here. Closing here. Please reopen if there is a suggestion what should be done from within my code.