python-gphoto2 icon indicating copy to clipboard operation
python-gphoto2 copied to clipboard

Always connected capture anytime

Open musaulker opened this issue 1 year ago • 1 comments

Hello,

I am trying to capture photo from time to time while the camera is connected to the computer. Photo capture works with library on initial try. But after some moment passes, maybe the camera is going sleep or usb connection is closed, for some reason i cannot take a picture any more without closing and opening the camera.

Is it possible to have a live connection with camera so i can took picture anytime and save on the computer?

I checked wait-for-event.py file which maybe a starting point but its not clear to trigger photo capture from python while connection is active.

Any advice?

Thanks

musaulker avatar Nov 17 '23 17:11 musaulker

If the camera turns itself off then there isn't much you can do. Otherwise you could try resetting the port as described in bug #162.

        info = camera.get_port_info()
        port = gphoto2.GPPort()
        port.set_info(info)
        port.open()
        port.reset()

jim-easterbrook avatar Nov 18 '23 10:11 jim-easterbrook