I wrote a small script to automatically switch between the cameras to take a picture in full resolution with each camera, this also works. But if I want to run this as a cronjob every 5 minutes, it does not change the cameras. can someone explain to me what I’m doing wrong?
#!/bin/bash
DATE=$(date +“%Y-%m-%d_%H%M%S”)
i2cset -y 10 0x24 0x24 0x02
libcamera-still -t 5000 --viewfinder-width 2312 --viewfinder-height 1736 -o /home/basti/timelapse/$DATE.jpg
sleep 5
i2cset -y 10 0x24 0x24 0x12
libcamera-still -t 5000 --viewfinder-width 2312 --viewfinder-height 1736 -o /home/basti/timelaps2/$DATE.jpg
sleep 5
i2cset -y 10 0x24 0x24 0x22
libcamera-still -t 5000 --viewfinder-width 2312 --viewfinder-height 1736 -o /home/basti/TL3/$DATE.jpg
sleep 5
i2cset -y 10 0x24 0x24 0x32
libcamera-still -t 5000 --viewfinder-width 2312 --viewfinder-height 1736 -o /home/basti/TL4/$DATE.jpg