|
From: Johannes E. <joh...@er...> - 2004-01-07 21:51:55
|
On Wed, Jan 07, 2004, Douglas S. Blank <db...@br...> wrote: > I'm just setting out to reverse engineer a robot that has a proprietary > USB interface. The first goal is to figure out how to send it commands > to make it move (it has two stepper motors, each controlling a wheel). > > I'm new to USB programming, and after looking at many interfaces, I'm > trying libusb. > > Trying the tests/testlibusb program that comes with libusb-0.1.7, I'm > able to see the robot USB data somewhat. But I get errors whenever I try > to read a string (manufacturer, vendor, or serial number). > > I've traced it down to the line: > > ret = ioctl(dev->fd, IOCTL_USB_CONTROL, &ctrl); > > in linux.c in the function usb_control_msg() which returns -1 on reading > the strings (other functions seem to work). I wouldn't worry about this too much. Some USB devices don't like it when they are asked for their strings multiple times. Or it maybe the bug found recently in libusb. Have you tried the CVS version? > I'm running RedHat 9.0, kernel 2.4.20-28.9smp. > > Some questions: > > 1. Is this the right project for the job (being that I'm not that > experienced with USB programming)? Should I consider using usbserial? Or > something else? Is it really a USB serial device in the robot? Unless there is software written already for the robot, then libusb should be the right software for the job. > 2. If this is the right project, can someone help with the above error? Try the CVS version. > 3. Where do I go from here? Do you have the specs from the manufacturer? If not, you can reverse engineer the Windows drivers (search the net for USB snoopy). JE |