Right in front of my window there's this wonderful tree which accompanies me through the seasons of the year. Year after year I think how great it would be to follow this noble tree through the year by taking pictures of it's day by day transformation.
So I developed TreeCam, which takes pictures of the tree in regular intervals and posts them on Twitter as well as uploads them to a FTP server.
This repository contains the software that you can use to set up your own TreeCam. It also comes with a reference implementation that shows how a TreeCam hardware can look like.
You can see the latest picture that my TreeCam device has taken at treecam.frederikheld.de.
My TreeCam device is posting pictures to twitter.com/fhdevlab automatically four times a day. I will also tweet timelapses and background information from time to time. Unfortunately not anymore.
If you are interested in the hardware I'm running, please have a look into the ./birdhouse
directory.
TreeCam is designed to run on a balenaOS powered Raspberry Pi, which makes it resilient against sudden power outages and also allows to run updates remotely via balenaCloud. TreeCam consists of different services that can be found in the subdirectories of ./src
.
The camera service is the main service of TreeCam. It takes pictures and posts them to Twitter and/or an FTP server and therefore requires a RasPi camera module.
Additional services are integrated via Git submodules:
balena-hvac is useful if you operate your camera outdoors and want to prevent damages through over-heating or condensation. It requires additional hardware!
wifi-connect and balena-reset can be used to manage the WiFi connection between the TreeCam and your home wifi via a captive portal and reset button. You don't need those services if you provide your WiFi credentials when downloading the image in balenaCloud or if you only want to use wired networking.
The configuration of the whole installment is done (as usual for balena multi-container apps) in the ./docker-compose.yml
file in the root level of this repository. The individual configuration of each services works slightly different. Please read the README.md
files of each service to learn about it. Each service also comes with their own exemplary docker-compose.yml
that you can use as templates.
TreeCam was designed with robustness and usability in mind, which led to the following design decisions:
-
The operating system is balenaOS which runs the different modules in Docker containers. It is very resilient against unexpected power loss and can be updated and maintained via balenaCloud.
-
This makes it easy to operate the device in places that are difficult to access. As long as there's a WiFi connection available, you're fine
-
The WiFi connection can be set up via a captive portal
-
The services can easily be configured via a central docker-compose file and the balenaCloud
-
New features and services can be added with moderate Python skills
See src/README.md for instructions how to setup your TreeCam device.
The RasPi Zero W would be the perfect device for this project because of it's low price and power consumption. Unfortunately downloading the containers from the balenaCloud will most likely fail on a low-spec device like the Zero due an issue with the balenaOS watchdog. See the related support thread here: https://forums.balena.io/t/persistent-failed-to-download-image-due-to-connect-econnrefused-var-run-balena-engine-sock-error/114001/14
I'd be happy to receive pull requests that add new features and services to TreeCam. For example features that upload pictures to other social media platforms or services that implement new use cases.
Please have a look into the issues on GitHub to see what else is planned that you could support with your skills and time.