oldnapalm / vpower

ANT+ Virtual Power Meter
MIT License
17 stars 9 forks source link

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 3 years ago

cvanjam commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

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 commented 3 years ago

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 commented 3 years ago

I can't find the issue anymore, did you delete it?

Em sex., 18 de dez. de 2020 às 21:33, cvanjam notifications@github.com escreveu:

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!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/oldnapalm/vpower/issues/12, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJFBU2WBAEH5547GU3KKVD3SVPYE5ANCNFSM4VB3NHYA .

cvanjam commented 3 years ago

No, I just posted that I essentially gave up because I don't ride enough and then the post seems to have been deleted. (I actually assumed you did it). I appreciate your help. I returned the 2 usb sticks already too after trying the whole thing in 2 different laptops. I wanted to use it for rgt cycling because it was free (but you need a power meter), but I'll just keep making free accounts on zwift haha.

Thank you for reaching out! I appreciate the thought/your time!

Have a good one!

On Sun, Dec 20, 2020, 12:28 PM oldnapalm notifications@github.com wrote:

I can't find the issue anymore, did you delete it?

Em sex., 18 de dez. de 2020 às 21:33, cvanjam notifications@github.com escreveu:

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!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/oldnapalm/vpower/issues/12, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AJFBU2WBAEH5547GU3KKVD3SVPYE5ANCNFSM4VB3NHYA

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/oldnapalm/vpower/issues/12#issuecomment-748643371, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASFTS2INDAJOEEYVRH5YQ7DSVY64BANCNFSM4VB3NHYA .

oldnapalm commented 3 years ago

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 https://github.com/pyusb/pyusb/issues/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 commented 1 year ago

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 commented 1 year ago

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 (https://github.com/mch/python-ant/commit/25261cb34f60af40dcf568d8167a53de53032542) so if that's enough for your situation, you can specify it here https://github.com/oldnapalm/vpower/blob/master/vpower.py#L53

pczhang commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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.