Hi Guys,
I am trying to get my Windows PC talking to my Nikon D700 via USB, to
develop Python code for my Raspberry Pi to control my camera. I have looked
at gphoto2 but it looks too complicated. I found PyPTP and hope to control
my camera this way. PyPTP uses the PyUSB library.
I have installed libusb 0.1 via the Windows binary and can list my camera
using the GUI provided. (I can't find a Windows binary for libusb 1.0, and
don't want to compile from source code). PyPTP seems to have a few bugs in
it, so I have copied the example from
http://pyusb.sourceforge.net/docs/1.0/tutorial.html (also has bugs in it)
to check the basics.
When I run the test program, I get no output, and the stack trace below. It
seems that in module libusb01, the call to _lib.usbcontrol_msg is returning
-5, so _check is raising an error because the retval is -5.
The inputs to usb_control_msg are:
dev_handle = 9775792
bmRequestType = 129
bRequest = 10
wValue: 0
wIndex = 0
data_or_wLength = 1
timeout = 1000
The cast takes data.buffer_info, which does not exist. I have a "data"
variable which is array('B', [0])
Traceback (most recent call last):
File "D:\Eclipse_workspace\Camera_Control\src\test.py", line 18, in
<module>
alternate_setting = usb.control.get_interface(dev, interface_number)
File "C:\Program Files\Python27\lib\site-packages\usb\control.py", line
242, in get_interface
data_or_wLength = 1
File "C:\Program Files\Python27\lib\site-packages\usb\core.py", line 698,
in ctrl_transfer
self.__get_timeout(timeout)
File "C:\Program
Files\Python27\lib\site-packages\usb\backend\libusb01.py", line 536, in
ctrl_transfer
timeout
File "C:\Program
Files\Python27\lib\site-packages\usb\backend\libusb01.py", line 384, in
_check
raise USBError(errmsg, ret)
usb.core.USBError: [Errno None] libusb0-dll:err [control_msg] sending
control message failed, win error: The request is not supported.
Any help is appreciated.
Thanks,
Phil.
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users