Test it without setting the long exposure time or sensor_mode. Everything takes a fair while with long exposures.
If you read the
docs, then all examples will start with enabling preview, yet you haven't. I fail to see why you are therefore inserting the 30 second delay as I don't think it will do anything other than just wait doing nothing.
Actually it looks like things aren't being cleaned up tidily. When on 6 second exposures things take a long time, and it looks like some things may be timing out. I suspect that some ports aren't being disabled cleanly before ditching the component.
Inserting a 6 second delay seems to be vaguely reliable to ensure everything is idle.
Code: Select all
from picamera import PiCamera
from time import sleep
from fractions import Fraction
camera = PiCamera()
camera.sensor_mode = 3
camera.shutter_speed = 600000
camera.framerate = Fraction(1,6)
camera.resolution = (2592, 1944)
camera.iso = 800
camera.start_preview()
sleep(30)
camera.exposure_mode = 'off'
camera.capture('dark.jpg')
camera.stop_preview()
sleep(6)
camera.close()
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.