Getting an Eye-Fi X2 Pro Card Working on Linux vs. Mac

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:

  1. Insert the card into the computer
  2. Start to install the software needed directly from the SD Card – nice touch!
  3. The software checked the Internet and downloaded the latest version seamlessly during the install
  4. 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
  5. 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).
  6. 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.
  7. 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.

  1. Wikipedia search – I always tend to start there for unbiased and relatively recent information and resources
  2. 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.
  3. Discover that someone forked that old server and created a version 2 that still lacks some functionality but gets things done
  4. Discover that someone wrote a Perl server that could also work
  5. Discover that someone wrote a ruby server that could also work
  6. Discover that someone wrote a C++ server that could also work
  7. 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)
  8. 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!
  9. 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?
  10. 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 …
  11. 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!
  12. 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.
  13. 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.
  14. 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 …
  15. 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.
  16. Decide to get it working on the server instead, since the Photos are directly accessible there anyways.
  17. Upload to server and try to run, discovering that the server needs more of those Perl modules installed, no problem.
  18. 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?
  19. Learn a little bit about upstart, the Ubuntu distro’s choice of boot management.
  20. 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
  21. Hey it works!  I can start and stop the job, and it starts automatically after a reboot!
  22. 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.
  23. Learn more about upstart’s ability to run jobs as specific users or group
  24. Try to set the group and user in the upstart job, but it fails to start
  25. 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.
  26. Symlink to the main config file from the user’s home/.init folder
  27. 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
  28. 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
  29. 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

Leave a Reply

Your email address will not be published. Required fields are marked *