Discussion:
[pyusb-users] Assertion Error at End of Tutorial Test Script
Sean Kitko
2015-02-11 22:52:41 UTC
Permalink
Hi all,

I am currently trying to use PyUSB to interface with microcontroller in
order to automate some functionality.

There is firmware written and working for the micro.

However, I'm running into some problems implementing the test script
provided at the tutorial here:

https://github.com/walac/pyusb/blob/master/docs/tutorial.rst

I brought the test script into an editor, and changed the vendor and
product id, as well as the test string sent (I changed 'test' to 'V L',
which will light an LED on my development board).

When I run the script via powershell (Windows 7 64bit), I get the following
traceback error:

PS C:\...\PyUSB Dev> python simpletestscript.py
Traceback (most recent call last):
Sean Kitko
2015-02-11 22:55:31 UTC
Permalink
Hi all,

I apologize for my last email, I accidentally sent it without finishing.

I am currently trying to use PyUSB to interface with microcontroller in
order to automate some functionality.

There is firmware written and working for the micro.

However, I'm running into some problems implementing the test script
provided at the tutorial here:

https://github.com/walac/pyusb/blob/master/docs/tutorial.rst

I brought the test script into an editor, and changed the vendor and
product id, as well as the test string sent (I changed 'test' to 'V L',
which will light an LED on my development board).

When I run the script via powershell (Windows 7 64bit), I get the following
traceback error:

PS C:\...\PyUSB Dev> python simpletestscript.py
Traceback (most recent call last):
File "simpletestscript.py", line 27, in <module>
assert ep is not None
AssertionError
PS C:\...\PyUSB Dev>

I don't understand enough about the library to really understand why I
would be receiving that error.

If anyone has any idea what might be causing the issue, or a direction to
point me in, I would greatly appreciate the help.

Thanks.

-Sean
Xiaofan Chen
2015-02-12 01:43:09 UTC
Permalink
Post by Sean Kitko
However, I'm running into some problems implementing the test script
https://github.com/walac/pyusb/blob/master/docs/tutorial.rst
I brought the test script into an editor, and changed the vendor and product
id, as well as the test string sent (I changed 'test' to 'V L', which will
light an LED on my development board).
When I run the script via powershell (Windows 7 64bit),
Firstly, did you install a supported driver and supported
backend for your device under Windows?
(either using libusb-win32 with libusb-win32 device driver
or using libusb Windows backend with WinUSB driver).

The recommendation is to use Zadig to install the device
driver.

If you use libusb Windows backend, then you also
need the correct libusb-1.0.dll (32bit or 64bit depending on
your Python installation) from libusb project.
Post by Sean Kitko
PS C:\...\PyUSB Dev> python simpletestscript.py
File "simpletestscript.py", line 27, in <module>
assert ep is not None
AssertionError
PS C:\...\PyUSB Dev>
I don't understand enough about the library to really understand why I would
be receiving that error.
Does your device have an OUT Endpoint?

You can use USBview to dump the USB descriptor and post
the result here.

USBView: http://www.ftdichip.com/Support/Utilities.htm
--
Xiaofan
Loading...