libgphoto2
libgphoto2 copied to clipboard
Canon camera heats up when "open", but doing nothing
Using a Canon EOS R camera, if I just open the camera and get config, then sit in a very slow wait for event loop, the camera heats up (and uses a lot of battery power!). When I finally take a photo, the camera reports a temperature anything up to 50 Centigrade,
If I actually take photos with long exposures in bulb mode (say 1 minute) the camera slowly cools down again. It looks like whatever gphoto2 does to keep the camera from going to sleep, keeps the camera processor too busy - even busier than when taking a photo (or at least when collecting photons).
Is there a way to hold the camera open, but inactive so it doesn't heat up (heating up seriously increases noise on long exposure photos).
I'm using Jim Easterbrook's python binding.
python-gphoto2 version: 2.3.3
libgphoto2 version: ['2.5.27', 'standard camlibs', 'gcc', 'ltdl', 'EXIF']
libgphoto2_port version: ['0.12.0', 'iolibs: disk ptpip serial usb1 usbdiskdirect usbscsi', 'gcc', 'ltdl', 'EXIF', 'USB', 'serial without locking']
Here is the program:
#!/usr/bin/env python
import gphoto2 as gp, logging, sys, time
# test 1 - does the camera stay active once opened by gphoto2
def opencamera():
acamera=gp.Camera()
try:
acamera.init()
except gp.GPhoto2Error as gpe:
if gpe.code != -105:
logger.warning('error -105, camera sulking?')
return None, None
try:
gp2cam_cfg=acamera.get_config()
except gp.GPhoto2Error as gpe:
if gpe.code != -105: # Something nasty and unexpected!
raise
return acamera, gp2cam_cfg
ll = logging.DEBUG
rl = logging.DEBUG
logger = logging.getLogger()
logger.setLevel(ll)
ch = logging.StreamHandler()
ch.setLevel(rl)
ch.setFormatter(logging.Formatter('%(asctime)s - %(module)s %(name)s - %(levelname)s - %(message)s\n', datefmt='%H:%M:%S'))
logger.addHandler(ch)
logger.warning('logging level is %s, reporting level is %s' % (ll, rl))
try:
gp2cam, cfg = opencamera()
while gp2cam is None:
gp2cam, cfg = opencamera()
except KeyboardInterrupt:
logger.warning('break! - byee')
if gp2cam:
gp2cam.exit()
sys.exit(0)
started = time.time()
reportat = started+10
try:
while True:
try:
etype, data = gp2cam.wait_for_event(100000)
except gp.GPhoto2Error: # for example [-52] Could not find the requested device on the USB port
etype = None
if etype == gp.GP_EVENT_TIMEOUT:
pass
elif etype == gp.GP_EVENT_FILE_ADDED:
print('FILE ADDED')
elif etype == gp.GP_EVENT_UNKNOWN:
print('EVENT_UNKNOWN', etype, data)
print(type(data).__name__)
elif etype == gp.GP_EVENT_CAPTURE_COMPLETE:
print('CAPTURE COMPLETE')
elif not etype is None:
print('EVENT-----', etype, data)
if time.time() > reportat:
logger.info('time passed')
reportat += 10
except KeyboardInterrupt:
if gp2cam:
gp2cam.close()
sys.exit(0)