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

Exception: USBError(None, b'libusb0-dll:err [control_msg] sending control message failed, win error: A device attached to the system is not functioning.\r\n\n') #12

Open
cvanjam opened this issue Dec 19, 2020 · 11 comments

Comments

@cvanjam
Copy link

cvanjam commented Dec 19, 2020

I downloaded the windows executable file and zadig to do the driver change.

I have one usb ant+ stick in my computer but when I run the vpower application I get this message:

Exception: USBError(None, b'libusb0-dll:err [control_msg] sending control message failed, win error: A device attached to the system is not functioning.\r\n\n')

I am using this usb ant+ stick: https://www.amazon.com/gp/product/B077YDL2KL/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&psc=1

Am I missing something? Am I not setting something up that I should be? Is it the USB ant+ stick brand? (I actually have 2 and it works with neither)

Thank you in advance!

@oldnapalm
Copy link
Owner

Both sticks you have are the same brand?

I have only tested with the ANTUSB-m (0fcf:1009) but the original vpower repo used the ANTUSB2 (0fcf:1008) so it should work with that version too. Not sure if the brand makes any difference, I have personally used only the Garmin one.

You can try using libusbK instead of libusb-win32, or this updated version of libusb-win32
https://sourceforge.net/projects/libusb-win32/files/libusb-win32-snapshots/20190918/libusb-win32-bin-1.2.7.1.zip/download

@oldnapalm
Copy link
Owner

If the above options don't work, you can try this:

  • connect just one stick and use Zadig to change its driver to WinUSB
  • connect the other stick
  • test this version
    vpower.zip

This version uses the libusb-1.0 backend, and the Windows ANT driver (used by other apps) use libusb0, so it's important that you install WinUSB driver only for one stick, or the other stick won't work in other apps.

2020_12_19_10_36_57_Gerenciador_de_Dispositivos

@cvanjam
Copy link
Author

cvanjam commented Dec 19, 2020

Yes both sticks are the same brand.
The second download you posted got flagged as a virus both by chrome and windows so idk whats going on there haha.

I tried the other method again from scratch, below are the two ANT USB sticks listed as libusb-win32 devices, no idea why its not reading them.

image

I think i'm just going to give up, im not an avid cyclist so this isnt the biggest deal. Just wanted to use RGT cycling because it was free vs zwift. Making a new account every week hasnt been prohibitively annoying yet haha.

Thank you! I appreciate the help!

@oldnapalm
Copy link
Owner

oldnapalm commented Dec 20, 2020 via email

@cvanjam
Copy link
Author

cvanjam commented Dec 20, 2020 via email

@oldnapalm
Copy link
Owner

The issue just disappeared from GitHub, my previous reply was from the notification e-mail. Now it's back, I'm seeing your reply from December 20 just now.

I found another person with the same issue, I thought it could be a PyUSB issue and asked for help in their repo, but looks like it's in a lower level pyusb/pyusb#343

I added a warning about the Cycplus ANT Stick in the README saying it's not compatible, even though it uses the same Vendor ID and Product ID as the ANTUSB2 Stick. The person who has this stick said it only works on Zwift, it doesn't work in other apps, not even SimulANT. They pointed me to this link, which makes me think there's a hardware issue with these sticks https://tacxfaqx.com/knowledge-base/cycplus-ant-stick/

@pczhang
Copy link

pczhang commented Aug 29, 2022

I use two CooSpo USB ANT Sticks, and it has been working perfectly until recently. I will try your above suggestions to see if the issue can be fixed. For using two identical sticks, could we specify which stick to use in the config file? Thanks!

@oldnapalm
Copy link
Owner

I use two CooSpo USB ANT Sticks, and it has been working perfectly until recently. I will try your above suggestions to see if the issue can be fixed. For using two identical sticks, could we specify which stick to use in the config file? Thanks!

It's doable but you would need to modify the python-ant module to match the stick serial number. I added an option do match the USB bus and address (mch/python-ant@25261cb) so if that's enough for your situation, you can specify it here https://github.com/oldnapalm/vpower/blob/master/vpower.py#L53

@pczhang
Copy link

pczhang commented Sep 4, 2022

just got time to try this out. The problem is that I can't use two different drivers for two identical devices. Once I have changed one to use libusb-win32 using zadig, the other one is changed as well. I guess that's the limit of windows that you can't use different drivers. Not sure why it has been working for me for a month without the problem. It just stopped working recently.

@oldnapalm
Copy link
Owner

No idea why it would stop working. Are you sure it's the same error as this issue? Actually this issue has no solution, all these tests with different drivers failed.

@pczhang
Copy link

pczhang commented Sep 5, 2022

Not sure. The error message looks alike. See below. I moved vpower server to my linux box this morning, so I am good now!

libusb0.py", line 447, in _check
raise USBError(errmsg, ret)
usb.core.USBError: [Errno None] b'libusb0-dll:err [_usb_reap_async] reaping request failed, win error: A device attached to the system is not functioning.

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

3 participants