Does not save photos using auto-launch in crontab. I use Python 3 or raspistill, they work well for photos when a monitor is connected.
#!/usr/bin/python3
# BEFORE USING THIS SCRIPT.
# mkdir ~/timelapse
# mkdir ~/timelapse/completed
# this file should live in ~/timelapse and is run with command "python3 ~/timelapse/timelapse.py
import time
from picamera import PiCamera
from os import system
camera = PiCamera()
camera.resolution = (1920, 1080)
SleepTimeL = 1
FrameCount = 0
FrameStop = 240
WAIT = int(FrameStop)*int(SleepTimeL)/60
print('Photography will take approximately ' + str(WAIT) + ' minutes')
print('Taking photos now')
while (FrameCount < FrameStop):
print('Picture:' + str(FrameCount) + ' of ' + str(FrameStop))
camera.capture('image' + str(FrameCount).zfill(4) + '.jpg')
time.sleep(SleepTimeL);
FrameCount = FrameCount + 1
print('done')
and Bash script
#!/bin/bash
DATE=$(date +"%Y-%m-%d_%H%M")
raspistill -o /home/pi/camera/$DATE.jpg
I crate mkdir timelapse, cd ./timelapse; mkdir and file camera.sh After at Crontab, I did two different things not at same time. The first one I used: @reboot python3 /home/pi/timelapse/timelape.py &
. The first one I used the second: * * * * * /home/pi/camera.sh 2>&1
. Both cases wrote crontab: installing new crontab. Turn off, turn on only with power without monitor. I thought they worked, the green light flashed.
Whether to add to the script to store photos?