奥林巴斯相机套件蓝牙唤醒

时间:2016-09-01 13:22:12

标签: python raspberry-pi bluetooth-lowenergy olympus-camerakit olympus-air

我正在处理一个Python脚本,该脚本注定要在Raspberry Pi上运行,Raspberry Pi通过WiFi远程控制Olympus Air A01相机。 WiFi控件工作正常,但我也希望脚本能够远程打开相机。

据我所知,这只能通过蓝牙LE完成,但OPC SDK并未提供有关如何完成此操作的详细信息。我认为在iOS / Android下进行开发时,唤醒"唤醒" Java方法用于此目的,但同样没有关于此方法究竟是什么传输到摄像机以使其启动的详细信息。

我一直在尝试使用Bluez / Gatttool,并列出了相机的服务和句柄清单,但不知道哪个句柄可以写什么以及我应该写什么值来唤醒相机。

有没有人能够在不使用OPC SDK的情况下通过蓝牙LE打开相机?

谢谢!

1 个答案:

答案 0 :(得分:1)

所以我最终模仿Olympus Android App和相机之间的流量,同时打开它,我现在能够使用Gatttool唤醒相机发送相同的值。

这是唤醒相机的最小Gatttool序列:

sudo gatttool -b 90:B6:86:XX:YY:ZZ -I
connect
primary
char-desc
char-write-req 0x0013 0001
char-write-req 0x0016 0001
char-write-req 0x0019 0001
char-write-req 0x0012 0101090c01023132333435364400
char-write-req 0x0015 0202000000
char-write-req 0x0012 0102040f0101021300
char-write-req 0x0015 0203000000
exit

编辑:

在python中可以实现同样的目的:

import os
os.system('gatttool -b 90:B6:86:XX:YY:ZZ --primary')
os.system('gatttool -b 90:B6:86:XX:YY:ZZ --char-desc')
os.system('gatttool -b 90:B6:86:XX:YY:ZZ --char-write-req --handle 0x0013 -n 0001')
os.system('gatttool -b 90:B6:86:XX:YY:ZZ --char-write-req --handle 0x0016 -n 0001')
os.system('gatttool -b 90:B6:86:XX:YY:ZZ --char-write-req --handle 0x0019 -n 0001')
os.system('gatttool -b 90:B6:86:XX:YY:ZZ --char-write-req --handle 0x0012 -n 0101090c01023132333435364400')
os.system('gatttool -b 90:B6:86:XX:YY:ZZ --char-write-req --handle 0x0015 -n 0202000000')
os.system('gatttool -b 90:B6:86:XX:YY:ZZ --char-write-req --handle 0x0012 -n 0102040f0101021300')
os.system('gatttool -b 90:B6:86:XX:YY:ZZ --char-write-req --handle 0x0015 -n 02030000000; sleep 5')
os.system('gatttool -b 90:B6:86:XX:YY:ZZ --char-write-req --handle 0x0012 -n 010304140101011700')
os.system('gatttool -b 90:B6:86:XX:YY:ZZ --char-write-req --handle 0x0015 -n 02040000000')

用您自己的MAC地址替换90:B6:86:XX:YY:ZZ ......

起初我尝试使用Pygatt,但无法从Gatttool执行主要和char-desc操作,所以我通过非交互模式直接调用Gatttool。

相关问题