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

usb reset() breaks libusb-win32 (tiny patch included) #33

Closed
GoogleCodeExporter opened this issue Oct 10, 2015 · 2 comments
Closed

usb reset() breaks libusb-win32 (tiny patch included) #33

GoogleCodeExporter opened this issue Oct 10, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. install libusb-win32 (on 32-bit or 64-bit Windows)
2. try to connect to NXT
3. connection fails because usb device is unconfigured

What version of nxt-python are you using? On what operating system?
nxt-python 2.2.0 on Win7 x64

Please provide any additional information below.

patch for usbsock.py:
>import os
...
def connect(self):
  ...
  >if os.name != 'nt':
    self.handle.reset()


see http://sourceforge.net/apps/trac/libusb-win32/wiki/libusbwin32_documentation
usb_reset() ... "Causes re-enumeration: After calling usb_reset, the device 
will need to re-enumerate and thus requires you to find the new device and open 
a new handle. The handle used to call usb_reset() will no longer work."

Original issue reported on code.google.com by paulholl...@gmail.com on 7 Oct 2011 at 7:55

@GoogleCodeExporter
Copy link
Author

While I hate to add OS-specific hacks, it looks like this one is needed. The 
trunk has been patched in r372 and this change will be included in the next 
bugfix version. Thanks!

Original comment by marcus@wanners.net on 9 Oct 2011 at 6:40

  • Changed state: Fixed
  • Added labels: Component-USB, OpSys-Windows, Series-2.x, Usability

@GoogleCodeExporter
Copy link
Author

Thank you!  Trying to get my lab to move from matlab to python ...
Maybe one day I'll get them to join me in the land of linux :)

Original comment by paulholl...@gmail.com on 9 Oct 2011 at 11:34

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

No branches or pull requests

1 participant