Linux - bash script to download from Oly via WiFi

Started 7 months ago | Discussions thread
ForumParentFirstPrevious
Flat view
mchnz Contributing Member • Posts: 887
Linux - bash script to download from Oly via WiFi
11

If you don't understand the title line, then you should probably stop reading now.

I've written a bash script for my Linux PC that connects to the E-M1 II's WiFi and downloads the latest images (it also works on the E-M5-II and maybe others).

The script is based on the info from this dpreview forum post:

https://www.dpreview.com/forums/post/57165274

I've shared my bash script as a gist on github:

https://gist.github.com/digitaltrails/c1427da430701551ca233959e992754f

Here's the usage summary:

Usage: olyWifiSync [-d|-n|-f|-p|-h] ESSID PASSWORD [wifidevice]

Example: olyWifiSync E-M5II-P-XYZZY123 12341234

This script Mirrors SD contents to $HOME/SD-Mirror/$CAMERA_NET_ESSID. It only copies files they are not already in the destination folder. The ESSID and PASSWORD are those displayed on the camera LCD when wifi is enabled. In order to configure the WIFI device it requires sudo access to root. Pass -d to skip WIFI configuration, in which case root access is not required.

My PC normally has only a wired Ethernet connection. I had to plug in a wireless USB WIFI adapter and figure out how to get the script to configure WPA so that it didn't interfere with my existing Ethernet. I was able to run both the Ethernet and the WIFI because my Ethernet network isn't using 192.168.0.0 address block, so the camera could use it's set 192.168.0.1 address without interfering with any existing devices on my network.

The script uses wget commands to send the camera http requests such as

http://192.168.0.10/get_imglist.cgi?DIR=/DCIM/100OLYMP
http://192.168.0.10/DCIM/100OLYMP/PB270002.JPG
http://192.168.0.10/exec_pwoff.cgi

Googling olympus get_imglist.cgi or similar will hunt down quite a few other DIY efforts. I wrote my code in bash because it's more commonly understood than C++, python, and other languages.

My script was written on openSUSE Leap 42.3, but it shouldn't be too hard to get it running on other Linux systems.

If you write your own scripts, you do have to take a bit of care. For example, if you were to write you own code to command an exec_shutter, depending on the option you select, the camera may keep taking photos until you write some code to command it to stop (or turn the camera off).

The one problem I'm seeing is the connection seems rather slow. Each wget is achieving about 1 Mbyte/second. This is surprising because wget is normally very fast. I suspect it's a problem specific to my wireless adapter or the way it's configured (an Edimax EW-7811Un).

I may not tinker much more with the script.  I normally download from a USB3 SD Card reader.  The WIFI based download was intended for when I do a small amount of shooting at home (partly to prevent me from forgetting to put the card back in the camera).

Olympus E-M1
If you believe there are incorrect tags, please send us this post using our feedback form.
ForumParentFirstPrevious
Flat view
ForumParentFirstPrevious
Keyboard shortcuts:
FForum PPrevious NNext WNext unread UUpvote SSubscribe RReply QQuote BBookmark MMy threads
Color scheme? Blue / Yellow