From: Stephen R. <mor...@ho...> - 2012-03-30 14:01:44
|
Hi list, Hope I am doing this right... I'm trying to use Python and pyusb1.0 running on a minimal VirtualBox installation of Debian Linux to control the OWI Edge robot arm. (I'm trying to emulate a raspberry pi that I will use in the classroom to introduce programming and robotics, once I can actually get my hands on one) I've been referring to this http://notbrainsurgery.livejournal.com/38622.html for technical info about the arm. The code I am attempting to use is: import usb.core import usb.util # find our device dev = usb.core.find(idVendor=0x1267, idProduct=0x0000) # was it found? if dev is None: raise ValueError('Device not found') # set the active configuration. With no arguments, the first # configuration will be the active one dev.set_configuration() dev.write(0x81, '00,00,01', 0) Which in theory should turn on the LED at the end of the arm. When I try to run it I get the error usb.core.USBError: Operation timed out The code comes from the pyusb example - I also tried using the example code from pyusb with the endpoint section in with the same result. The details about the robot arm listed from lsusb -vv are shown at the end of this email. I'm a complete noob to USB - I assume that I've got the endpoint address and bInterfaceNumber correct in the dev.write command as it came from the lsusb -vv details ... I assume the issue is in the formatting of the data in the write command. Writing 00 00 01 should turn on an LED at the end of the arm but I dont know how I should format this for the write command (if that is what the problem is; the timout occurs irrespectively of the string that's sent eg empty: dev.write(0x81, '', 0) still gives the error) Any help much appreciated Kind regards, Steve Richards Bus 001 Device 010: ID 1267:0000 Logic3 / SpectraVideo plc Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x1267 Logic3 / SpectraVideo plc idProduct 0x0000 bcdDevice 0.00 iManufacturer 0 iProduct 0 iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 25 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0x80 (Bus Powered) MaxPower 100mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 3 Transfer Type Interrupt Synch Type None Usage Type Data wMaxPacketSize 0x0008 1x 8 bytes bInterval 8 Device Status: 0x0000 (Bus Powered) |