Calendar: Assessing Raspberry Pi Camera Uptime

A while ago, I set up a couple of Raspberry Pi Zero cameras to make long-term time lapse movies. To recap: the idea was to take pictures every ten minutes and turn them into a movie. The process is totally automated so that every day, the photos from each Pi get saved to a server, and then processed into a movie that gradually gets longer and longer. At the end of the week, if the back up went OK, the photos get deleted from the Pi’s SD card.

A few crashes at the start of the project told me that I needed to solve the problem of keeping each Pi online (details are in the post). Now, almost a year on I wanted to check how often the camera had taken photos.

This can be done using the list of filenames, and a library called ggTimeSeries in R. There are over 45,000 files in this dataset so a programmatic approach was essential.

Apologies, my script is a bit messy so I’m not showing it here, only the result. I tried another library (openair) used by Helena Jambor in this post. It was easier to use than ggTimeSeries, but very slow at drawing the charts, so I went with ggTimeSeries.

Uptime of one camera

This camera went online at the start of the holidays in 2018 and I pulled the file list down in late September. Everything outside of those dates is dark blue. Uptime (exactly the correct number of pictures) is bright blue and any days with less than the correct number of images is darker.

Apart from some LAN problems in late January, this camera has been up almost every day! I know for sure that the camera crashed quite a few times over the year, but the restart daemon is fantastic at getting the Pi back online and maintaining the photo stream.

The post title comes from “Calendar” by The Fall from the Complete Peel Sessions.

One thought on “Calendar: Assessing Raspberry Pi Camera Uptime

Comments are closed.