RaspiOS IR Camera Buster

Hey All,

Previously I had a usb camera using fswebcam , just taking a photo of the rollerdoor every 5 min and Rcloning that to google drive, so when the mrs or I are out i can see if its gone down… Need to use the USB Camera to WFH again , so i brought a IR Camera.

It works and I can take photo’s. . . my issue it libcamera, as fswebcam doesnt like to play with raspi camera. for the life of me i cannot get libcamera to increment the filename to a directory and just overwrites the previous file. I can get --datetime to work , but i cant get it to output to my chosen file directory

libcamera-still -n --datetime -o /home/pi/shared/Rollerdoor%d.jpg

once i get increments going , i’ll just add it to a script that i use in my crontab -e (which worked previously)

2 Likes

i don’t know if its weird like this … but if i add the command in a script, it will dump the --datetime in the parent folder of the script. so current work around and so far best solution is to create a libcamera.sh with:

#!/bin/bash
if pidof -o %PPID -x “libcamera.sh”; then
exit 1
fi

#Supposed to Delete old files prior to uploading to Google Drive
find /home/pi/shared/ -mtime +0 -type f -delete

#libcamera to take photo
libcamera-still -n --datetime

exit

then run this and hopefully delete after a day. I can then work on rcloning and adding the two scripts to crontab -e with :

*/5 * * * * /home/pi/shared/libcamera.sh >/dev/null 2>&1

5 Likes

So after setting the crontab -e job , it now appears to executes the command external of the script and is dumping the files in the /home/pi directory again facepalm

3 Likes