-
Notifications
You must be signed in to change notification settings - Fork 1
Polaris protocol commands
The Polaris app is sending every 5s what seems to be a keep alive:
h#
The Polaris responds with:
h#
The following command query the Polaris about the current state
1&284&2&-1#
The response depends on the mode, for astro mode (8) it is:
284@mode:<mode>;state:<state>;track:<track>;speed:<speed>;halfSpeed:<halfSpeed>;remNum:<remNum>;runTime:<runTime>;photoNum:<photoNum>;#
mode: 8 (Astro)
state:
track: tracking status, 0 stopped, 1 is tracking, 3 celestial alignment is not done
speed: 0
halfSpeed: 0
remNum: used when the Polaris is controlling a camera and taking pictures
runTime: used when the Polaris is controlling a camera and taking pictures
photoNum: used when the Polaris is controlling a camera and taking pictures
This command is used to switch between the modes (photo, astro, timelapse,...)
1&285&2&mode:<mode>;#
mode: 1 Photo, 2 Pano, 3 Focus stack, 4 Timelapse, 5 Path-lapse, 6 HDR,
7 Sun, 8 Astro, 9 Free program, 10 Video
The Polaris responds with the following:
285@mode:<mode>;ret:<ret>;#
mode: the new mode
ret: 0 if successful
This command rotate the head around the az axis at a given speed for a small amount of time (0.1s). To achieve long rotation the command should be repeated every 0.05s
1&513&3&speed:<speed>;#
speed: rotation speed in [-2000...2000], positive value rotate clockwise
If the tracking was ongoing (track:1), the tracking is suspended and the Polaris respond the first time with the following:
531@ret:2;#
If the timeout (about 0.1s) expire since the last reveived 513
command, the tracking is restored and the Polaris respond:
531@ret:1;#
This command rotate the head around the alt axis at a given speed for a small amount of time (0.1s). To achieve long rotation the command should be repeated every 0.05s
1&514&3&speed:<speed>;#
speed: rotation speed in [-2000...2000]
If the tracking was ongoing (track:1), the tracking is suspended and the Polaris respond the first time with the following:
531@ret:2;#
If the timeout (about 0.1s) expire since the last reveived 514
command, the tracking is restored and the Polaris respond:
531@ret:1;#
This command rotate the head around the astro axis at a given speed for a small amount of time (0.1s). To achieve long rotation the command should be repeated every 0.05s
1&521&3&speed:<speed>;#
speed: rotation speed in [-2000...2000]
If the tracking was ongoing (track:1), the tracking is suspended and the Polaris respond the first time with the following:
531@ret:2;#
If the timeout (about 0.1s) expire since the last reveived 521
command, the tracking is restored and the Polaris respond:
531@ret:1;#
This command query the Polaris about its orientation around the 3 axis:
1&517&3&-1#
The response has this form:
517@yaw:<current_yaw>;pitch:<current_pitch>;roll:<current_roll>;#
current_yaw: the current rotation around the yaw axis (azimuth)
current_pitch: the current rotation around the pitch axis (elevation)
current_roll: the current rotation around the roll axis (astro rotation)
We don't understand yet what the values of <current_yaw>
, <current_pitch>
and current_roll
mean.
The goto command allow to move the head toward a given target designated by its altitude-azimuth coordinates (alt,az). The command has the following form:
1&519&3&state:1;yaw:<az>;pitch:<alt>;lat:<latitude>;track:<track>;speed:<track_speed>;lng:<longitude>;#
az: the azimuth of the target
alt: the altitude of the target
track: 1 to start tracking after goto, 0 otherwise
track_speed: 0 for stars
latitude: the latitude of the current location
longitude: the longitude of the current location
The polaris respond either with an error code if the move is not possible:
519@ret:-1;track:1;#
Or with the following response:
519@ret:1;track:1;#
then it start moving toward the target and when it is reached it send the following:
519@ret:0;track:1;#
This command is used to reset the rotation on a axis, ie going to the home position:
1&523&3&axis:<axis>;#
axis: 1 for az axis, 2 for alt axis, 3 for astro axis
This is the first step when going to astro mode in the smartphone app this allow to orient the head versus the North. The command used to set the orientation is the following:
1&527&3&compass:<angle>;lat:<latitude>;lng:<longitude>;#
angle: orientation of the head (the compass value given by the smartphone when put on the side of the Polaris)
latitude: the latitude of the current location
longitude: the longitude of the current location
The Polaris should respond with:
531@ret:0;#
527@ret:0;#
The celestial alignment is achieved in 3 steps:
The goto command is used to move to the star used for the alignment, with no tracking.
This command starts the alignment process:
1&530&3&step:1;yaw:<az>;pitch:<alt>;lat:<latitude>;num:1;lng:<longitude>;#
az: the azimuth of the target for the alignment
alt: the altitude of the target for the alignment
latitude: the latitude of the current location
longitude: the longitude of the current location
Then the Polaris responds with:
530@step:1;ret:0;#
The adjustment star should be centered using the different move commands
- Celestial alignement step 2 (after step 1 and centering the alignment object with rotation cmd)
1&530&3&step:2;yaw:<az>;pitch:<alt>;lat:<latitude>;num:1;lng:<longitude>;#
az: the azimuth of the target for the alignment
alt: the altitude of the target for the alignment
latitude: the latitude of the current location
longitude: the longitude of the current location
Then the Polaris responds with:
530@step:2;ret:0;#
The command used to start or stop the tracking is:
1&531&3&state:<state>;speed:<speed>;#
state: 0 stop tracking, 1 start tracking
speed: 0 for compensating star rotation
The Polaris should respond with:
531@ret:<state>;#
state: 0 if we asked to stop or 1 if we asked to start tracking
After some other commands (goto 519
, compass 527
, precision move 532
, 533
, 534
) we may receive a 531
response with ret
value in 0...3.
These are the moves that could be done in the smartphone app using the virtual joysticks in precision mode with speed between 0 and 5.
These are the move that could be achieved using the left virtual joystick in the app, there are two commands which react to the key press and release on the virtual keys, one for the az axis:
1&532&3&key:<key>;state:<state>;level:<speed>;#
key: 0 for the left key,
1 for the right key,
this allow to choose the direction of the rotation
state: 0 release the key (stop moving)
1 press the key (start moving)
2 long press, sent after 2s since start moving (continue moving)
speed: rotation speed between 1 and 5
and one for the alt axis:
1&533&3&key:<key>;state:<state>;level:<speed>;#
key: 0 for the left key,
1 for the right key,
this allow to choose the direction of the rotation
state: 0 release the key (stop moving)
1 press the key (start moving)
2 long press, sent after 2s since start moving (continue moving)
speed: rotation speed between 1 and 5
The Polaris should reply with a 531
response (tracking status) when state: 0
or state: 1
were sent, but there is no response when state: 2
was used:
531@ret:<ret>;#
ret: 1 if <state> was 0, 2 if <state> was 1
The move has several phases:
- At key press: the tracking is set to state 2 (what does it mean ?)
- At key press + 2s: the
532
or533
command is sent again withstate:2
- When key is released: the move stop, tracking is put back in state 1 (normal tracking)
This is the command to achieve precision rotation around the astro axis:
1&534&3&key:<key>;state:<state>;level:<speed>;#
key: 0 for the left key,
1 for the right key,
this allow to choose the direction of the rotation
state: 0 release the key (stop moving)
1 press the key (start moving)
2 long press, sent after 2s since start moving (continue moving)
speed: rotation speed between 1 and 5
The Polaris should reply with a 531
response (tracking status) when state: 0
or state: 1
were sent, but there is no response when state: 2
was used:
531@ret:<ret>;#
ret: 1 if <state> was 0, 2 if <state> was 1
The move has several phases:
- At key press: the tracking is set to state 2 (what does it mean ?)
- At key press + 2s: the
534
command is sent again withstate:2
- When key is released: the move stop, tracking is put back in state 1 (normal tracking)
The command to check the free and used space on the SDCard is the following:
1&775&2&-1#
The Polaris responds with:
775@status:1;totalspace:<totalspace>;freespace:<freespace>;usespace:<usespace>;#
totalspace: total SDCard capacity
freespace: free space on the SDCard
usespace: used space on the SDCard
This query the remaining battery capacity and if the Polaris is connected to a power source:
1&778&2&-1#
The Polaris responds with:
778@capacity:<capacity>;charge:<charge>;#
capacity: remaining capacity between 0 and 100
charge: 1 if the Polaris is connected to a power source, 0 otherwise
This command setup a client context, it allows to keep the connection open
1&808&2&type:0;#
The Polaris responds with:
808@ret:0;#
The Polaris is sending information periodically or after some events that are not the result of a command sent from the application
The Polaris sent periodically this information about its orientation after switching to astro mode and compass alignment has been done. These are the (alt,az) coordinates that the Polaris app is displaying in astro mode.
518@w:<w0>;x:<x0>;y:<y0>;z:<z0>;w:<w1>;x:<x1>;y:<y1>;z:<z1>;compass:<az>;alt:<alt>;#
w0,x0,y0,z0: a quaternion that should represent a oriented axe in 3d space
w1,x1,y1,z1: a quaternion that should represent a oriented axe in 3d space
az: current azimuth (0 is North, 90 is East, 180 is South, 270 is West)
alt: opposite of the current altitude (-90 mean up, 0 mean horizontal, 90 mean down)
The Polaris is sending periodically this at about 15-30s intervals:
525@Tempa509caxxxxxxxxxxxx ;#
It's not yet known if the value is the same for all the Polaris or not.
When some events occur the current tracking state could be changed by the Polaris with the following response:
531@ret:<ret>;#
ret: 0 no tracking
1 tracking is active
2 tracking paused
3 celestial alignment not done
If a physical limit occur when moving the head the following error is sent by the Polaris:
797@errorCode:-1203;#