Raspberry Pi as Eye-Fi Server

February 26, 2016

Raspberry Pi as Eye-Fi Server

At the time of this writing, there still isn’t an eyefiserver package in the stable Debian repository.  Sure, I could have enabled the testing repository and added the package that way, but since the installation only consists of adding a few files in certain locations, I’ll document the steps that I took:

First, grab the source eyefiserver off of the Debian web site:

https://packages.debian.org/source/testing/eyefiserver

Unzip the tarball, and copy the contents of /etc to the pi.  Copy /src/eyefiserver to the /usr/local/bin folder on the pi.

Edit /etc/eyefiserver.conf and change the eye-fi Mac address & upload key to match your Eye-Fi card:

[EyeFiServer]

# host name and port to listen on
# you can leave hostname empty for localhost

host_name:
host_port:59278

# To use this script you need to have your Eye-Fi upload key.
# You can find it after configuring the card,
# which you can currently on do on windows or mac
# It is inside C:Documents and SettingsApplication DataEye-FiSettings.xml on windows
# or ~/Applications Data/Eye-Fi/Settings.xml on mac
# search for it and paste it here:

[001856000000]
upload_key=00000000000000000000000000000000
upload_dir=/home/pi/Pictures/eye-fi/%Y-%m-%d

# Create XMP file with geolocation information based on access points
# detected by Eye-Fi card for any uploaded JPEG or RAW file
geotag_enable:1

# Use acces points detected within this period of time
# before or after photo was taken, in seconds
geotag_lag:3600

# Use acquired geolocation data with accuracy over this value, in meters
geotag_accuracy:140000

# The UID of the user that you want to own the uploaded images (if commented out, ownership of files will not be changed)
upload_uid:1000
# The GID of the group that you want to own the uploaded images (if commented out, group of files will not be changed)
upload_gid:1000
# The permissions to use for the uploaded images
upload_file_mode:420
# The permissions to use for the directories that are created
upload_dir_mode:509
Create /etc/systemd/system/eyefi.service:

[Unit]
Description=EyeFi Server

[Service]
Type=simple
User=pi
Group=pi
PIDFile=/var/run/eyefiserver.pid
ExecStart=/usr/local/bin/eyefiserver –conf=/etc/eyefiserver.conf –log=/var/log/eyefiserver.log

[Install]
WantedBy=multi-user.target
At this point we can start the service up:

systemd-tmpfiles –create

systemctl enable eyefi

systemctl start eyefi

systemctl status eyefi -l

And then test it’s working properly by taking a picture and tailing the /var/log/eyefiserver.log logfile. You should see some messages in the log and a JPG file appear in the eye-fi directory.

References

Going Paperless