Saturday, December 19, 2015

Ricoh THETA S のリモコン

RICOH THETA用の物理リモートシャッターボタンをつくるの巻を参考にしてちょっとだけ変えてRICOH THETA S用のリモコンにしました。
プログラムを書いても良かったのですが、とりあえず動作確認のためスクリプトのみの変更です。動いてそうです。
変えたのは theta_remote.sh で
68c68,71
< /tmp/www/ftp/sda1/theta/theta_proc.sh $theta_ip $theta_port $trigger_port&
---
> #/tmp/www/ftp/sda1/theta/theta_proc.sh $theta_ip $theta_port $trigger_port&
> sed="/tmp/www/ftp/sda1/theta/busybox-mips sed"
> execute="http://192.168.1.1/osc/commands/execute"
81c84,87
< /tmp/www/ftp/sda1/theta/ThetaShutterTrig $trigger_port 0
---
> # /tmp/www/ftp/sda1/theta/ThetaShutterTrig $trigger_port 0
> sid=`$wget $execute --post-data='{"name":"camera.startSession"}'| $sed -e "s/^.*\"sessionId\":\"\([^\"]*\)\".*$/\1/"`
> $wget $execute --post-data="{\"name\":\"camera.takePicture\",\"parameters\":{\"sessionId\":\"${sid}\"}}"
> $wget $execute --post-data="{\"name\":\"camera.closeSession\",\"parameters\":{\"sessionId\":\"${sid}\"}}"
84,91c90,97
< /tmp/www/ftp/sda1/theta/sleepms 500
< read trig < $trigger_gpio
< if test ${trig} -eq 0
< then
< # bracket shutter
< /tmp/www/ftp/sda1/theta/ThetaShutterTrig $trigger_port 2000
< /tmp/www/ftp/sda1/theta/ThetaShutterTrig $trigger_port -2000
< fi
---
> # /tmp/www/ftp/sda1/theta/sleepms 500
> # read trig < $trigger_gpio
> # if test ${trig} -eq 0
> # then
> # # bracket shutter
> # /tmp/www/ftp/sda1/theta/ThetaShutterTrig $trigger_port 2000
> # /tmp/www/ftp/sda1/theta/ThetaShutterTrig $trigger_port -2000

> # fi