Dropbox upload of Cacti graphs and webcam photos
This is an example configuration of uploading images to Dropbox from a Raspberry PI. The images are then linked to a Google sites webpage.
Raspberry PI running Raspbian operating system
A webcam connected to the Raspberry PI
Dropbox account with an API key
Create a folder for storing the images and scripts. On the Raspberry PI command line
Start by downloading the Dropbox uploader from Github and configuring it: https://github.com/andreafabrizi/Dropbox-Uploader
At this point you must have created your Dropbox API key here: https://www.dropbox.com/developers/apps
Next start the dropbox_uploader for the first time to create the config file. Enter the API key and secret and follow instructions to configure.
Note that the dropbox uploader configuration file is created in users home directory ~/.dropbox_uploader. This means that the cron task must be running as this user and cannot be added to cron.hourly without modifications.
Three scripts are created to make this work, they could be run in just one script, but this allows them to be timed differently.
This script takes a snapshot with the webcam using fswebcam. Start by Installing fswebcam
Create script using your favourite text editor in /home/pi/scripts/snapshot.sh
The script creates a logical link to the latest snapshot that is used on the Google sites website.
Image upload script
Create a file to export daily graphs from Cacti and upload everything to Dropbox
This script uploads yesterdays images to a folder in Dropbox and removes them from Raspberry PI
Add rights to execute the scripts
Create Cron jobs for user PI
Make a cron job to upload photos every hour and take a snapshot every 10 minutes
Start crontab editor
Add the following lines to the end of the file
Dropbox direct link on your website
Dropbox direct link can be then done according to Dropbox instructions: https://www.dropbox.com/help/201/en
An example of this setup can be seen in action on the main page: http://greenhouse.mydigital-home.com