I recently had the pleasure of figuring out how to get a new gift for Alisa working in my technology environment. The hoops I had to jump through are documented here for later reading, but also as a demonstration of what I mean when I say Linux will only be ready for the masses when the hardware supports it.
The Eye-Fi card is an SD Card that also contains a wireless adapter. It has the ability to connect to wireless networks and upload the pictures on the camera to some other storage like a computer or server. Great concept! It is supported on Windows and Mac, so let’s see what that really means.
On a MAC I did the following to get this working:
- Insert the card into the computer
- Start to install the software needed directly from the SD Card – nice touch!
- The software checked the Internet and downloaded the latest version seamlessly during the install
- The new software noticed my card needed a firmware update, so retrieved that and applied it. So far I’ve just clicked a bunch of “OK” buttons
- I was asked to create an account on the Eye-Fi website – this is a necessary evil for any OS, though once you create an account you are given a key you can use and never have to interact with their servers again (mostly).
- The software presented a Wizard interface of sorts that let me configure pretty much every aspect of the card, connect to my wireless network, specify different locations for jpgs, raw, movies etc. I could specify where I want images saved to on my Mac and under what folder-naming scheme. I could enable or disable aspects of the card like Geotagging – all within the one interface. Yes the interface was clunky and slow (looking at you Adobe Air), but everything was there.
- Pulled the card out and snapped a few pictures – blammo, there they are. Even has a nice preview in the notification on the Mac when the image starts to upload. A nice final touch is there is an icon on the camera itself that shows when things are uploading.
All in all a very smooth experience. If I wanted to store my pictures on a computer, and the computer was a Mac or Windows this would be awesome place to leave off. Sadly our story continues into Linux-ville, where the card is only supported through community efforts fighting against the manufacturer as they change their APIs and how they upload images without any documentation to speak of.
Well to be honest Eye-Fi has documented parts of their protocol which has allowed the community the chance to build some basic software that does parts of what the commercial software does. Let’s see how this goes then.
- Wikipedia search – I always tend to start there for unbiased and relatively recent information and resources
- Discover that there is an old python server that could be installed that would allow file transfer but none of the nice things like Geotagging, etc. Note that the software was no longer maintained.
- Discover that someone forked that old server and created a version 2 that still lacks some functionality but gets things done
- Discover that someone wrote a Perl server that could also work
- Discover that someone wrote a ruby server that could also work
- Discover that someone wrote a C++ server that could also work
- Try to understand all the points made in the Wikipedia article but find all the terminology confusing (though looking at it now as I write this, a lot of my discoveries were clearly stated there and it makes much more sense to me now)
- Decide this is way too complicated, didn’t the card support FTP? I have an FTP server! I could just upload directly to my NAS that way! The card also supports uploading to a Gallery2 installation, which I also have. Hey I’ve got some options!
- Look into how to configure this and get it all working. Set up the FTP server and test logging in from my desktop – yup works. Configure the card to upload to FTP, take a picture, and wait …. hmm, that didn’t work. Why not?
- Do some more reading online and discover, to the best of my knowledge, that the images are not uploaded directly to the FTP. Rather they must first upload to the Eye-Fi company’s server, and their server then logs into the FTP and copies the images there. Really? I need to share with you my login credentials (obfuscated or not) and open up firewall ports to allow external connections from servers I don’t know? Seriously? Same for the Gallery? How could anyone think that is a good solution instead of just allowing me to upload directly? They need to get a better product manager! Moving on …
- Decide to try the Perl server because I speak a bit of Perl so can more easily troubleshoot it if things go south. I also suspected that my server would have a sufficient Perl environment going that would require minimal dependency installation. Also read about a Synology fork of the Perl server that would allow me to install it directly on the NAS I use to store pictures in a RAID structure. Nice!
- Download and try rifec, the Perl server. Manage to get the dependencies installed, the server configured, firewall ports opened, and it needs some kind of upload key.
- Google a little more and find out that the card uses its MAC to identify itself, and an upload key to restrict unknown cards from connecting to the server. How do I get my upload key? That’s what the registration with the Eye-Fi online service gives me, but it is hidden away on the Mac’s software. So I have to find a Settings.xml file on my Mac in a hidden folder and copy the key from that. So this card will simply not be functional unless you first install the software on Windows or Mac to get your upload key. Thumb in the eye of Linux users everywhere.
- OK, finish the configuration. I then figure out the command line (it doesn’t look in the local directory for its config file and I’m not sure where the default location is, so I manually specify it on the command line) It works! Wow that’s awesome stuff! But I don’t want it on my desktop. So now about that Synology fork …
- Download and try to compile the Synology fork. Some of the bundle Perl modules have changed so when I try to get it running on my NAS it fails. Here’s an issue I filed with the author to find out if I was doing something wrong. Awesomeness of Open Source – the author replied directly within 1 hour from across the world. Sadly the software works for him and he can’t commit to when he’d have time to update it for my environment. Nuts. OK, forget the NAS for now.
- Decide to get it working on the server instead, since the Photos are directly accessible there anyways.
- Upload to server and try to run, discovering that the server needs more of those Perl modules installed, no problem.
- Now it is working on my server! Sweet! But I want this to be launched automatically when I reboot the server, so it is totally hands off. How do I do that?
- Learn a little bit about upstart, the Ubuntu distro’s choice of boot management.
- Create an upstart job, in the process discovering that using the –daemonize option of the Perl script actually screws upstart up. Turn off the –daemonize option so it can be daemonized by upstart
- Hey it works! I can start and stop the job, and it starts automatically after a reboot!
- Hold on, it is saving those images as the root user, which means nobody else on the system can access and manage them properly. Sigh.
- Learn more about upstart’s ability to run jobs as specific users or group
- Try to set the group and user in the upstart job, but it fails to start
- Discover via increasing the upstart logging and looking at the upstart log instead of dmesg that using the setUID option makes it look for a config file of some sort in a hidden directly in that user’s home. OK, that wasn’t documented anywhere.
- Symlink to the main config file from the user’s home/.init folder
- Hey, the job starts! But images are not being saved under the right UID. Remember that I’m working with Linux, where user management across systems can be horrible
- Review the NAS and server users and groups to see if there are some in common that could be understood across all. For example group kirk on the NAS could be id 1000, on the server it is id 502, and on my desktop where I actually do photo management it could be id 702. So saying “kirk” owns something on the NAS means user “502” owns it on the server and user “702” owns it on my desktop. I really should try to fix that sometime in the future
- Find a group in common that will work well enough, update the job, and presto – it works!
I tested with videos and jps, this is really slick. It does not support the geotagging but I didn’t want to use that anyways as I understand it drains batteries really quickly on the camera.
So I think I have it working and I hope it is as seamless as testing indicates it will be. Big thanks to the Open Source community for putting together the software and resources to help me get here. Big raspberry in the face to Eye-Fi for not supporting Linux. Just because we are capable of jumping through these hoops, please stop making us do it. I would much rather spend 15 minutes getting it working than 10 hours. If I could buy a FLOSS-friendly version of this card from some other manufacturer I will next time.
Note to self: there might be a Python Synology server I could try if this doesn’t work out well