APIs

Application Programming Interfaces

1. WLAN an der Kamera einschalten

2. Computer mit dem WLAN der Kamera verbinden

3. Weiter im Browser

http://192.168.0.10/get_commandlist.cgi
<?xml version="1.0"?><oishare><version>5.20</version><oitrackversion>3.10</oitrackversion><support func="web"/><support func="remote"/><support func="gps"/><support func="moviestream"/><support func="firmup"/><support func="mysetbackup"/><support func="cameralog"/><cgi name="get_connectmode"><http_method type="get"/></cgi><cgi name="switch_cammode"><http_method type="get"><cmd1 name="mode"><param1 name="rec"><cmd2 name="lvqty"><param2 name="0320x0240"/><param2 name="0640x0480"/><param2 name="0800x0600"/><param2 name="1024x0768"/><param2 name="1280x0960"/></cmd2></param1><param1 name="play"/><param1 name="shutter"></param1><param1 name="maintenance"/><param1 name="cameralog"/></cmd1></http_method></cgi><cgi name="get_caminfo"><http_method type="get"/></cgi><cgi name="exec_pwoff"><http_method type="get"><cmd1 name="mode"><param1 name="withble"/></cmd1></http_method></cgi><cgi name="set_timeout"><http_method type="get"><cmd1 name="timeoutsec"></cmd1></http_method></cgi><cgi name="get_resizeimg"><http_method type="get"><cmd1 name="DIR"><param1><cmd2 name="size"><param2 name="1024"/><param2 name="1600"/><param2 name="1920"/><param2 name="2048"/></cmd2></param1></cmd1></http_method></cgi><cgi name="get_movplaytime"><http_method type="get"><cmd1 name="DIR"/></http_method></cgi><cgi name="clear_resvflg"><http_method type="get"><cmd1 name="DIR"/></http_method></cgi><cgi name="get_rsvimglist"><http_method type="get"/></cgi><cgi name="get_imglist"><http_method type="get"><cmd1 name="DIR"/></http_method></cgi><cgi name="get_thumbnail"><http_method type="get"><cmd1 name="DIR"/></http_method></cgi><cgi name="get_screennail"><http_method type="get"><cmd1 name="DIR"/></http_method></cgi><cgi name="get_movfileinfo"><http_method type="get"><cmd1 name="DIR"/></http_method></cgi><cgi name="exec_movietrimresize"><http_method type="get"><cmd1 name="DIR"/></http_method></cgi><cgi name="get_trimresizeprocstatus"><http_method type="get"/></cgi><cgi name="exec_erase"><http_method type="get"><cmd1 name="DIR"/></http_method></cgi><cgi name="cancel_trimresize"></cgi><cgi name="get_exif"><http_method type="get"><cmd1 name="DIR"/></http_method></cgi><cgi name="set_playtargetslot"><http_method type="get"><cmd1 name="targetslot"><param1 name="1"/><param1 name="2"/></cmd1></http_method></cgi><cgi name="get_playtargetslot"><http_method type="get"></http_method></cgi><cgi name="OLYSetConnectPCInfo"><http_method type="post"></http_method></cgi><cgi name="OLYGetConnectPCInfo"><http_method type="get"></http_method></cgi><cgi name="OLYClearConnectPCInfo"><http_method type="get"></http_method></cgi><cgi name="get_resizeimg_witherr"><http_method type="get"><cmd1 name="DIR"><param1><cmd2 name="size"><param2 name="1024"/><param2 name="1600"/><param2 name="1920"/><param2 name="2048"/></cmd2></param1></cmd1></http_method></cgi><cgi name="exec_takemotion"><http_method type="get"><cmd1 name="com"><param1 name="assignafframe"><cmd2 name="point"/></param1><param1 name="releaseafframe"/><param1 name="takeready"><cmd2 name="point"/></param1><param1 name="starttake"><cmd2 name="point"><cmd3 name="exposuremin"/><cmd3 name="upperlimit"/></cmd2></param1><param1 name="stoptake"/><param1 name="startmovietake"><cmd2 name="limitter"/><cmd3 name="liveview"><param3 name="on"/></cmd3></param1><param1 name="stopmovietake"/></cmd1></http_method></cgi><cgi name="exec_takemisc"><http_method type="get"><cmd1 name="com"><param1 name="startliveview"><cmd2 name="port"/></param1><param1 name="stopliveview"/><param1 name="getrecview"/><param1 name="getlastjpg"/><param1 name="ctrlzoom"><cmd2 name="move"><param2 name="widemove"/><param2 name="telemove"/><param2 name="off"/><param2 name="wideterm"/><param2 name="teleterm"/></cmd2></param1><param1 name="supermacromfinaflock"><cmd2 name="move"><param2 name="nearstep"/><param2 name="farstep"/><param2 name="near"/><param2 name="far"/><param2 name="stop"/></cmd2><cmd3 name="movement"></cmd3></param1><param1 name="MovieThroughStart"/><param1 name="MovieThroughStop"/><param1 name="GetMovieSetting"/></cmd1></http_method></cgi><cgi name="get_camprop"><http_method type="get"><cmd1 name="com"><param1 name="desc"><cmd2 name="propname"><param2 name="touchactiveframe"/><param2 name="takemode"/><param2 name="drivemode"/><param2 name="focalvalue"/><param2 name="expcomp"/><param2 name="shutspeedvalue"/><param2 name="isospeedvalue"/><param2 name="wbvalue"/><param2 name="noisereduction"/><param2 name="lowvibtime"/><param2 name="bulbtimelimit"/><param2 name="digitaltelecon"/><param2 name="supermacrozoom"/><param2 name="exposemovie"/><param2 name="cameradrivemode"/><param2 name="QualityMovie2"/><param2 name="NoiseReductionExposureTime"/><param2 name="SilentNoiseReduction"/><param2 name="SilentTime"/><param2 name="ValidMediaSlot"/><param2 name="desclist"/></cmd2></param1><param1 name="get"><cmd2 name="propname"><param2 name="touchactiveframe"/><param2 name="takemode"/><param2 name="drivemode"/><param2 name="focalvalue"/><param2 name="expcomp"/><param2 name="shutspeedvalue"/><param2 name="isospeedvalue"/><param2 name="wbvalue"/><param2 name="noisereduction"/><param2 name="lowvibtime"/><param2 name="bulbtimelimit"/><param2 name="digitaltelecon"/><param2 name="exposemovie"/><param2 name="cameradrivemode"/><param2 name="SilentNoiseReduction"/><param2 name="SilentTime"/><param2 name="ValidMediaSlot"/></cmd2></param1><param1 name="check"><cmd2 name="propname"><param2 name="ValidMediaSlot"/></cmd2></param1></cmd1></http_method></cgi><cgi name="set_camprop"><http_method type="post"><cmd1 name="com"><param1 name="set"><cmd2 name="propname"><param2 name="takemode"/><param2 name="drivemode"/><param2 name="focalvalue"/><param2 name="expcomp"/><param2 name="shutspeedvalue"/><param2 name="isospeedvalue"/><param2 name="wbvalue"/><param2 name="exposemovie"/></cmd2></param1></cmd1></http_method></cgi><cgi name="get_activate"><http_method type="get"/></cgi><cgi name="set_utctimediff"><http_method type="get"><cmd1 name="utctime"><cmd2 name="diff"/></cmd1></http_method></cgi><cgi name="get_gpsdivunit"><http_method type="get"/></cgi><cgi name="get_unusedcapacity"><http_method type="get"/></cgi><cgi name="get_dcffilenum"><http_method type="get"/></cgi><cgi name="req_attachexifgps"><http_method type="post"/></cgi><cgi name="req_storegpsinfo"><http_method type="post"><cmd1 name="mode"><param1 name="new"/><param1 name="append"/><cmd2 name="date"/></cmd1></http_method></cgi><cgi name="get_moviestreaminfo"><http_method type="get"/></cgi><cgi name="ready_moviestream"><http_method type="get"/></cgi><cgi name="start_moviestream"><http_method type="get"/></cgi><cgi name="stop_moviestream"><http_method type="get"/></cgi><cgi name="exit_moviestream"><http_method type="get"/></cgi><cgi name="start_moviestreamts"><http_method type="get"/></cgi><cgi name="fwup_updatemode"><http_method type="get"/></cgi><cgi name="fwup_getversions"><http_method type="get"/></cgi><cgi name="fwup_sendinfo"><http_method type="get"/><cmd1 name="ObjectCompressSize"></cmd1></cgi><cgi name="fwup_sendsplit"><http_method type="post"/><cmd1 name="OffsetPos"></cmd1><cmd2 name="Byte"></cmd2></cgi><cgi name="fwup_check"><http_method type="get"/></cgi><cgi name="fwup_getfirmstatus"><http_method type="get"/></cgi><cgi name="fwup_update"><http_method type="get"/></cgi><cgi name="request_getmysetdata"><http_method type="get"/><cmd1 name="mode"><param1 name="current"/><param1 name="myset1"/><param1 name="myset2"/><param1 name="myset3"/><param1 name="myset4"/></cmd1><cmd2 name="kind"><param2 name="current"/><param2 name="factory"/></cmd2></cgi><cgi name="get_mysetbackupstate"><http_method type="get"/></cgi><cgi name="get_partialmysetdata"><http_method type="get"/><cmd1 name="kind"><param1 name="current"/><param1 name="errorinfo"/></cmd1><cmd2 name="offset"></cmd2><cmd3 name="size"></cmd3></cgi><cgi name="request_restoremysetdata"><http_method type="get"/><cmd1 name="action"><param1 name="restore"/><param1 name="errorcheck"/></cmd1></cgi><cgi name="get_mysetrestorestate"><http_method type="get"/></cgi><cgi name="get_mysetdatamodekind"><http_method type="get"/></cgi><cgi name="get_mysetdatasize"><http_method type="get"/><cmd1 name="kind"><param1 name="current"/><param1 name="errorinfo"/></cmd1></cgi><cgi name="set_mysetdatasize"><http_method type="get"/><cmd1 name="size"></cmd1></cgi><cgi name="send_partialmysetdata"><http_method type="post"/><cmd1 name="offset"></cmd1><cmd2 name="size"></cmd2></cgi><cgi name="get_extmysetmode"><http_method type="get"/></cgi><cgi name="exec_reboot"><http_method type="get"/></cgi><cgi name="get_cameraloginfo"></cgi><cgi name="get_partialcameralogdata"><cmd1 name="offset"></cmd1><cmd2 name="size"></cmd2></cgi><cgi name="clear_cameralogdata"></cgi></oishare>

4. Ein paar erste Schritte mit dem API

Hier ist das Python-Script xml-to-html.py . Nach dem Runterladen entkomprimieren und z.B. im Terminal starten (aus dem Verzeichnis wo es liegt) mit python xml-to-html.py. Getestet am Mac.

Die commandlist


2
1
<oishare>
2
<version>5.00</version>
3
<oitrackversion>3.10</oitrackversion>
4
<support func="web"></support>
5
<support func="remote"></support>
6
<support func="gps"></support>
7
<support func="moviestream"></support>
8
<support func="firmup"></support>
9
<support func="mysetbackup"></support>
10
<support func="cameralog"></support>
11
<cgi name="get_connectmode">
12
<http_method type="get"></http_method>
13
</cgi>
14
<cgi name="switch_cammode">
15
<http_method type="get"></http_method>
32
</cgi>
33
<cgi name="get_caminfo">
34
<http_method type="get"></http_method>
35
</cgi>
36
<cgi name="exec_pwoff">
37
<http_method type="get"></http_method>
42
</cgi>
43
<cgi name="set_timeout">
44
<http_method type="get"></http_method>
47
</cgi>
48
<cgi name="get_resizeimg">
49
<http_method type="get"></http_method>
61
</cgi>
62
<cgi name="get_movplaytime">
63
<http_method type="get"></http_method>
66
</cgi>
67
<cgi name="clear_resvflg">
68
<http_method type="get"></http_method>
71
</cgi>
72
<cgi name="get_rsvimglist">
73
<http_method type="get"></http_method>
74
</cgi>
75
<cgi name="get_imglist">
76
<http_method type="get"></http_method>
79
</cgi>
80
<cgi name="get_thumbnail">
81
<http_method type="get"></http_method>
84
</cgi>
85
<cgi name="get_screennail">
86
<http_method type="get"></http_method>
89
</cgi>
90
<cgi name="get_movfileinfo">
91
<http_method type="get"></http_method>
94
</cgi>
95
<cgi name="exec_movietrimresize">
96
<http_method type="get"></http_method>
99
</cgi>
100
<cgi name="get_trimresizeprocstatus">
101
<http_method type="get"></http_method>
102
</cgi>
103
<cgi name="exec_erase">
104
<http_method type="get"></http_method>
107
</cgi>
108
<cgi name="cancel_trimresize"></cgi>
109
<cgi name="get_exif">
110
<http_method type="get"></http_method>
113
</cgi>
114
<cgi name="set_playtargetslot">
115
<http_method type="get"></http_method>
121
</cgi>
122
<cgi name="get_playtargetslot">
123
<http_method type="get"></http_method>
124
</cgi>
125
<cgi name="OLYSetConnectPCInfo">
126
<http_method type="post"></http_method>
127
</cgi>
128
<cgi name="OLYGetConnectPCInfo">
129
<http_method type="get"></http_method>
130
</cgi>
131
<cgi name="OLYClearConnectPCInfo">
132
<http_method type="get"></http_method>
133
</cgi>
134
<cgi name="get_resizeimg_witherr">
135
<http_method type="get"></http_method>
147
</cgi>
148
<cgi name="exec_takemotion">
149
<http_method type="get"></http_method>
174
</cgi>
175
<cgi name="exec_takemisc">
176
<http_method type="get"></http_method>
208
</cgi>
209
<cgi name="get_camprop">
210
<http_method type="get"></http_method>
265
</cgi>
266
<cgi name="set_camprop">
267
<http_method type="post"></http_method>
283
</cgi>
284
<cgi name="get_activate">
285
<http_method type="get"></http_method>
286
</cgi>
287
<cgi name="set_utctimediff">
288
<http_method type="get"></http_method>
293
</cgi>
294
<cgi name="get_gpsdivunit">
295
<http_method type="get"></http_method>
296
</cgi>
297
<cgi name="get_unusedcapacity">
298
<http_method type="get"></http_method>
299
</cgi>
300
<cgi name="get_dcffilenum">
301
<http_method type="get"></http_method>
302
</cgi>
303
<cgi name="req_attachexifgps">
304
<http_method type="post"></http_method>
305
</cgi>
306
<cgi name="req_storegpsinfo">
307
<http_method type="post"></http_method>
314
</cgi>
315
<cgi name="get_moviestreaminfo">
316
<http_method type="get"></http_method>
317
</cgi>
318
<cgi name="ready_moviestream">
319
<http_method type="get"></http_method>
320
</cgi>
321
<cgi name="start_moviestream">
322
<http_method type="get"></http_method>
323
</cgi>
324
<cgi name="stop_moviestream">
325
<http_method type="get"></http_method>
326
</cgi>
327
<cgi name="exit_moviestream">
328
<http_method type="get"></http_method>
329
</cgi>
330
<cgi name="start_moviestreamts">
331
<http_method type="get"></http_method>
332
</cgi>
333
<cgi name="fwup_updatemode">
334
<http_method type="get"></http_method>
335
</cgi>
336
<cgi name="fwup_getversions">
337
<http_method type="get"></http_method>
338
</cgi>
339
<cgi name="fwup_sendinfo">
340
<http_method type="get"></http_method>
341
<cmd1 name="ObjectCompressSize"></cmd1>
342
</cgi>
343
<cgi name="fwup_sendsplit">
344
<http_method type="post"></http_method>
345
<cmd1 name="OffsetPos"></cmd1>
346
<cmd2 name="Byte"></cmd2>
347
</cgi>
348
<cgi name="fwup_check">
349
<http_method type="get"></http_method>
350
</cgi>
351
<cgi name="fwup_getfirmstatus">
352
<http_method type="get"></http_method>
353
</cgi>
354
<cgi name="fwup_update">
355
<http_method type="get"></http_method>
356
</cgi>
357
<cgi name="request_getmysetdata">
358
<http_method type="get"></http_method>
359
<cmd1 name="mode"></cmd1>
366
<cmd2 name="kind"></cmd2>
370
</cgi>
371
<cgi name="get_mysetbackupstate">
372
<http_method type="get"></http_method>
373
</cgi>
374
<cgi name="get_partialmysetdata">
375
<http_method type="get"></http_method>
376
<cmd1 name="kind"></cmd1>
380
<cmd2 name="offset"></cmd2>
381
<cmd3 name="size"></cmd3>
382
</cgi>
383
<cgi name="request_restoremysetdata">
384
<http_method type="get"></http_method>
385
<cmd1 name="action"></cmd1>
389
</cgi>
390
<cgi name="get_mysetrestorestate">
391
<http_method type="get"></http_method>
392
</cgi>
393
<cgi name="get_mysetdatamodekind">
394
<http_method type="get"></http_method>
395
</cgi>
396
<cgi name="get_mysetdatasize">
397
<http_method type="get"></http_method>
398
<cmd1 name="kind"></cmd1>
402
</cgi>
403
<cgi name="set_mysetdatasize">
404
<http_method type="get"></http_method>
405
<cmd1 name="size"></cmd1>
406
</cgi>
407
<cgi name="send_partialmysetdata">
408
<http_method type="post"></http_method>
409
<cmd1 name="offset"></cmd1>
410
<cmd2 name="size"></cmd2>
411
</cgi>
412
<cgi name="get_extmysetmode">
413
<http_method type="get"></http_method>
414
</cgi>
415
<cgi name="exec_reboot">
416
<http_method type="get"></http_method>
417
</cgi>
418
<cgi name="get_cameraloginfo"></cgi>
419
<cgi name="get_partialcameralogdata">
420
<cmd1 name="offset"></cmd1>
421
<cmd2 name="size"></cmd2>
422
</cgi>
423
<cgi name="clear_cameralogdata"></cgi>
424
</oishare>

Anzeige-Tiefe 1

Anzeige-Tiefe 2

Einfachste GET-Abrufe ohne weitere Parameter

<?xml version="1.0"?>
<caminfo>
<model>OM-1MarkII</model>
<extmediaslot>2/2</extmediaslot>
<MISOAExpComp>available</MISOAExpComp>
<HighResolutionSoundPlay>notavailable</HighResolutionSoundPlay>
<BleFunction>available</BleFunction>
<RecommendedIsoLowerLimit>200</RecommendedIsoLowerLimit>
<MovieThroughInfoDisplay>available</MovieThroughInfoDisplay>
<SerialNumberList>
<Serial1>BJRA0xxxx</Serial1>
<Serial2>A0EA0yyyy</Serial2>
</SerialNumberList>
<DoubleslotSupport>available</DoubleslotSupport>
<GetImageScreennailSupport>available</GetImageScreennailSupport>
<GetRawImageSupport>available</GetRawImageSupport>
<WifiWakeupAtUdpStop>need</WifiWakeupAtUdpStop>
<BleFunctionDetailList>
<Func1>BleShutter</Func1>
<Func2>BleLocation</Func2>
</BleFunctionDetailList>
<LiveCompLimitMinute>180</LiveCompLimitMinute>
<MaxPostBodySize>1048576</MaxPostBodySize>
<gpsLogTag>OM Digital Solutions</gpsLogTag>
<movietrimming>notavailable</movietrimming>
</caminfo>

GET-Abrufe mit einem weiteren Parameter

http://192.168.0.10/switch_cammode.cgi?mode=rec
curl "http://192.168.0.10/switch_cammode.cgi?mode=rec"

GET-Abruf mit mehreren Parametern

http://192.168.0.10/get_camprop.cgi?com=get&propname=shutspeedvalue
curl "http://192.168.0.10/get_camprop.cgi?com=get&propname=shutspeedvalue"
...?[Name des Parameters 1]=[Wert des Parameters 1]&[Name des Parameters 2]=[Wert des Parameters 2]
<?xml version="1.0"?><get><value>320</value></get>%

POST-Requests

curl "http://192.168.0.10/set_camprop.cgi?com=set&propname=shutspeedvalue" -d "<set><value>100</value></set>"
<?xml version="1.0"?><response><drivemode>silent-normal</drivemode><cameradrivemode>normal</cameradrivemode></response>%
curl "http://192.168.0.10/get_camprop.cgi?com=get&propname=shutspeedvalue"
<?xml version="1.0"?><get><value>100</value></get>%

Bilder runterladen nur mit APIs – mehrere Requests hintereinander

http://192.168.0.10/set_playtargetslot.cgi?targetslot=1
http://192.168.0.10/get_imglist.cgi?DIR=/DCIM
http://192.168.0.10/get_imglist.cgi?DIR=/DCIM/103OMSYS
VER_100
/DCIM/103OMSYS,P1167047.JPG,3155242,0,23600,28857
/DCIM/103OMSYS,P1167047.ORF,20596287,0,23600,28857
http://192.168.0.10/DCIM/103OMSYS/P1167047.JPG
http://192.168.0.10/DCIM/103OMSYS/P1167047.ORF

Python Skript zum Bilder importieren

Ein Video das zeigt, wie das 9KB große (kleine) Python-Skript funktioniert, siehst Du hier.

Folge von Befehlen um ein Foto zu machen

Eingabe im Terminal

curl "http://192.168.0.10/get_caminfo.cgi"
curl "http://192.168.0.10/switch_cammode.cgi?mode=rec"
curl "http://192.168.0.10/exec_takemisc.cgi?com=startliveview&port=5555"
curl "http://192.168.0.10/exec_takemotion.cgi?com=starttake" 

Eingabe in einem Browser

http://192.168.0.10/get_caminfo.cgi
http://192.168.0.10/switch_cammode.cgi?mode=rec
http://192.168.0.10/exec_takemisc.cgi?com=startliveview&port=5555
http://192.168.0.10/exec_takemotion.cgi?com=starttake
<response>
   <take>ok</take>
   <affocus>ok</affocus>
      <afframepoint>0238x0097</afframepoint>
      <afframesize>0008x0009</afframesize>
</response>
<response>
   <take>ng</take>
   <affocus>ng</affocus>
</response>

Runterladen von Set-Files mit den APIs

curl "http://192.168.0.10/switch_cammode.cgi?mode=maintenance"
curl "http://192.168.0.10/request_getmysetdata.cgi?mode=myset1&kind=current"
curl "http://192.168.0.10/get_mysetdatasize.cgi?kind=current"
curl "http://192.168.0.10/get_partialmysetdata.cgi?kind=current&offset=0&size=87817" -o myset1.txt
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 88034  100 88034    0     0   830k      0 --:--:-- --:--:-- --:--:--  834k

„intelligente“ Belichtungsreihen