gphoto / libgphoto2

The libgphoto2 camera access and control library.
GNU Lesser General Public License v2.1
1.03k stars 325 forks source link

Canon 5D IV "busy" tethered shooting when saving to memory card #298

Open baokhangnn opened 6 years ago

baokhangnn commented 6 years ago

I have a simple need: to shoot with the camera and have the photos be downloaded. I would like to be able to save RAW to the memory card and jpeg to the host computer (Raspberry Pi Zero W in this case).

Through several evenings of testing I have found that whenever I try to save to the memory card: 1) when the buffer is full the camera just says "busy". 2) Doesn't save to the memory card. 3) The only thing I can do is to pull the battery.

If I set capturetarget=0, things work just fine. But I can't save to the camera's memory card. If I set capturetarget=1, it never saves to the memory card and when the buffer is full, it's "busy".

Here's my simple test script:

!/bin/sh

/usr/bin/gphoto2 \ --set-config capturetarget=0 \ --capture-tethered \ --filename "/home/pi/BallroomPhotos/%Y%m%d/IMG%Y%m%d%H%M%S.%C"

Other notes:

If I have 1 memory card installed: -unhandled EOS event StorageInfoChanged (size 12)

If I have 2 memory card installed: -unhandled EOS event StorageInfoChanged (size 12) -unhandled EOS event StorageInfoChanged (size 12)

I've also tried suggestions in Issue#90. And many other suggestions in the forums to no avail.

Am I missing something simple?

BTW, Thanks a million for the awesome work that you guys do!

Setup: -Raspberry Pi Zero W (Raspbian Stretch Lite - updated). -Canon 5D IV (firmware 1.1.2)

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

msmeissn commented 6 years ago

so try: capturetarget =1 (card) and use the --keep-raw option of gphoto2 ... this will download the jpeg and keep the accompanying RAW on the card?

baokhangnn commented 6 years ago

Marcus,

Thank you for the quick response.

Here is the script that I execute:

!/bin/sh

/usr/bin/gphoto2 \ --set-config capturetarget=1 \ --capture-tethered \ --filename "/home/pi/BallroomPhotos/%Y%m%d/IMG%Y%m%d%H%M%S.%C" \ --keep-raw

The 5D mkIV is set to record RAW + medium fine JPEG.

Test 1: Take just 1 photo. RAW is saved to memory card. JPEG is saved to raspberry pi. However, the camera is still flashing the "remaining" count indefinitely. When I turn off the camera it says "Remaining files to save: 1" indefinitely. Only way to reset is to open the battery cover.

Test 2: Take photos about 1-3 seconds apart (total 11). Only 3 JPEG are saved to the raspberry pi. 3 RAW are saved to the memory card. And once the buffer fills up the camera reports as "busy". When I turn off the camera it says "Remaining files to save: 8" indefinitely. Only way to reset is to open the battery cover.

Thank you for your help!

-Bao

msmeissn commented 6 years ago

The capturetarget seems still to be "PC" or SDRAM, but not SD CARD. The setting seems not to have worked for some reason ... hmm.

The camera might not take the setting for some reason. Is the settings file saved and does it report in ~/.gphoto/settings

the line: ptp2=capturetarget=card

?

Can you also captzre a debuglog of a capture?

baokhangnn commented 6 years ago

Marcus,

Script:

!/bin/sh

/usr/bin/gphoto2 \ --debug \ --debug-loglevel debug \ --debug-logfile 5DmkIVtarget1 \ --set-config capturetarget=1 \ --capture-tethered \ --filename "/home/pi/BallroomPhotos/%Y%m%d/IMG%Y%m%d_%H%M%S.%C" \ --keep-raw

~/.gphoto/settings

pi@Cam-1:~/.gphoto $ more settings gphoto2=model=Canon EOS 5D Mark IV gphoto2=port=usb:001,039 ptp2=capturetarget=card libgphoto=cached-images=2

pi@Cam-1:~/gphoto2 $ gphoto2 --get-config=capturetarget Label: Capture Target
Readonly: 0 Type: RADIO Current: Memory card Choice: 0 Internal RAM Choice: 1 Memory card END

I have 4 debug files: 1) single shot debug-level=default 2) single shot debug-level=debug 3) multi shot until buffer full debug-level=default 4) multi shot until buffer full debug-level=debug

https://www.dropbox.com/sh/sbrqn9eqyatfsho/AABgIyhubfwkBmRzj-i5Ozpqa?dl=0

Again, if the target is set to "card": 1) in all cases when turning off the camera it states "Recording... Remaining Files: xxx" indefinitely. 2) In the cases of the single shot it did recored the JPEG to the raspberry pi and the RAW to the memory card. 3) In the cases of the multi-shots it only recorded a few to the raspberry pi and to the memory card (~3) and the rest were never recorded (~8-10). Once the buffer was full the camera would state "busy".

If there's anything else you need, just let me know! Thanks!

baokhangnn commented 6 years ago

If there's anything else you need, just let me know. I can run more tests or get logs for you if you need it.

Thanks a million!

littlexiang commented 6 years ago

I have encountered very same issue too, after exact 3 photos taken camera blocks.