gphoto / gphoto2

The gphoto2 commandline tool for accessing and controlling digital cameras.
GNU General Public License v2.0
718 stars 116 forks source link

Nikon D800 unable to capture images #285

Open surrealillusion opened 4 years ago

surrealillusion commented 4 years ago

Describe the bug

gphoto2 is able to detect the camera and gather info from summary however when attempting to --capture-image, the following message is displayed:

Error (null) ERROR: Could not capture image. ERROR: Could not capture.

Looking through the logs one of the messages that stands out is the following:

0.411091 ptp_usb_getresp [usb.c:466] (0): PTP_OC 0x90c8 receiving resp failed: (null) (0xa200) 0.411106 camera_nikon_capture library.c:3153: 'ret' failed: '(null)' (0xa200)

Name the camera

Nikon DSC D800 usb:001,006

libgphoto2 and gphoto2 version gphoto2 2.5.15 gcc, popt(m), exif, cdk, aa, jpeg, readline libgphoto2 2.5.16 all camlibs, gcc, ltdl, EXIF libgphoto2_port 0.12.0 iolibs: disk ptpip serial usb1 usbdiskdirect usbscsi, gcc, ltdl, USB, serial without locking

To Reproduce

Ubuntu 18.04.1 Prebuilt gphoto2 package from repo Nikon D800 (connected to either USB 3.0 or USB 2.0 port; Multiple cables tested) Camera set to capture RAW only (manual mode with bulb set)

D800.log

Steps to reproduce the behavior:

gphoto2 --auto-detect --debug --debug-logfile=D800.log --capture-image

msmeissn commented 4 years ago

0xa200 error code is so far unknown to me

can you try upgrading to a newer libgphoto2 version ? is a SD card plugged in?

surrealillusion commented 4 years ago

Here is an updated log after compiling 2.5.23 NikonD800-2_5_23.log

Yes an empty formatted 32GB SD card is inserted in the camera.

msmeissn commented 4 years ago

0xA200 error is PTP_RC_NIKON_Bulb_Release_Busy

msmeissn commented 4 years ago

is the camera in some form of bulb mode?

surrealillusion commented 4 years ago

Yes, the camera is set to bulb mode as the use of the camera is to take long exposures for Astronomy.

msmeissn commented 4 years ago

Bulb capture needs to be done a bit differently, In this case you need to use something like this:

--set-config bulb=1 --wait-event=100s --set-config bulb=0 --wait-event-and-download=5s

(replace 100s accordingly, also check if the wait and download needs 5s or can use less.)

surrealillusion commented 4 years ago

Using that command it is able to take an exposure however I am noticing that the camera then remains in a state where the progress bar is constantly scrolling (normally only animates when files are actually being copied). This in turn causes a battery to drain faster. I am able to however take subsequent exposures. I do not notice this behavior in Windows using other software.

msmeissn commented 4 years ago

hmm, weird. I think we cleanup everything ...

what does the progress bar usually indicate?

surrealillusion commented 4 years ago

It normally indicates communication/data transfer when an image is being taken/downloaded. Once completed the screen should revert to the standard menu where all of the configured settings are visible. I used a Windows based image acquisition software to take some sample shots to observe the behavior.

surrealillusion commented 4 years ago

I finally had an opportunity to try some other capture commands and noticed if I run gphoto2 in tether mode to have it wait for a trigger (from either the main button or remote trigger) the camera would take an image and copy it to the computer without going into "PC" mode where it has the animated progress bar. Somehow the "bulb" mode at least for my D800 is triggering PC mode which is normally seen when trying to access/copy files from the camera. Once the camera is in this mode, all other functions are not accessible directly from the camera requiring a manual power off in order to use the manual shutter, access the menu, etc.