2017-01-24 4 views
0

Я пытаюсь добавить GPS-тег на каждую фотографию с помощью Olympus Air и API. Но я даже не могу установить GPS. (Я нахожусь в режиме записи) Камера не отвечает на команду. Я попробовал POST с:Установить свойство GPS через API для Olympus Air

http://192.168.0.10/set_camprop.cgi?com=setlist 

заголовкам

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> 

ответ

0

Мой сценарий оболочки корректно работает на 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> 

Я надеюсь, что это поможет.