Re: gphoto 2.5.4/2.5.10/2.5.11 works unreliable on RP3 with Canon 1200D
"Dr. Volker Jaenisch" <[email protected]>
| Newsgroups | gmane.comp.multimedia.gphoto.user |
|---|---|
| Message-ID | <[email protected]> |
Hi again!
Have to apologise. Total looser, so bad!
Looks like the problem isn't gphoto at all, but the way I called it from
python.
I am still investigating, but it seems like it matters if you call
gphoto from the python subprocess-lib with "shell=True" or "shell=False"
parameter.
Here is the python code fragment that works:
*config.py:*
# Grace time for camera to finish operation. Grace_time must be lower
the interval_time.
# Wartezeit für Kamera bevor das Bild runtergeladen wrid. Muss kleiner
als Schlafzeit sein.
grace_time = 25
# camera name for generation of unique output files
camera_name = 'cam_01'
# folder for capture files
capture_file_folder = '../../capture/'
# gphoto2 executable
gphoto_executable='/usr/bin/gphoto2'
# filename_format
FILENAME_FORMAT = "Schedule_%Y%m%d-%H%M%S.jpg"
# ===================
# Image configuration
# ===================
# Aperture
# Blende
image_conf = {
'main/capturesettings/aperture' : '8', # Blende
'main/imagesettings/iso' :'0', # iso Value. 0=Auto
}
*capture.py:*
import subprocess
import datetime
import os
import config
from log import logger
from translation import _
def start():
...
...
CMD_SINGLE = [
'--force-overwrite',
'--filename=%s' % out_file_name,
'--wait-event=270ms',
'--set-config', "eosremoterelease='Press 1'",
'--wait-event=80ms',
'--set-config', "eosremoterelease='Press 2'",
'--wait-event=80ms',
'--set-config', "eosremoterelease='Release 2'",
'--wait-event=80ms',
'--set-config', "eosremoterelease='Release 1'",
'--wait-event-and-download=%ss' % config.grace_time,
]
cmd = [config.gphoto_executable]
cmd = cmd + CMD_SINGLE
logger.info(_('Running') + ": " + ' '.join(cmd) )
output = subprocess.check_output( ' '.join(cmd), *shell=True* )
logger.info(_('Got') )
for line in output.decode("utf-8", "replace").split('\n'):
logger.info(_(' ') + line )
logger.info(_('Image captured') )
Currently I have a series of 28 shots without problems.
Sorry for stealing your time
Volker
--
=========================================================
inqbus Scientific Computing Dr. Volker Jaenisch
Richard-Strauss-Straße 1 +49(08861) 690 474 0
86956 Schongau-West http://www.inqbus.de
=========================================================
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Gphoto-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gphoto-user