Synology NAS as Eye-Fi server

In theory, the a digital camera, an Eye-Fi wireless SD card, and a Synology NAS running Photo Station, should be a terrific combination for quickly putting snapshots online without giving up control over the image files (like you would with flickr, 500px, and friends). One would only need to put together some kind of server software on the NAS that accepts new images taken with the Eye-Fi card and puts them right into Photo Station.

Seriously, how hard can it be?

DISCLAIMER: As always, I take no responsibility for anything that happens because you follow these instructions – but you probably knew that. This is by no means a secure, production-level setup, but just me playing with stuff. Messing with your NAS’s root filesystem, as described below, is always done at your own risk, and the eyefiserver2 python script is not guaranteed to be secured against attacks, either. Don’t blame me. For anything. Ever.

The idea of hosting your own Eye-Fi server without having your pictures transferred all over the internet is not new – and thanks to the work of Jeff Tchang, David Grant, and others, there’s a Python-based piece of Ey-Fi server software that is able to link with an Eye-Fi card and download JPGs straight from the camera to a directory of your choosing. Detailed information about eyeserver2 can be found at http://code.google.com/p/eyefiserver2/.

Installing eyefiserver2

To set up eyesfierver2 on you Synology NAS, you need to

Install and set up PhotoStation (if you haven’t already) via the Package Center

Install the Python 2.7 package via the Package Center

Enable SSH access and login as ‘root’ (same password as ‘admin’)

Download eyefiserver2-DEV.tar.gz, untar it, and copy the files to their locations in the Synology’s file system; or simply

You’re looking for a 12-digit hexadecimal number (the MAC address) and a 32-digit hexadecimal number (the upload key).

Edit /etc/eyefiserver.conf on the NAS to reflect the MAC address and upload key you just found out (mac_0 and upload_key_0, respectively). Don’t put any separators between the bytes of the MAC address, just 00deadbeef00 to represent 00:DE:AD:BE:EF:00 is fine. Also, change the dir, uid, gid, file mode, and dir mode as follows:

Reboot your NAS, and you should be set. When taking a new picture, you should see appropriate activity in /var/log/eyefiserver.log.

Indexing new pictures

With the above steps, new pictures recorded on your Eye-Fi SD card will be transferred directly into the ‘new’ directory of the ‘photo’ share on your NAS. However, they will not yet show up in a ‘new’ album on your PhotoStation, because the NAS hasn’t included them in the media index yet. Files transferred via CIFS/SMB or AFP are automatically added to the index, but files coming in via NFS or from a program running on the NAS itself (like eyefiserver) are not.

To fix this, add the following to /usr/local/bin/eyefiserver.py:

Somewhere among the import statements at the top of the file (e.g., around line 60), add

import subprocess

After the line reading os.chmod(imagePath, string.atoi(file_mode)) (somewhere around line 609), insert the following:

Now, whenever eyefiserver is writing an image file to disk, it calls synoindex to immediately add it to the index, which in turn makes it appear in PhotoStation as well.

You may also want to set up appropriate permissions within PhotoStation to the ‘new’ album.

A word on performance

Eyefiserver2 shouldn’t be a drain on your NAS performance at all – but adding images to the index could be. This is because the media indexing service on the DiskStation will automatically create thumbnails and preview-sized versions of your images, so that they can later display quickly within PhotoStation. In the short-term, this causes significant load on the NAS’s CPU.

On my web-facing DS112j, which is about the slowest DiskStation you can buy from Synology, adding a 12MP JPG to PhotoStation including indexing at “normal” quality, takes roughly a minute – enough for casual pictures taken during an afternoon with the kids at home. If you come home with a card loaded with several dozens of pictures from a day out at the zoo, be prepared to wait a bit until they appear on your PhotoStation. Of course, a higher-spec Synology will help there, too.

If indexing lots of image files slows down your DiskStation (e.g. when moving them from your PC or Mac over to PhotoStation), you might also want to have a look at Michael Medin’s article about creating thumbnails via NFS.

8 Comments

Excellent, and much more comprehensive script than others lying around. Thank you very much for this, it is the reason why I bought an eye-fi card!

Thank you very much for posting this!

Posted by Arnaud on 4 Januar 2014 @ 6am

You’re most welcome, glad you could use it.

Posted by ennonymous on 4 Januar 2014 @ 7am

If you do not own a windows machine (for example, i use a chromebook); you can also lift the MAC address from your WLAN router.

Posted by Arno on 27 März 2014 @ 10pm

is there a way of just uploading images (including raw) to a defined drive on the NAS, without photostation integration ?