前言

本人使用的是尼康D750,自带wifi功能,奈何配套的Android App太难用了,至于怎么难用,我这里就不细说了,用过的都懂。总不能白瞎了wifi功能吧。找了一阵子发现了两个第三方通过逆向工程制作的工具。一个是qDslrDashboard这个app,功能很强大,可以通过手机控制相机,也可以浏览下载相机的照片,还可以协助拍摄延时摄影。另一个就是Airnef,一个python脚本。对PC端有封装GUI。可以实现照片拷贝下载,将指定时间点之后的照片下载下来,不会重复下载已删除的照片,可以实时同步拍摄的照片。完全可以替代原厂渣渣的配套App。所以我就通过Termux搭建Python环境来运行Airnef

上面介绍的两个工具索尼和佳能带有wifi功能的相机也能使用

这样我在手机上就非常轻松的实现了同步单反中jpeg照片功能。这里简单的做一下使用介绍

1. 使用Termux搭建Python运行环境

建议安装oh-my-zsh,不想安装的可以跳过

sh -c "$(curl -fsSL https://github.com/Cabbagec/termux-ohmyzsh/raw/master/install.sh)"
pkg update
pkg install python

2. 下载解压Airnef到Android手机中

下载地址:http://www.testcams.com/airnef/Version_1.1/airnef_v1.1_Source.zip
我将脚本放在 /sdcard/scripts/airnef/airnefcmd.py

cd /sdcard
mkdir scripts
cd scripts
wget http://www.testcams.com/airnef/Version_1.1/airnef_v1.1_Source.zip
unzip airnef_v1.1_Source.zip
rm airnef_v1.1_Source.zip

3. 帮助说明

$ python /sdcard/scripts/airnef/airnefcmd.py -h
airnef v1.1 - Wireless transfer of images/movies for Nikon cameras [GPL v3]
Copyright (c) TestCams.com, Time: 01/18/19 22:55:06, Py: 3.7.2, OS: Linuxusage: airnefcmd.py [-h] [--ipaddress addr][--action {getfiles,getsmallthumbs,getlargethumbs,listfiles}][--realtimedownload {disabled,afternormal,only}][--extlist extension [extension ...]] [--startdate date][--enddate date] [--outputdir path][--ifexists {uniquename,skip,overwrite,prompt,exit}][--downloadhistory {skipfiles,ignore,clear}][--onlyfolders camera_folder [camera_folder ...]][--excludefolders camera_folder [camera_folder ...]][--filenamespec spec] [--dirnamespec spec][--transferorder {oldestfirst,newestfirst}][--slot {firstfound,first,second,both}][--cameratransferlist {useifavail,exitifnotavail,ignore}][--downloadexec executable [arguments ...]][--downloadexec_extlist extension [extension ...]][--downloadexec_options option [option ...]][--realtimepollsecs seconds][--logginglevel {normal,verbose,debug}]Wifi image transfer utility for Nikon cameras (airnef@hotmail.com)optional arguments:-h, --help            show this help message and exit--ipaddress addr      IP address of camera. Default is "192.168.1.1"--action {getfiles,getsmallthumbs,getlargethumbs,listfiles}Program action. Default is "getfiles"--realtimedownload {disabled,afternormal,only}Download images from camera in realtime as they'retaken. 'afternormal' means realtime capture startsafter regular image download. 'only' skips normaldownload and only captures realtime images. Default is"disabled"--extlist extension [extension ...]Type of image/file(s) to download. Ex: "--extlistNEF". Multiple extensions can be specified. Use"<NOEXT>" to include files that don't have extensions.Default is to download all file types--startdate date      Only include image/file(s) captured on or later thandate. Date-only Ex: --startdate 12/05/14. Date+TimeExample: --startdate "12/05/14 15:30:00"--enddate date        Only include image/file(s) captured on or earlier thandate or date+time. Date without a specified time isinclusive, so for example --enddate 06/12/14 isinterpreted as 06/12/14 23:59:59--outputdir path      Directory to store image/file(s) to. Default iscurrent directory. No ending backslash is necessary.If path contains any spaces enclose it in doublequotes. Example: --outputdir "c:\My Documents"--ifexists {uniquename,skip,overwrite,prompt,exit}Action to take if file with same name already exists.Default is "uniquename"--downloadhistory {skipfiles,ignore,clear}'skipfiles' means that files in history (ie,previously downloaded) will be skipped and notdownloaded. Default is "skipfiles"--onlyfolders camera_folder [camera_folder ...]Only include image/file(s) existing in specifiedcamera folders.. Ex: "--onlyfolders 100D7200101D7200". Default is to include all folders--excludefolders camera_folder [camera_folder ...]Exclude image/file(s) existing in specified camerafolders.. Ex: "--excludefolders 103D7200". Default isno exclusions.--filenamespec spec   Optionally rename files using dynamic renaming engine.See online help for documentation on 'spec'--dirnamespec spec    Optionally name directories using dynamic renamingengine. See online help for documentation on 'spec'--transferorder {oldestfirst,newestfirst}Transfer oldest or newest files first. Default is"oldestfirst"--slot {firstfound,first,second,both}Card slot on camera to read from. Default is"firstfound", which means first populated slot--cameratransferlist {useifavail,exitifnotavail,ignore}Decide how to handle images selected on camera.Default is "useifavail"--downloadexec executable [arguments ...]Launch application for each file downloaded--downloadexec_extlist extension [extension ...]Type of files(s) by extension on wich to perform--downloadexec on. Default is all file types--downloadexec_options option [option ...]Options for launcing application. For example 'wait'waits for launched app to exit before proceeding tonext download. See online help for more options--realtimepollsecs secondsHow often camera is polled for new images in realtimemode, in seconds. Default is every 3 seconds--logginglevel {normal,verbose,debug}Sets how much information is saved to the result log.Default is "normal"Options can also be specified from a file. Use !<filename>. Each word in the
file must be on its own line.You can abbreviate any argument name provided you use enough characters to
uniquely distinguish it from other argument names.Command-Line Examples:airnefcmd.py --extlist NEF MOV (download only raw images and MOV files)airnefcmd.py --downloadhistory ignore (dont skip files previously downloaded)

4. 使用别名简化脚本使用

~/.zshrc 文件中加入(如果不是使用zsh作为默认shell的话,则在~/.bashrc中加入)

#获取今天的日期,这里只拷贝今天的
date=`date +'%m/%d/%y'`
#实时拷贝拍摄的照片到手机
alias airnef_realtime="python /sdcard/scripts/airnef/airnefcmd.py --action getfiles --ipaddress 192.168.1.1 --realtimedownload only --logginglevel normal --extlist NEF JPG --outputdir /sdcard/DCIM/NIKON --ifexists skip --slot second --transferorder oldestfirst --cameratransferlist ignore --downloadexec sh /sdcard/scripts/airnef/previewImage.sh \"@pf@\""
#拷贝今天拍摄的照片到手机
alias airnef_copy_today="python /sdcard/scripts/airnef/airnefcmd.py --action getfiles --ipaddress 192.168.1.1 --realtimedownload disabled --logginglevel normal --extlist NEF JPG --outputdir /sdcard/DCIM/NIKON --ifexists skip --slot second --transferorder oldestfirst --startdate ${date} --cameratransferlist ignore --downloadexec sh /sdcard/scripts/airnef/scanner.sh \"@pf@\""
#拷贝所有新照片
alias airnef_copy="python /sdcard/scripts/airnef/airnefcmd.py --action getfiles --ipaddress 192.168.1.1 --realtimedownload disabled --logginglevel normal --extlist NEF JPG --outputdir /sdcard/DCIM/NIKON --ifexists skip --slot second --transferorder oldestfirst --cameratransferlist ignore --downloadexec sh /sdcard/scripts/airnef/scanner.sh \"@pf@\""
#拷贝所有新照片,并将监听实时拍摄的照片
alias airnef_copy_realtime="airnef_copy && airnef_realtime"

实现图片预览的脚本
/sdcard/scripts/airnef/previewImage.sh

#!/system/bin/sh
echo "Preview Image"
#媒体扫描
am broadcast -a android.intent.action.MEDIA_SCANNER_SCAN_FILE -d file://$1 > /dev/null 2>&1 &
am start -a android.intent.action.VIEW -t image/jpeg -d file://$1 > /dev/null 2>&1 &

媒体扫描脚本
/sdcard/scripts/airnef/scanner.sh

#!/system/bin/sh
am broadcast -a android.intent.action.MEDIA_SCANNER_SCAN_FILE -d file://$1 > /dev/null 2>&1 &

5. 使用

连接相机wifi,然后打开termux,运行命令

通过单反wifi同步照片到Android手机——使用Airnef Python脚本相关推荐

  1. python程序能不能在安卓手机上跑-把旧android手机变成跑python的服务器

    把旧android手机变成跑python的服务器大致的思路是把android手机当linux主机用. 所以我们先要shell到手机,然后在手机上搭建python运行的环境,这样我们就能够把写的pyth ...

  2. win7 cmd终端连接android手机运行adb shell脚本命令

    win7 cmd终端连接android手机运行adb shell脚本命令 (2013-03-22 20:13:57) 转载▼ 标签: android it shell 连接 linux 分类: 嵌入式 ...

  3. python写手机脚本脱离电脑_在手机里编写python脚本控制手机

    今天我有一个大胆的想法,想在手机里面编写python脚本自动化控制手机.既然有了这么大胆而想法,而且我还能实现,那么就有了我现在这篇文章. 如何在手机里面编程 首先先介绍一款能直接在手机里面运行代码的 ...

  4. 手机写python脚本_手机python在手机里写python脚本控制手机,神!

    一说起写代码,大家所想到地就是在电脑键盘上面敲.其实不然,在移动端飞速发展地今天,我们是可以在手机上编写代码的.今天,编玩编学网就给大家科普下手机python的知识,想在手机里面编写python脚本自 ...

  5. android同步功能吗,Android手机和iCloud同步是什么鬼?

    这两天,ZUK又火了一把,Z2既熟悉又陌生的外观和1799的价格足够吸引人. 发布会后,有不少小伙伴给编辑君留言,想知道Z2/Pro可以同步iCloud,这是肿么一回事呢? 编辑君对这个功能没什么感觉 ...

  6. 两部苹果手机同步照片_安卓手机里的便签怎么导到苹果手机?安卓和苹果手机便签同步...

    很多手机厂商的手机操作系统都是基于安卓系统开发的,自由度很高,受到了很多用户的喜爱,在安卓手机里可以通过便签软件记录各种待办事项和计划安排.当安卓手机用旧了,换成苹果手机的时候,安卓手机里的便签怎么导 ...

  7. qpython手机kivy库_QPython Android Kivy,从python脚本启动python脚本

    首先,如何打开命令提示符(bash) 实际上qpython=终端仿真器+Python代码编辑器+Python解释器. 所以你当然可以使用控制台!为什么不能输入bash是因为每次在qpython中单击控 ...

  8. 安卓手机运行python程序的软件-安卓手机定时运行python脚本

    话说现在智能手机的计算能力严重过剩啊,不玩游戏.不打电话.不刷微信时,要充分利用手机的计算潜力为我所用.完全可以把一些台式电脑上的计算任务移到手机上来运行.python就是一个很好的跨平台的解决方案. ...

  9. android调用python框架_在Java中从Android应用程序执行Python脚本?

    我正试图找到一种在Android中从Java代码执行Python脚本的方法.我对这个问题做了一个研究,但我发现的唯一问题是,如何在APK for android(Kivy e.t.c.)中转换pyth ...

最新文章

  1. 如何估算各种物体的重心
  2. 用c语言编写通讯录程序,学C三个月了,学了文件,用C语言写了个通讯录程序
  3. mysql批量插入定时器
  4. Stanford UFLDL教程 微调多层自编码算法
  5. Jerry带您了解Restful ABAP Programming模型系列之三:云端ABAP应用调试
  6. php第三方登录代码,thinkPHP5项目中实现QQ第三方登录功能
  7. pyqt5 获取Qlabel中的图片并对其进行处理(包括Qimage转换为Mat)
  8. Golang Web入门(3):如何优雅的设计中间件
  9. 安装Oracle 11g 出现交换空间不够
  10. failed to fetch url linux,ubuntu apt-get下载报failed to fetch错误,请问如何解决
  11. SQL Server schema 用法
  12. 【转】【Python】Python网络编程
  13. Mcafee(麦咖啡) 无法升级的解决办法 附:进程详解,设置指南
  14. 经纬度转换,度转度分秒,度分秒转为度,前端js
  15. 居然有比冰点更好的文库下载神器,能下载文库源文档?
  16. 小天鹅全自动洗衣机的PLC控制
  17. JavaScript广告图片跟随滚动
  18. cortex m3 寄存器
  19. linux常用桌面有两种,推荐!5款Linux常用桌面环境
  20. mac拷贝图片window打不开

热门文章

  1. [视频]老罗涂着李佳琦的口红,漂亮得不像实力派!4-1直播你看好吗?
  2. chrome进行书签和密码的导入导出
  3. 太阳能光伏价格到顶 11月下旬报价走软
  4. Java中Map集合的使用
  5. vue 页面转pdf 并下载
  6. Enigma Protector脱壳
  7. 场景风控的商户监控,这两大数据指标掌握了吗
  8. 【信号处理】基于Matlab实现POSP驻定相位原理推导线性调频信号的频谱
  9. 一周学会小程序开发-20篇自学教程值得收藏
  10. 微信小程序学习4:小程序语法 - 事件绑定