Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CH546 usb.core.USBTimeoutError: [Errno 110] Operation timed out Segmentation fault #51

Open
ruben-herold opened this issue Dec 28, 2024 · 4 comments

Comments

@ruben-herold
Copy link

hi,

try to use it on CH546 devices on Ubuntu 24 ends in Segmentation fault:

Module usb.core detected
Type: 11x44
Libusb device initialized
Write using wch.cn - CH546 (bus=3 dev=61 endpoint=2) via libusb
Traceback (most recent call last):
  File "/home/ruben/daten/led-badge/led-name-badge-ls32/./led-badge-11x44.py", line 3, in <module>
    lednamebadge.main()
  File "/home/ruben/daten/led-badge/led-name-badge-ls32/lednamebadge.py", line 1135, in main
    LedNameBadge.write(buf, method, args.device_id)
  File "/home/ruben/daten/led-badge/led-name-badge-ls32/lednamebadge.py", line 828, in write
    write_method.write(buf)
  File "/home/ruben/daten/led-badge/led-name-badge-ls32/lednamebadge.py", line 539, in write
    self._write(buf)
  File "/home/ruben/daten/led-badge/led-name-badge-ls32/lednamebadge.py", line 664, in _write
    self.endpoint.write(buf[i * 64:i * 64 + 64])
  File "/usr/lib/python3/dist-packages/usb/core.py", line 408, in write
    return self.device.write(self, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/usb/core.py", line 989, in write
    return fn(
           ^^^
  File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line 855, in intr_write
    return self.__write(self.lib.libusb_interrupt_transfer,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line 938, in __write
    _check(retval)
  File "/usr/lib/python3/dist-packages/usb/backend/libusb1.py", line 602, in _check
    raise USBTimeoutError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBTimeoutError: [Errno 110] Operation timed out
Segmentation fault

@der-martin85
Copy link

I have the same problem. Also the program does not seem to use hidapi although it is installed and the symlink is set as stated in the instructions.
Only Messages up to 6 Characters work, but even with 6 it ends with an error message. More Characters give garbage at the end.

@ptschack
Copy link

I have the same Issue

@SamuABC
Copy link

SamuABC commented Dec 31, 2024

I have the same Issue (using Ubuntu 24.04)

I tried to increase the timeout time (line 664)

self.endpoint.write(buf[i * 64:i * 64 + 64], timeout=5000)

But then I only get a different error:

Module usb.core detected
Type: 11x44
Libusb device initialized
Write using wch.cn - CH546 (bus=1 dev=15 endpoint=2) via libusb
Traceback (most recent call last):
  File "/home/user/Documents/Workspace/led-name-badge-ls32/./led-badge-11x44.py", line 3, in <module>
    lednamebadge.main()
  File "/home/samuel/Documents/Workspace/led-name-badge-ls32/lednamebadge.py", line 1135, in main
    LedNameBadge.write(buf, method, args.device_id)
  File "/home/user/Documents/Workspace/led-name-badge-ls32/lednamebadge.py", line 828, in write
    write_method.write(buf)
  File "/home/user/Documents/Workspace/led-name-badge-ls32/lednamebadge.py", line 539, in write
    self._write(buf)
  File "/home/user/Documents/Workspace/led-name-badge-ls32/lednamebadge.py", line 664, in _write
    self.endpoint.write(buf[i * 64:i * 64 + 64], timeout=5000)
  File "/home/user/Documents/Workspace/led-name-badge-ls32/ledtag/lib/python3.12/site-packages/usb/core.py", line 408, in write
    return self.device.write(self, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/Documents/Workspace/led-name-badge-ls32/ledtag/lib/python3.12/site-packages/usb/core.py", line 989, in write
    return fn(
           ^^^
  File "/home/user/Documents/Workspace/led-name-badge-ls32/ledtag/lib/python3.12/site-packages/usb/backend/libusb1.py", line 855, in intr_write
    return self.__write(self.lib.libusb_interrupt_transfer,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/Documents/Workspace/led-name-badge-ls32/ledtag/lib/python3.12/site-packages/usb/backend/libusb1.py", line 938, in __write
    _check(retval)
  File "/home/user/Documents/Workspace/led-name-badge-ls32/ledtag/lib/python3.12/site-packages/usb/backend/libusb1.py", line 604, in _check
    raise USBError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBError: [Errno 19] No such device (it may have been disconnected)
libusb: debug [libusb_open] open 1.15
Speicherzugriffsfehler (Speicherabzug geschrieben)

@roberto-thy
Copy link

Same issue here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants