ptpcam on a Gumstix Overo running Angstrom Linux - General Help and Assistance on using CHDK stable releases - CHDK Forum
supplierdeeply

ptpcam on a Gumstix Overo running Angstrom Linux

  • 5 Replies
  • 5113 Views
ptpcam on a Gumstix Overo running Angstrom Linux
« on: 18 / October / 2011, 17:42:34 »
Advertisements
I need some assistance with someone more experienced with ptpcam. I downloaded ptpcam with the CHDK extension from the CHDKDE site (http://tools.assembla.com/chdkde/browser/trunk/tools/ptpcam). ptpcam works great in talking with my S95 camera (with CHDK) attached to my Ubuntu laptop. However, we're running into a problem with the camera attached to a Gumstix Overo board running Angstrom Linux.

We've built ptpcam on the Overo (after getting all the dependencies needed), but when we try to list ptp devices like so:

$ ./ptpcam -l

We get this error:

Listing devices...
bus/dev   vendorID/prodID   device model
usb_bulk_write: Bad file descriptor
ERROR: Could not open session!
Try to reset the camera.

Looking through the code, it looks like usb_bulk_write is part of libusb, right? Anyway, we need to find out what's going on here and where the problem is. If anyone here has more experience with ptpcam or can point me in the right direction (maybe of the ptpcam developers), that would be greatly appreciated.

Re: ptpcam on a Gumstix Overo running Angstrom Linux
« Reply #1 on: 18 / October / 2011, 18:12:06 »
Sorry all, I posted prematurely because I ended up answering my own question.

In ptpcam.h there are these lines:

Code: [Select]
22 #ifdef LINUX_OS
23 #define USB_BULK_READ myusb_bulk_read
24 #define USB_BULK_WRITE myusb_bulk_write
25 int myusb_bulk_read(usb_dev_handle *dev, int ep, char *bytes, int size,
26 int timeout);
27 int myusb_bulk_write(usb_dev_handle *dev, int ep, char *bytes, int length,
28 int timeout);
29 #else
30 #define USB_BULK_READ usb_bulk_read
31 #define USB_BULK_WRITE usb_bulk_write
32 #endif

Well, for some reason, if I comment out lines 22-29 and 32 so it looks like this:
Code: [Select]
22 //#ifdef LINUX_OS
23 //#define USB_BULK_READ myusb_bulk_read
24 //#define USB_BULK_WRITE myusb_bulk_write
25 //int myusb_bulk_read(usb_dev_handle *dev, int ep, char *bytes, int size,
26 // int timeout);
27 //int myusb_bulk_write(usb_dev_handle *dev, int ep, char *bytes, int length,
28 // int timeout);
29 //#else
30 #define USB_BULK_READ usb_bulk_read
31 #define USB_BULK_WRITE usb_bulk_write
32 //#endif
It works. It seems that myusb_bulk_write() just wasn't compatible with Angstrom in some way. Again, this only applies to the Angstrom distribution, everything worked fine in Ubuntu without doing this.

*

Offline reyalp

  • ******
  • 14080
Re: ptpcam on a Gumstix Overo running Angstrom Linux
« Reply #2 on: 18 / October / 2011, 23:34:55 »
FWIW, the copy of ptpcam that is in the CHDKDE tree has been hacked up and copied a few times. In particular, the regular automake/configure stuff got lost along the way, so it is just a copy of someone already configured source tree that has been manually modified.

A user on IRC did get it working with configure again, you can see the result here https://github.com/jrabbit/libptp-chdk (note, I'm just passing this on, I haven't reviewed it or used it)
Don't forget what the H stands for.

Re: ptpcam on a Gumstix Overo running Angstrom Linux
« Reply #3 on: 20 / October / 2011, 18:13:07 »
That's kind of what it seemed like. Where is the "original" ptpcam maintained at? And does that one support CHDK? Or is the one at CHDKDE the only version of ptpcam that supports CHDK?


Re: ptpcam on a Gumstix Overo running Angstrom Linux
« Reply #4 on: 21 / October / 2011, 07:42:19 »
On the 30th September, after some correspondence, I sent you an SDM build and ptp client for testing your requirement of instant image download after shooting.

I outlined a number of commands and asked you to confirm that they worked.

You never replied.

*

Offline reyalp

  • ******
  • 14080
Re: ptpcam on a Gumstix Overo running Angstrom Linux
« Reply #5 on: 22 / October / 2011, 23:10:30 »
That's kind of what it seemed like. Where is the "original" ptpcam maintained at? And does that one support CHDK? Or is the one at CHDKDE the only version of ptpcam that supports CHDK?
The original ptpcam does not support CHDK protocol. The source in fork in the CHDKDE branch is the official CHDK supporting version.

The original PTPCam project is at  http://libptp.sourceforge.net/ however, it hasn't had any significant activity for a long time.

The ptpcam fork was never really intended as a long term solution, it was just a convenient place to throw some code since it already had everything in place to do PTP communication. I would certainly not submit it to upstream developers as is.
Don't forget what the H stands for.

 

Related Topics