User Tools

Site Tools


code:json

This is an old revision of the document!


The following commands are available with the JSON API:

change_constraintschange_scriptcmdcnst_altcnst_alt_v
cnst_timeconstscreate_targetdecdevbytype
deviceinfodevicesexecutorexposeget
hasimageinclabellistlabelslastimage
messagesnightobytidplanrunscript
satisfiedscriptselvalsetstatus
sunalttaltitudestbydistancetbyidtbylabel
tbynametbystringtlabs_addtlabs_deletetlabs_set
update_targetviolated

Info about them can be figured out from the relevant code:

httpd.cpp and api.cpp json.py, this last one being the most informative

cmd

This can be used to send commands to the different devices in RTS2. For example to observe the target 8 next:

  http://observatoryserver/apipath/cmd?d=EXEC&c=next%208

note the URL code %20 is used to pass on the space between the command and the parameters.

devbytype

This will list the devices by type with the modifier being an interger t: for example:

http://observatoryserver/apipath/devbytype?t=2

will output mounts attached to this rts2 instance. Where the differt device types are:

1SERVERD9GRB21IMGPROC
2MOUNT10FOCUS22SELECTOR
3CCD11MIRROR23XMLRPC
4DOME12CUPOLA24INDI
5WEATHER13FW25LOGD
6ROTATOR14AUGERSH26SCRIPTOR
7PHOT15SENSOR
8PLAN20EXECUTOR

devices

This will list the devices connected to rts2

lastimage

This theoretically tells you which was the last image to be taken. Using the modifier 'ccd' However if this fails (claims not a single image has been taken) Looking at the status of the camera device will often state the last_image as a value.

runscript

Will run script. Example: runscript?d=C0&s=E%201 (in this case the script has a space which is replaced with '%20' to comply with http urls standards).

set

This will allow you to set values in rts2 devices. Modifiers are: 'd': device, 'n': name, 'v': value, 'async': async

status

This will give the values of a specific module. Known modifier is: 'd': device

update_target

This can be used to change values in a target including its coordinates

  http://observatoryserver/apipath/update_target?id=15&ra=34&dec=-23
code/json.1486484256.txt.gz · Last modified: 2017/02/07 00:00 (external edit)