Hi,

On Wed, Jul 10, 2019 at 01:54:06AM -0400, Joshua Boyd wrote:
> I have a SPLat HMI430, which is a PLC device with a graphical display. The
> PTP connection can be used for writing firmware updates, for writing bitmaps
> and fonts to be used by the firmware and also for reading back a screenshot
> of what is currently being displayed on the attached screen.
> 
> I am trying to use the gphoto2 command line program to read these screen
> shots.  I can already use gphoto2 to write firmware updates and assets to
> the device. I can use it to list the files on the device as well as delete
> files on the device. I can't seem to get it to read the screen shot or read
> back the other files shown by list-file.  I saw this problem first with
> version 2.5.11 that comes with Raspbian, and then again after compiling
> libgphoto2 and gphoto2 from master on the github repo.
> 
> The result I see is:
> 
> *** Error (-6: 'Unsupported operation') ***
> 
> 
> When I try to read the screenshot or other files on Windows 10, it works
> correctly. One behavior I note is that on Windows 10, reading the screen
> shot is surprisingly slow.  Much slower than writing a firmware image to it
> appears to be. Meanwhile, the failure on raspbian seems really fast.  I
> wonder if that means there is a stage in getting ready to read the file that
> should be waited for longer or retried or something.
> 
> I followed the recommendation for generating an error log file given by the
> failed command and I've attached that file.
> 
> I realize this is a pretty fringe use case, and the device could very well
> be doing something non-standard.  However, since it works on Windows, it
> must be possible to do it.  I'd appreciate some guidance in figuring out why
> gphoto2 doesn't work to read files from this device and maybe on how to fix
> it.

We trigger this edge case in libgphoto2 camlibs/ptp2/library.c:

                /* We do not allow downloading unknown type files as in most
                 * cases they are special file (like firmware or control) which
                 * sometimes _cannot_ be downloaded. doing so we avoid errors.
                 * Allow all types from MTP devices, like phones.
                 */
                if (    !is_mtp_capable (camera) &&
                        (ob->oi.ObjectFormat == PTP_OFC_Undefined &&
                                ((ob->oi.ThumbFormat == PTP_OFC_Undefined) ||
                                 (ob->oi.ThumbFormat == 0)
                        )
                        )
                )
                        return (GP_ERROR_NOT_SUPPORTED);


It is basically a safety measure not to allow device control files which can 
crash
the device.

You could comment out this check as a temporary measure.

Ciao, Marcus


_______________________________________________
Gphoto-devel mailing list
Gphoto-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gphoto-devel

Reply via email to