Difference between revisions of "JSON API"

From Cosmostreamer Wiki
Jump to navigation Jump to search
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Automovements control ==
== Automovements control ==


=== Store automovement preset ===  
=== Enable/disable automovements ===
<pre>{"cmd":"updateconfig","param":"automovement","value":"store","value2":"1"}</pre>
<pre>{"cmd":"updateconfig","param":"automovement","value":"setstate","value2":"1"}</pre>
<b>Params</b><br>
<b>Params</b><br>
<b>value2</b> position (0 - 255) <br>
<b>value2</b> 1 - enable, 0 - disable <br>
<br>
<br>


=== Go to ===
=== Go to preset ===
<pre>{"cmd":"updateconfig","param":"automovement","value":"move","value2":"1"}</pre>
<pre>{"cmd":"updateconfig","param":"automovement","value":"move","value2":"1"}</pre>
<b>Params</b><br>
<b>Params</b><br>
<b>value2</b> position (0 - 255) <br>
<b>value2</b> preset number (0 - 255) <br>
<br>
<br>


=== Enable/disable automovements ===
=== Store automovement preset ===  
<pre>{"cmd":"updateconfig","param":"automovement","value":"setstate","value2":"1"}</pre>
<pre>{"cmd":"updateconfig","param":"automovement","value":"store","value2":"1"}</pre>
<b>Params</b><br>
<b>Params</b><br>
<b>value2</b> 1 - enable, 0 - disable <br>
<b>value2</b> preset number (0 - 255) <br>
<br>
<br>


== Camera gimbal control ==
== Camera gimbal control ==
Move gimbal to normal position (center)<br>
!{"cmd":"position","param":"normal"}
<br>


Move gimbal to selfie position (if available)<br>
=== Move gimbal to center position ===
!{"cmd":"position","param":"selfit"}
<pre>!{"cmd":"position","param":"normal"}</pre>
<br>
<br>


Change gimbal mode (0 - 2)<br>
=== Move gimbal to selfie position ===
!{"cmd":"gimbal","param":"mode","value":"1"}
<pre>!{"cmd":"position","param":"selfie"}</pre>
<br>
<br>


Move gimbal. value - pan speed, value2 - tilt speed, value3 - roll speed. From -1.0 to 1.0, 0 - stop <br>
=== Set gimbal mode ===
{"cmd":"gimbal","param":"move","value":"-1.0","value2":"0.0","value3":"0.0"}
<pre>!{"cmd":"gimbal","param":"mode","value":"1"}</pre>
<b>Params</b><br>
<b>value1</b> mode number (0 - 2) <br>
<br>
<br>


Set gimbal mode. value - mode. From 0 to 2<br>
=== Move gimbal ===
!{"cmd":"gimbal","param":"mode","value":"0"}
<pre>{"cmd":"gimbal","param":"move","value":"-1.0","value2":"0.0","value3":"0.0"}</pre>
<b>Params</b><br>
<b>value</b> pan speed (-1.0 - 1.0) <br>
<b>value2</b> tilt speed (-1.0 - 1.0) <br>
<b>value3</b> roll speed (-1.0 - 1.0) <br>
<br>
<br>


Line 44: Line 48:


== Wiral Lite control ==
== Wiral Lite control ==
=== Move to distance ===
<pre>!{"cmd":"wiral","param":"position","value":"set","value2":"0","value3":"-1"}</pre>
<b>Params</b><br>
<b>value2</b> distance (0 - 65535) <br>
<b>value3</b> speed (0-255), -1 - use current speed <br>
Use distance 0 for moving back, 65535 - for moving forward.<br>
<br>
=== Stop ===
<pre>!{"cmd":"wiral","param":"position","value":"set","value2":"0","value3":"0"}</pre>
<br>
=== Change current speed ===
<pre>!{"cmd":"wiral","param":"speed","value":"change","value2":"5"}</pre>
<b>Params</b><br>
<b>value2</b> increment. For example, 5 or -5<br>
<br>


=== Tic-tac mode ===
=== Tic-tac mode ===
Line 53: Line 75:
<br>
<br>


=== Move to position ===
[[Category:JSON API]][[Category:Companion]]
<pre>!{"cmd":"wiral","param":"position","value":"set","value2":"0","value3":"-1"}</pre>
<b>Params</b><br>
<b>value2</b> position (0 - 65535) <br>
<b>value3</b> speed (0-255), -1 - use current speed <br>
<br>

Latest revision as of 22:49, 27 April 2022

Automovements control

Enable/disable automovements

{"cmd":"updateconfig","param":"automovement","value":"setstate","value2":"1"}

Params
value2 1 - enable, 0 - disable

Go to preset

{"cmd":"updateconfig","param":"automovement","value":"move","value2":"1"}

Params
value2 preset number (0 - 255)

Store automovement preset

{"cmd":"updateconfig","param":"automovement","value":"store","value2":"1"}

Params
value2 preset number (0 - 255)


Camera gimbal control

Move gimbal to center position

!{"cmd":"position","param":"normal"}


Move gimbal to selfie position

!{"cmd":"position","param":"selfie"}


Set gimbal mode

!{"cmd":"gimbal","param":"mode","value":"1"}

Params
value1 mode number (0 - 2)

Move gimbal

{"cmd":"gimbal","param":"move","value":"-1.0","value2":"0.0","value3":"0.0"}

Params
value pan speed (-1.0 - 1.0)
value2 tilt speed (-1.0 - 1.0)
value3 roll speed (-1.0 - 1.0)

Camera control


Wiral Lite control

Move to distance

!{"cmd":"wiral","param":"position","value":"set","value2":"0","value3":"-1"}

Params
value2 distance (0 - 65535)
value3 speed (0-255), -1 - use current speed
Use distance 0 for moving back, 65535 - for moving forward.

Stop

!{"cmd":"wiral","param":"position","value":"set","value2":"0","value3":"0"}


Change current speed

!{"cmd":"wiral","param":"speed","value":"change","value2":"5"}

Params
value2 increment. For example, 5 or -5

Tic-tac mode

Enable/disable Tic-tac mode

!{"cmd":"wiral","param":"mode","value":"tic-tac","value2":"1","value3":"-1"}

Params
value2 1 - enable Tic-tac mode, 0 - disable Tic-tac mode
value3 speed (0-255), -1 - use current speed