gphoto2 icon indicating copy to clipboard operation
gphoto2 copied to clipboard

Canon EOS 2000D appears to reject commands sent too soon after PTP/IP connection is established

Open BCMM opened this issue 3 years ago • 14 comments

Describe the bug

When using a network connection as opposed to USB, the Canon EOS 2000D appears to reject commands sent too soon after the connection is established, causing the gphoto2 command-line to fail.

Name the camera

If this is camera specific, include the camera name as shown by gphoto2 --auto-detect or USB IDs

I can't use --auto-detect because the camera is not connected by USB, but it's a Canon EOS 2000D.

libgphoto2 and gphoto2 version

gphoto2 2.5.26

Copyright (c) 2000-2020 Marcus Meissner and others

gphoto2 comes with NO WARRANTY, to the extent permitted by law. You may
redistribute copies of gphoto2 under the terms of the GNU General Public
License. For more information about these matters, see the files named COPYING.

This version of gphoto2 is using the following software versions and options:
gphoto2         2.5.26         gcc, popt(m), exif, cdk, aa, jpeg, readline
libgphoto2      2.5.26         standard camlibs, gcc, ltdl, EXIF
libgphoto2_port 0.12.0         iolibs: disk ptpip serial usb1 usbdiskdirect usbscsi, gcc, ltdl, EXIF, USB, serial without locking

To Reproduce

$ gphoto2 --debug --debug-logfile=debug.log --capture-image                
                                                                               
*** Error ***              
Canon EOS Half-Press failed (0x2019: PTP Device Busy)
ERROR: Could not capture image.
ERROR: Could not capture.
*** Error (-110: 'I/O in progress') ***       

debug.log

Using gphoto --shell, this can be worked around by including a delay between the establishment of the connection and the attempt to capture an image.

This command almost always fails:

$ (sleep 1; echo capture-image) | gphoto2 --shell
gphoto2: {/tmp} /> capture-image                                               
capture-image

*** Error ***              
Canon EOS Half-Press failed (0x2019: PTP Device Busy)
ERROR: Could not capture image.
ERROR: Could not capture.
*** Error (-110: 'I/O in progress') ***
gphoto2: {/tmp} />

This command always succeeds:

$ (sleep 5; echo capture-image) | gphoto2 --shell
gphoto2: {/tmp} /> capture-image                                               
capture-image
New file is in location /capt0000.jpg on the camera
gphoto2: {/tmp} />

(gphoto2 --wait-event=5s --capture-photo can also be used to produce a similar effect.)

This may just be a coincidence, but the period during which capture will fail appears to correspond to the period during which the following message is displayed on the camera's screen. So far, the camera appears to operate reliably as long the screen is black before commands are sent.

682887620e86482c9ddb43c3f1f33343_G0229895

BCMM avatar Dec 02 '20 00:12 BCMM