Docker image to run airnef continuously
4.0K
This fork will run airnef continuously. Setup to run on a Synology NAS or other server so that, at any time, files can be downloaded to the NAS by initiating a transfer from the camera. This is quite useful for a home hobby studio. Tested with a Sony a5000.
The OTHERARGUMENTS environment variable can be used to pass any other arguments you want to set to airnefcmd; if you don't want to pass any arguments, enter "none" (no quotes). See the airnef documentation at https://www.testcams.com/airnef/ on Archive.org (the original site is defunct).
The entry point uses a script to determine whether or not to pass the OTHERARGUMENTS env variable to airnefcmd. This image is built using the original python airnef sourcecode, modified slightly---to clean up the console output since that shows up as the log file in Docker, and to loop the main process rather than exiting after a transfer as the original command line utility did.
Note that I also added a hack (not well, but it works) where you can include #SESSION# in your output path, and it will increment this value starting at 1 until it finds a unique path. If there is an issue and the download session doesn't complete (i.e. you have to hit cancel on the camera and initiate the transfer again) it will continue downloading files to that folder until the session completes successfully. If this option is used, it will also create an empty text file in that folder named complete.txt when the session has finished. I use this in conjunction with another python script to process and rename uploaded images, but I don't want that script to process a folder until all imaged in the session have finished transferring.
Examples:
In a Docker manager GUI, simply add the image as a container, map a volume from your desired output folder to \output and your docker settings folder to \appdata, set any options in the ENV variables, and ensure that the network it uses can see devices on your local network.
From the command line:
docker run -d
--name docker-airnef-service
--restart always
-e IPADDRESS=auto
-e REALTIMEDOWNLOAD=disabled
-e EXTLIST=JPG
-e CAMERASLEEPWHENDONE=yes
-e RERTYDELAYSECS=2
-e FILENAMESPEC=@capturefilename@
-e DIRNAMESPEC=@capturedate_y@-@capturedate_m@-@capturedate_d@
-e OTHERARGUMENTS=none
-e TZ=America/Denver
-v /mnt/photos/Syncs/Camera:/output
-v /docker/airnef/appdata:/appdata
gitkdf/docker-airnef-service
Content type
Image
Digest
sha256:6049a8c48…
Size
43.1 MB
Last updated
10 months ago
docker pull gitkdf/docker-airnef-service