Phtobx is a system that allows you to manage and sync your photo library. The main component is a Raspberry Pi (or other Linux device) acting as a NAS and syncing photos to and from Eye-Fi and Dropbox.
Photos are added to Phtobx via the network drive (Samba), via Eye-Fi/FTP, or via Dropbox upload from your cell phone. Phtobx then creates downscaled versions of the photos that are available on a network drive on the local network and through a web interface. Outside of the local network photos, are available on Dropbox.
If a photo is deleted from one place all versions of that photo are removed. New photos or deletions are synced automatically.
Features
- Home network access via Samba and local web server.
- Access from everywhere via Dropbox.
- New or deleted photos are synced automatically.
- Scaled down versions of photos created to ease access.
- All files stored in ordinary folders on removable media that can be plugged into an ordinary computer for backup and organisation.
What you need
- A Raspberry Pi
- An Eye-Fi card
- A Dropbox account
- An FTP account
NB This software is not thoroughly tested and might not work as intended. Use at your own risk.
sudo raspi-config and selecting "Advanced options" > "Memory Split"" and input 16wget http://f9.no/phtobx/phtobx.tar.gz tar -xzf phtobx.tar.gz Go to http://www.dropbox.com/developers/apps and create a "Dropbox API App" with access to files and datastores, not limited to its own private folder (to enable photo download sync), with specific file types set to images. Give it a name (e.g. "your name phtobx"), and copy the values for App Key and App Secret to the phtobx/config.py
Update system and install necessary third party packages
Update the Linux system and install the Python module installer
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python-pip
Install lftp (used to download photos from ftp)
sudo apt-get install lftp
Install ImageMagick used to convert photos
sudo apt-get install imagemagick
Install JHead used to make sure orientation is correct on photos
sudo apt-get install jhead
Install Python Dropbox client
sudo pip install dropbox
Install Flask (web framework)
sudo pip install Flask
Install Samba
sudo apt-get install samba samba-common-bin
sudo mkdir -p /home/shares/photos/ sudo sh -c 'echo "/dev/sda1 /home/shares/photos auto owner,user,iocharset=utf8,umask=000 0 0" >> /etc/fstab' sudo mount -a[Photos] path = /home/shares/photos create mask = 0660 directory mask = 0771 read only = no sudo useradd photo -m -G userssudo passwd photo sudo smbpasswd -a photo sudo /etc/init.d/samba restart Further information can be found here.
Ensure that folder for logs etc are writable
chmod 777 phtobx/.
chmod 777 phtobx/*.*
Create folders for storing the photos (folders as defined in config.py)
sudo chmod 777 /home/shares/photos/
mkdir /home/shares/photos/original
mkdir /home/shares/photos/medium
mkdir /home/shares/photos/thumb
mkdir /home/shares/photos/_trashcan
mkdir /home/shares/photos/_camera
mkdir /home/shares/photos/_phone
Create a symbolic link between web root and photo share
ln -s /home/shares/photos/ phtobx/static/img
This is probably a good time to reboot your raspberry pi
sudo reboot (somethimes also windows machines needs a reboot before they can find new samba drives)
If everything seems to be working it is time to add the scripts to the crontab to make sure that they run automatically
Add the following entries to your crontab
*/5 * * * * python /home/pi/phtbox/sync.py >> sync.log 2>&1
@reboot sudo python /home/pi/phtbox/httpd.py > /dev/null 2>&1 &
There is good explanation of how to add stuff to crontab here.
Explanations:
Line 1: Runs the main Python script that synchronizes with Dropbox/Eye-Fi and creates thumbnails every 5 minutes.
Line 2: Starts the Flask http service. Needs to run as root since the http service is using port 80.
sudo reboot
None
Phtobox is licensed under MIT