Backup brewlog history from brewpi and create graphs for offline viewing.
- Dropbox account (a free account is fine)
- Assume logged in as user
pi
with default home at/home/pi
and default brewpi webdir at/var/www/html
. - Tested on Raspbery Pi 3 running
Raspbian (jessie) LITE
- Per-Day Fermentation Rate requires a Tilt Hydrometer. Backup HTML files should still work fine but the fermentation rates will be empty.
- Go to https://www.dropbox.com/developers/apps
- Click
Create app
- Choose an API: Dropbox API
- Access type: App folder
- App name: YOUR_APP_NAME
- this is a freetext field, type whatever name you like here
- The name you provide here will appear as a folder in the
Apps
directory of your Dropbox - Files backed up by the
sync
process below will be stored in this folder
- Click the
Create app
button - The new app will be created and will load the Settings screen.
- Look for the section titled
Generated access token
and click theGenerate
button. - Copy the access token
- Login to raspberry pi as user
pi
- Save the access token to
/home/pi/.dropbox_token
echo "DROPBOX-ACCESS-TOKEN" > /home/pi/.dropbox_token
- NOTE: Replace the text
DROPBOX-ACCESS-TOKEN
with the actual token generated above
- NOTE: Replace the text
cd $HOME
git clone https://github.com/andylytical/brewpi-backup.git
/home/pi/brewpi-backup/install.sh
- Logout and login again (this is required to reload user environment with modifications made during install)
python3 /home/pi/brewpi-backup/mk_brewlog_graphs.py
python3 /home/pi/brewpi-backup/sync.py
- The static HTML pages (created above) should now be sync'd to the folder in
Dropbox/Apps/YOUR_APP_NAME
- Double click one of the HTML pages to view it in your default web browser
- Create a cron job for running each command above
crontab -e
01 */4 * * * python3 /home/pi/brewpi-backup/mk_brewlog_graphs.py
12 */4 * * * python3 /home/pi/brewpi-backup/sync.py