-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wait_for_event causes a picture to be taken? #358
Comments
This happens when wait_for_event runs and you press the shutter button on the camera. The shutter button press is reported via event 0xc00e and that in turn will run the canon_capture. |
Thanks @msmeissn - this clarifies matters a bit:
... but the thing is, I do not press the shutter button on the camera physically in any way - I just leave the camera as is, connected to USB, and run the python script. And considering I do Could there be any other suggestions as to what might cause a shutter button press event to occur, even if there isn't a physical button press? Maybe I should "drain" the event queue somehow (if possible?) before issuing |
hmm. perhaps it is reporting to us the shutterbutton is not pressed... can you actually try to wait longer and press it and see what events arrive? |
Sure - just tried it; first changed the relevant code section to this: ...
camera_config = camera.get_config() # must have this, else effectuated values are not read back in
print("{} about to wait_for_event".format(time.time()))
sys.stdout.flush()
a, b = camera.wait_for_event(10000)
OK, gpprop = gp.gp_widget_get_child_by_name( camera_config, "exposurecompensation" )
... ... so the timeout is now 10000 ms - but that makes no difference, because as soon as I get the There could be something in the previous Python code that triggers this event, but I simply cannot see what... Any other suggestions? |
Can you get a log output where you actually press the shutter button? I need to see what event is sent and what parameters it gets. I tetsed with my SX100IS, it does not have this specific problem |
Many thanks, @msmeissn : First, just wanted to mention that I posted a way to wait for
Thanks for confirming that - good to know its not a general problem, at least: maybe it's because the Canon S3 IS is an old model...
Oh, I see - sorry I misunderstood that! :) I wasn't sure at first how to obtain such a log, but then I just used
... first the camera "itself" took one image, and then i pressed the shutter button, it took the second picture, and then command exited. After re-running it, I came to the point where the command just waits, I press the shutter button, picture is taken, and command exits:
Here is that (gzipped) log, attached: Let me know if I should provide anything else. |
that is fine, thanks! I changed the code to ignore the 0xc00e event now for capture triggering, only the 0xc00b sems to be the shutter button press. |
Many thanks again, @msmeissn :
Fantastic - I just tested, and it seems that fixes the This is what I did (Ubuntu 18.04):
This process ends succesfully, and I get files like Then, in order to use these, I need to have this massive preamble for
... or as one line:
Note that when you call
... you will still get the old libraries listed. However - using This works on python-gphoto2 too; so I've ran the script in the OP again:
... and there are no more mentions of
I also tried the This result I get, if Live View has not been exercised yet:
... is one with no spurious photos taken - and where the exposurecompensation ro state does not change neither when switching to Manual, nor when switching back to Auto. And this is the result when having exercised live view:
... where again no spurious photos are taken - and exposurecompensation ro state changes only when switching to Manual (but not when switching back to Auto) So while the problem this issue was originally posted for is fixed -- there are no more spurious photos taken when using Thanks again - will close this issue now, as the problem has been solved! |
I first started with this issue at jim-easterbrook/python-gphoto2#75 - but it seems this may be more related to libgphoto2.
The problem is, on a Canon S3 IS, that I cannot get
exposurecompensation
's read-only property to change (immediately after) in response to a change ofshootingmode
, so I need to either arbitrarilysleep
for 2 seconds, or wait in a different way. I tried waiting withwait_for_event
- but that command initiates taking of a picture!?So, I'd like to know what causes
wait_for_event
to take a picture in this case - because if I can prevent that, I could likely wait for theexposurecompensation
's read-only property to change in response to a change ofshootingmode
, without guessing arbitrary sleep times.Anyways, I tried to debug more, and this is the version of the script that I used here:
I call this with:
The
test-sm-ec.log
is attached:test-sm-ec.log
... and the relevant part is:
So after this printout I call the equivalent of:
gp.gp_widget_get_child_by_name( camera_config, "shootingmode" ).set_value( "Auto" )
, which is indicated next in the log:... and then
camera.set_config(camera_config)
, which is also indicated as the log continues:... and once that - and
camera_config = camera.get_config()
is done:... I call
a, b = camera.wait_for_event(10)
which is indicated in the log:... but immediately after that, there is
camera_prepare_capture
andcamera_canon_capture
- where did those come from? The next line aftera, b = camera.wait_for_event(10)
isOK, gpprop = gp.gp_widget_get_child_by_name( camera_config, "exposurecompensation" )
- which is first mentioned in the log some 5000 lines after this location!?So, to sum up - what could possibly cause a picture to be taken on
wait_for_event
, and how to prevent it, if possible?The text was updated successfully, but these errors were encountered: