通过Olympus Air的API设置GPS属性

时间:2017-01-24 07:54:06

标签: gps olympus-camerakit olympus-air

我正在尝试使用Olympus Air和API为每张照片添加GPS标签。 但我甚至无法设置GPS。(我正在录制模式)相机没有响应命令。 我试过POST:

Content-type: text/xml
User-Agent: OlympusCameraKit
Content-Length: 74
Host: 192.168.0.10
Connection: Keep-Alive

接头

<?xml version="1.0"?><set><prop name="GPS"><value>ON</value></prop>
</set>

{{1}}

1 个答案:

答案 0 :(得分:0)

我的shell脚本在macOS上正常工作。

curl -v \
  -H 'User-Agent: OlympusCameraKit' \
  -H 'Host: 192.168.0.10' \
  'http://192.168.0.10/get_connectmode.cgi'
echo
echo
curl -v \
  -H 'User-Agent: OlympusCameraKit' \
  -H 'Host: 192.168.0.10' \
  'http://192.168.0.10/switch_commpath.cgi?path=wifi'
echo
echo
curl -v \
  -H 'User-Agent: OlympusCameraKit' \
  -H 'Host: 192.168.0.10' \
  'http://192.168.0.10/start_pushevent.cgi?port=65000'
echo
echo
curl -v \
  -H 'User-Agent: OlympusCameraKit' \
  -H 'Host: 192.168.0.10' \
  'http://192.168.0.10/switch_cameramode.cgi?mode=standalone'
sleep 2
echo
echo
curl -v \
  -H 'User-Agent: OlympusCameraKit' \
  -H 'Host: 192.168.0.10' \
  'http://192.168.0.10/switch_cameramode.cgi?mode=rec&lvqt=0320x0240'
sleep 2
echo
echo
curl -v \
  -H 'User-Agent: OlympusCameraKit' \
  -H 'Host: 192.168.0.10' \
  'http://192.168.0.10/exec_takemisc.cgi?com=startliveview&port=5555'
echo
echo
curl -v \
  -H 'User-Agent: OlympusCameraKit' \
  -H 'Host: 192.168.0.10' \
  'http://192.168.0.10/get_state.cgi'
echo
echo
curl -v \
  -H 'Content-type: text/xml' \
  -H 'User-Agent: OlympusCameraKit' \
  -H 'Host: 192.168.0.10' \
  -d '<?xml version="1.0"?><set><prop name="GPS"><value>ON</value></prop></set>' \
  'http://192.168.0.10/set_camprop.cgi?com=setlist'
echo
echo
curl -v \
  -H 'User-Agent: OlympusCameraKit' \
  -H 'Host: 192.168.0.10' \
  'http://192.168.0.10/get_camprop.cgi?com=get&propname=GPS'
echo
echo
curl -v \
  -H 'User-Agent: OlympusCameraKit' \
  -H 'Host: 192.168.0.10' \
  'http://192.168.0.10/switch_cameramode.cgi?mode=standalone'
sleep 2
echo
echo

结果如下:

*   Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> GET /get_connectmode.cgi HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> User-Agent: OlympusCameraKit
> 
< HTTP/1.1 200 OK
< Content-Type: text/xml
< Content-Length: 55
< Connection: close
< 
<?xml version="1.0"?>
<connectmode>OPC</connectmode>
* Curl_http_done: called premature == 0
* Closing connection 0


*   Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> GET /switch_commpath.cgi?path=wifi HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> User-Agent: OlympusCameraKit
> 
< HTTP/1.1 200 OK
< Content-Length: 0
< Connection: close
< 
* Curl_http_done: called premature == 0
* Closing connection 0


*   Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> GET /start_pushevent.cgi?port=65000 HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> User-Agent: OlympusCameraKit
> 
< HTTP/1.1 200 OK
< Content-Type: www/unknown
< Content-Length: 0
< Connection: close
< 
* Curl_http_done: called premature == 0
* Closing connection 0


*   Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> GET /switch_cameramode.cgi?mode=standalone HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> User-Agent: OlympusCameraKit
> 
< HTTP/1.1 200 OK
< Content-Type: text/xml
< Content-Length: 40
< Connection: close
< 
* Curl_http_done: called premature == 0
* Closing connection 0
<?xml version="1.0"?><result>OK</result>

*   Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> GET /switch_cameramode.cgi?mode=rec&lvqt=0320x0240 HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> User-Agent: OlympusCameraKit
> 
< HTTP/1.1 200 OK
< Content-Type: text/xml
< Content-Length: 40
< Connection: close
< 
* Curl_http_done: called premature == 0
* Closing connection 0
<?xml version="1.0"?><result>OK</result>

*   Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> GET /exec_takemisc.cgi?com=startliveview&port=5555 HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> User-Agent: OlympusCameraKit
> 
< HTTP/1.1 200 OK
< Content-Type: text/xml
< Content-Length: 405
< Connection: close
< 
* Curl_http_done: called premature == 0
* Closing connection 0
<?xml version="1.0"?><funcidlist><funcid name="framesize"/><funcid name="afframeinfo"/><funcid name="mntmediainfo"/><funcid name="rotation"/><funcid name="maxtakenum"/><funcid name="shutspeedvalue"/><funcid name="focalvalue"/><funcid name="expcomp"/><funcid name="isospeedvalue"/><funcid name="expphotowarning"/><funcid name="focusinfo"/><funcid name="zoominfo"/><funcid name="maxmovietime"/></funcidlist>

*   Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> GET /get_state.cgi HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> User-Agent: OlympusCameraKit
> 
< HTTP/1.1 200 OK
< Content-Type: text/xml
< Content-Length: 426
< Connection: close
< 
* Curl_http_done: called premature == 0
* Closing connection 0
<?xml version="1.0"?><response><cardstatus>normal</cardstatus><cardremainnum>425</cardremainnum><cardremainsec>1123</cardremainsec><cardremainbyte>3709501440</cardremainbyte><lensmountstatus>normal</lensmountstatus><imagingstate>normal</imagingstate><focallength>14</focallength><widefocallength>14</widefocallength><telefocallength>42</telefocallength><electriczoom>OK</electriczoom><macrosetting>NG</macrosetting></response>

*   Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> POST /set_camprop.cgi?com=setlist HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> Content-type: text/xml
> User-Agent: OlympusCameraKit
> Content-Length: 73
> 
* upload completely sent off: 73 out of 73 bytes
< HTTP/1.1 200 OK
< Content-Type: text/xml
< Content-Length: 59
< Connection: close
< 
* Curl_http_done: called premature == 0
* Closing connection 0
<?xml version="1.0"?><response><notset></notset></response>

*   Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> GET /get_camprop.cgi?com=get&propname=GPS HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> User-Agent: OlympusCameraKit
> 
< HTTP/1.1 200 OK
< Content-Type: text/xml
< Content-Length: 49
< Connection: close
< 
* Curl_http_done: called premature == 0
* Closing connection 0
<?xml version="1.0"?><get><value>ON</value></get>

*   Trying 192.168.0.10...
* TCP_NODELAY set
* Connected to 192.168.0.10 (192.168.0.10) port 80 (#0)
> GET /switch_cameramode.cgi?mode=standalone HTTP/1.1
> Host: 192.168.0.10
> Accept: */*
> User-Agent: OlympusCameraKit
> 
< HTTP/1.1 200 OK
< Content-Type: text/xml
< Content-Length: 40
< Connection: close
< 
* Curl_http_done: called premature == 0
* Closing connection 0
<?xml version="1.0"?><result>OK</result>

我希望它会对你有所帮助。