-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
ValueError: Invalid endpoint address 0x1 #36
Comments
ok looking through this: Bus 005 Device 006: ID 0416:5020 Winbond Electronics Corp. which shows the OUT endpoint = 0x02 or 2 ...
And that appears to work as designed... |
according to this:
|
I have same problem here, after editing dev.write, it works! Thank you |
@ghosty-be Maybe you can make a PR for that so @jnweiger may merge it! :-) |
I'd like to stress that this patch fixes the described issue for the usb.core code path on Linux. However, newer versions of the hardware do not seem to work with this approach generally any more, even with the fix. You need to switch to pyhidapi access and apply a fix to make it working again. Pull Request pending. |
PR: #42 |
Changeing Line in led-badge-11x44.py to |
#42 is merged. |
The point with the endpoint number is closely connected to #37, because these devices seem to use Endpoint 2 instead of 1. They also use another USB-to-serial chip. My idea is to automatically use the only endpoint available, instead of a fixed one. I'l try to implement this somewhen in the next weeks (cannot promise...) |
Hello ghost.be, oh, I have overseen that you already did a patch as proposal. I'll try it soon. |
Libusbhid does not seem to set-up easily I have a simpler workaround for now, without hardcoding |
Tried on Linux Mint 20.3 and 21 (debian - ubuntu based):
installed python3-usb through apt, python3-pil was already installed by default.
copied the udev rule and reloaded
Device: NB1144
tried running with and without sudo, even directly as root.
When I try the example I get the following error:
./led-badge-11x44.py "Hello"
using [wch.cn CH583] bus=5 dev=10
Type: 11x44
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/usb/core.py", line 223, in get_interface_and_endpoint
return self._ep_info[endpoint_address]
KeyError: 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./led-badge-11x44.py", line 523, in
dev.write(1, buf[i64:i64+64])
File "/usr/lib/python3/dist-packages/usb/core.py", line 940, in write
intf, ep = self._ctx.setup_request(self, endpoint)
File "/usr/lib/python3/dist-packages/usb/core.py", line 102, in wrapper
return f(self, *args, **kwargs)
File "/usr/lib/python3/dist-packages/usb/core.py", line 215, in setup_request
intf, ep = self.get_interface_and_endpoint(device, endpoint_address)
File "/usr/lib/python3/dist-packages/usb/core.py", line 102, in wrapper
return f(self, *args, **kwargs)
File "/usr/lib/python3/dist-packages/usb/core.py", line 231, in get_interface_and_endpoint
raise ValueError('Invalid endpoint address ' + hex(endpoint_address))
ValueError: Invalid endpoint address 0x1
The text was updated successfully, but these errors were encountered: