Skip to content

Server-Client

Danger

The XO-VAC+ API is currently under development. Use at your own risk!

This section documents all the responses/messages the server may send to the client and their syntax.

cancel_recipe_ack

Response sent once the cancel_recipe command has been received.

Parameters:

The top level parameters are

Parameter Description
result One of success, warning or error depending on the operation outcome
message Explanatory message about the result result. Likely to be blank in the case of success.

Payload Data Schema:

The payload data will be in the form of a JSON string complying to the following JSON Schema

{
    "type": "object",
    "properties": {
        "result": {
            "type": "string",
            "enum": ["success", "warning", "error"]
        },
        "message": {"type": "string"},
    },
    "required": ["result", "message"],
}

where the message field is likely to be empty if the result is a success.

Example:

For example, a successful call to cancel_recipe may return

{
    "result": "success",
    "message": ""
}

where as an unsuccessful call might return

{
    "result": "warning",
    "message": "Could not cancel server running as server is not running."
}

See Also:

  • cancel_recipe for the response sent once the recipe has been cancelled.

load_recipe_ack

Response sent once the load_recipe command has been received.

Parameters:

The top level parameters are

Parameter Description
result One of success, warning or error depending on the operation outcome
message Explanatory message about the result result. Likely to be blank in the case of success.

Payload Data Schema:

The payload data will be in the form of a JSON string complying to the following JSON Schema

{
    "type": "object",
    "properties": {
        "result": {
            "type": "string",
            "enum": ["success", "warning", "error"]
        },
        "message": {"type": "string"},
    },
    "required": ["result", "message"],
}

where the message field is likely to be empty if the result is a success.

Example:

For example, a successful call to load_recipe may return

{
    "result": "success",
    "message": ""
}

where as an unsuccessful call might return

{
    "result": "warning",
    "message": "Could not load recipe as the server is already running a recipe. Cancel the currently running recipe to proceed."
}

See Also:

  • cancel_recipe for the response sent once the recipe has been loaded.

run_recipe_ack

Response sent once the run_recipe command has been received.

Parameters:

The top level parameters are

Parameter Description
result One of success, warning or error depending on the operation outcome
message Explanatory message about the result result. Likely to be blank in the case of success.

Payload Data Schema:

The payload data will be in the form of a JSON string complying to the following JSON Schema

{
    "type": "object",
    "properties": {
        "result": {
            "type": "string",
            "enum": ["success", "warning", "error"]
        },
        "message": {"type": "string"},
    },
    "required": ["result", "message"],
}

where the message field is likely to be empty if the result is a success.

Example:

For example, a successful call to run_recipe may return

{
    "result": "success",
    "message": ""
}

where as an unsuccessful call might return

{
    "result": "warning",
    "message": "Could not start running recipe as the server is already running a recipe. Cancel the currently running recipe to proceed."
}

See Also:

  • run_recipe for the response sent once the recipe has started running.

send_sys_info

Response sent once the get_sys_info command has been received.

Parameters:

The top level parameters are

Parameter Description
deviceName Device type, e.g. XO-VAC
deviceColour RGB colour of the paint work
dom Date of manufacture
firmwareVersion Firmware version as a monotonically increasing integer
sensorList List of the attached sensors
tempRange Human readable format of the temperature range

Parameter sensorList takes the form of a list of objects with the following format

Parameter Description
name Human readable name for the temperature sensor
board ID of the internal board it is connected to. Exobotics use only.
channel ID of the internal channel it is connected to. Exobotics use only.
type Sensor type.

Payload Data Schema:

The payload data will be in the form of a JSON string complying to the following JSON Schema

{
        "type": "object",
        "properties": {
            "deviceName": {
                "type": "string",
                "enum": ["XO-VAC"]
            },
            "deviceColour": {
                "type": "array",
                "items": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 255
                },
                "minItems": 3,
                "maxItems": 3
            },
            "dom": {
                "type": "integer",
                "minimum": 0
            },
            "firmwareVersion": {
                "type": "integer",
                "minimum": 0
            },
            "sensorList": {
                "type": "array",
                "items": {
                    "properties": {
                        "name": {"type": "string"},
                        "board": {
                            "type": "integer",
                            "minimum": 0
                        },
                        "channel": {
                            "type": "integer",
                            "minimum": 0
                        },
                        "type": {
                            "type": "integer",
                            "minimum": 0
                        },
                    },
                },
            },
            "tempRange": {"type": "string"},
        },
        "required": ["deviceName", "deviceColour", "dom", "firmwareVersion", "sensorList", "tempRange"],
    }

Example:

For example, a successful call to get_sys_info may return

{
    "deviceName": "XO-VAC 1.0",
     "deviceColour": [36, 67, 153],
      "dom": 44742,
       "firmwareVersion": 1.0,
       "sensorList": [
        {"name": "External TEC 1 Sink  - NTC", "board": 1, "channel": 1, "type": 1}, 
        {"name": "External TEC 2 Sink - NTC", "board": 2, "channel": 1, "type": 1}, 
        {"name": "Internal TEC1 Face - PT1000", "board": 1, "channel": 2, "type": 4}, 
        {"name": "Internal TEC2 Face - PT1000", "board": 2, "channel": 2, "type": 4}, 
        {"name": "Fixed Chamber Sensor 1 - PT1000", "channel": 0, "type": 5},
        {"name": "Fixed Chamber Sensor 2 - PT1000", "channel": 1, "type": 5}, 
        {"name": "Fixed Chamber Sensor 3 - PT1000", "channel": 2, "type": 5}, 
        {"name": "Free Chamber Sensor 1 - PT1000", "channel": 3, "type": 6}, 
        {"name": "Free Chamber Sensor 2 - PT1000", "channel": 4, "type": 6}, 
        {"name": "Free Chamber Sensor 3 - PT1000", "channel": 5, "type": 6}], 
        "tempRange": "-50C to 125C", 
        "tecUpperLimitTemperature": 125, 
        "tecLowerLimitTemperature": -273.15,
        "sinkTempDiscrepancy": 10, 
        "objectTempDiscrepancy": 5, 
        "convergenceMarginTemperature": 0.5, 
        "convergenceMarginTime": 60, 
        "serialIoPort": "COM6", 
        "serialIoBaudRate": 57600, 
        "serverIP": "192.168.1.1", 
        "serverPort": 8080, 
        "tecBoard1Address": 1,
        "tecBoard2Address": 2, 
        "rtdControllerAddress": 3, 
        "tecExternalLimits": {"productName": "HiTemp ETX Series ETX15-28-F2-5252-TA-RT-W6", "limitI": 13.7, "limitV": 47.1, "limitTdiff": 102.0}, 
        "tecInternalLimits": {"productName": "HiTemp ETX Series ETX8-12-F2-2525-TA-RT-W6", "limitI": 7.5, "limitV": 20.8, "limitTdiff": 102.0}}

See Also:

send_log - Not fully implemented

Response sent once the get_log command has been received.

Payload Data Schema:

The payload data for this command is an ascii string giving the server log to date.

Warning

This log file may be extremely large. There is currently no implementation of chunk based reading. If your applications wants regular updates then it is recommended to listen to log_updated messages.

Example:

For example, a successful call to get_log may return

28/07/2022 00:35:41 - System moving to 'Idle' state
28/07/2022 00:38:22 - System moving to 'Idle' state
28/07/2022 00:38:46 - System moving to 'Idle' state
28/07/2022 14:02:02 - System moving to 'Idle' state
28/07/2022 14:08:31 - System moving to 'Idle' state
28/07/2022 14:10:32 - System moving to 'Idle' state
28/07/2022 14:18:01 - System moving to 'Idle' state

See Also:

  • get_log for the triggering command.

shutdown_ack - Unimplemented

Warning

This functionality is currently unimplemented.

Response sent once the shutdown command has been received. Please use the physical buttons onboard your XO-VAC.

Parameters:

The top level parameters are

Parameter Description
result One of success, warning or error depending on the operation outcome
message Explanatory message about the result result. Likely to be blank in the case of success.

Payload Data Schema:

The payload data will be in the form of a JSON string complying to the following JSON Schema

{
    "type": "object",
    "properties": {
        "result": {
            "type": "string",
            "enum": ["success", "warning", "error"]
        },
        "message": {"type": "string"},
    },
    "required": ["result", "message"],
}

where the message field is likely to be empty if the result is a success.

Example:

For example, a successful call to shutdown may return

{
    "result": "success",
    "message": ""
}

where as an unsuccessful call might return

{
    "result": "warning",
    "message": "The `shutdown` operation is currently unimplemented. Please use the physical buttons onboard your XO-VAC."
}

See Also:

send_status

Response sent once the get_status command has been received.

Parameters:

The top level parameters are

Parameter Description
result One of success, warning or error depending on the operation outcome
message Explanatory message about the result result. Likely to be blank in the case of success.
state Current machine state. One of Initialise, IdleState, RunState, ErrorState

Payload Data Schema:

The payload data will be in the form of a JSON string complying to the following JSON Schema

{
    "type": "object",
    "properties": {
        "result": {
            "type": "string",
            "enum": ["success", "warning", "error"]
        },
        "message": {"type": "string"},
        "state": {
            "type": "string",
            "enum": ["Initialise", "IdleState", "RunState", "ErrorState"]
        },
    },
    "required": ["result", "message", "state"],
} 

where the message field is likely to be empty if the result is a success.

Example:

For example, a successful call to get_status may return

{
    "result": "success",
    "message": "",
    "state": "RunState"
}

See Also:

send_air_side_heatsink_temp

Response sent once the get_air_side_heatsink_temp command has been received. Temperature is returned in Celsius.

Parameters:

The top level parameters are

Parameter Description
result One of success, warning or error depending on the operation outcome
message Explanatory message about the result result. Likely to be blank in the case of success.
temperature Temperature in degrees

Payload Data Schema:

The payload data will be in the form of a JSON string complying to the following JSON Schema

{
    "type": "object",
    "properties": {
        "result": {
            "type": "string",
            "enum": ["success", "warning", "error"]
        },
        "message": {"type": "string"},
        "temperature": {"type": "number"},
    },
    "required": ["result", "message", "temperature"],
} 

where the message field is likely to be empty if the result is a success.

Example:

For example, a successful call to get_air_side_heatsink_temp may return

{
    "result": "success",
    "message": "",
    "temperature": 36.57
}

See Also:

send_vac_side_heatsink_temp

Response sent once the get_vac_side_heatsink_temp command has been received. Temperature is returned in Celsius.

Parameters:

The top level parameters are

Parameter Description
result One of success, warning or error depending on the operation outcome
message Explanatory message about the result result. Likely to be blank in the case of success.
temperature Temperature in degrees

Payload Data Schema:

The payload data will be in the form of a JSON string complying to the following JSON Schema

{
    "type": "object",
    "properties": {
        "result": {
            "type": "string",
            "enum": ["success", "warning", "error"]
        },
        "message": {"type": "string"},
        "temperature": {"type": "number"},
    },
    "required": ["result", "message", "temperature"],
} 

where the message field is likely to be empty if the result is a success.

Example:

For example, a successful call to get_vac_side_heatsink_temp may return

{
    "result": "success",
    "message": "",
    "temperature": 36.57
}

See Also:

unrecognized_command

Sent when the server recieves an unrecognised command.

Parameters:

The top level parameters are

Parameter Description
name Name of the command received
message Explanatory message about the issue.

Payload Data Schema:

The payload data will be in the form of a JSON string complying to the following JSON Schema

{
    "type": "object",
    "properties": {
        "name": {"type": "string",},
        "message": {"type": "string"},
    },
    "required": ["name", "message"],
} 

Example:

For example, sending the command sdfsfdsdf will return a response similar to

{
    "name": "sdfsfdsdf", 
    "message": "Unrecognised command \"sdfsfdsdf\". Please check your syntax carefully!"
}

log_new_line

Emitted when the server is adding a line to its log. Currently only 'info' level log items are emitted.

Parameters:

The top level parameters are

Parameter Description
level Level of the log of info, warning or error depending on the lines importance.
verbosity UNUSED - Will show verbosity of an info message on a scale of 1-5 where 1 is most important and 5 is the least. Currently unimplemented and will always show 1.
text Explanatory message about the issue.

Payload Data Schema:

The payload data will be in the form of a JSON string complying to the following JSON Schema

{
    "type": "object",
    "properties": {
        "level": {
            "type": "string",
            "enum": ["info", "warning", "error"]
        },
        "verbosity": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5
        },
        "text": {"type": "string"},
    },
    "required": ["level", "verbosity", "text"],
} 

Example:

For example, sending the command sdfsfdsdf will return a response similar to the example in unrecognized_command but will also receive a message similar to the following

{
    "level": "info", 
    "verbosity": 1, 
    "text": "29/07/2022 12:11:48 - Server: Received unrecognised command \"sdfsfdsdf\". Payload data = \"\""
}

See Also:

recipe_step_finished - Unimplemented

Sent once a step in the running recipe has been completed. This function is currently unimplemented - current recipe step can be obtained from the send_results function.

Parameters:

The top level parameters are

Parameter Description
result One of success, warning or error depending on the operation outcome
message Explanatory message about the result result. Likely to be blank in the case of success.
completed_step_no Number of the step just completed

where the message field is likely to be empty if the result is a success.

Payload Data Schema:

The payload data will be in the form of a JSON string complying to the following JSON Schema

{
    "type": "object",
    "properties": {
        "result": {
            "type": "string",
            "enum": ["success", "warning", "error"]
        },
        "message": {"type": "string"},
        "state": {
            "type": "string",
            "enum": ["Initialise", "IdleState", "RunState", "ErrorState"]
        },
    },
    "required": ["result", "message", "state"],
} 

Example:

For example, a successful step completion in a running recipe may send

{
    "result": "success",
    "message": "",
    "completed_step_no": 3
}

An unsuccessful step completion may send

{
    "result": "error",
    "message": "Failed to make temperature using user sensor, is the sensor attached correctly?",
    "completed_step_no": 3
}

invalid_arguments

Sent when the server receives a valid command with invalid arguments. Some invalid arguments will mean the command isn't executed and these will be marked with a level: "error" field. Commands that are able to recover will be marked with a level: "warning" field.

Parameters:

The top level parameters are

Parameter Description
name Name of the command received
level Level of error warning or error depending on whether the issue could be circumvented or not.
message Explanatory message about the issue.
errors List of errors.

errors is only guaranteed to be present in the case of level: "error"

Payload Data Schema:

The payload data will be in the form of a JSON string complying to the following JSON Schema

{
    "type": "object",
    "properties": {
        "name": {"type": "string",},
        "level": {
            "type": "string",
            "enum": ["warning", "error"]
        },
        "message": {"type": "string"},
        "errors": {
            "type": "array",
            "minContains": 1,
            "items": {
                "type": "string"
            }
        },
    },
    "required": ["name", "level", "message"],
    "if": {
        "properties": {
            "level": { "const": "error" }
        }
    },
    "then": { "required": ["errors"] }
} 

Example:

Sending the a non-empty data payload to a command that doesn't accept arguments will return a warning. For example, the cancel_recipe command will return a response similar to

{
    "name": "cancel_recipe", 
    "level": "warning", 
    "message": "Received a data payload for a command that accepts none. Please check your syntax."
}

Sending the an invalid data payload to a command that does accept arguments will return an error. For example, sending

{
    "invalid_contents": "this won't work"
}

to the load_recipe will return a response similar to

{
    "name": "load_recipe", 
    "level": "error", 
    "message": "Received invalid arguments to a command. Please check your syntax.", 
    "errors": ["'recipe' is a required property"]
}

send_recipe

Response sent once the get_recipe command has been received.

Parameters:

The top level parameters are

Parameter Description
result One of success, warning or error depending on the operation outcome
message Explanatory message about the result result. Likely to be blank in the case of success.
recipe Array of recipe items. Only present if result is success

Each recipe item consists of the following parameters

Parameter Description
targetT Target temperature for this step
gradient Maximum allowable gradient of the transition
duration Target duration of the step

Refer to the TODO INSERT LINK HERE for documentation of how the XO-VAC+ makes decisions in case of invalid or inappropriate arguments.

Payload Data Schema:

The payload data will be in the form of a JSON string complying to the following JSON Schema

{
    "type": "object",
    "properties": {
        "result": {
            "type": "string",
            "enum": ["success", "warning", "error"]
        },
        "message": {"type": "string"},
        "recipe": {
            "type": "array",
            "minItems": 1,
            "items": {
                "type": "object",
                "properties": {
                    "targetT": {
                        "type": "number"
                    },
                    "gradient": {
                        "type": "number"
                    },
                    "duration": {
                        "type": "number"
                    },
                },
                "required": ["targetT", "gradient", "duration"],
            }
        },
    },
    "required": ["result", "message", "recipe"],
}

where the message field is likely to be empty if the result is a success.

Example:

For example, a successful call to get_recipe may return

{
    "result": "success",
    "message": "",
    "recipe": [
        {
            "targetT": 90,
            "gradient": 3.0,
            "duration": 60
        },
        {
            "targetT": 90,
            "gradient": 1.0,
            "duration": 200
        },
        {
            "targetT": 25,
            "gradient": 3.0,
            "duration": 60
        },
    ]
}

See Also:

send_results

Emitted at regular intervals (every few seconds) when system is in run state. Contains latest sensor readings, recipe step, run times, and any error messages.

Parameters:

The top level parameters are

Parameter Description
result One of success, warning or error depending on the operation outcome
message Explanatory message about the result result. Likely to be blank in the case of success.
results The latest results

The results field contains the following fields

Parameter Description
recipeStep Currently running step of recipe (integer)
stepElapsedTime Elapsed time of current step
totalRunTime Elapsed total run time
allSensorReadings Object contianing all sensor readings
runtimeMsg Error/Info message, if any

Each field in allSensorReadings is of the form

Parameter Description
`sensor name' Temperature in degrees

Payload Data Schema:

The payload data will be in the form of a JSON string complying to the following JSON Schema

TBC - no schema currently implemented.
Data is currently json string of form: {"recipeStep": step, "stepElapsedTime": stepTime, "totalRunTime": totalTime,
                                            "allSensorReadings": allReadings, "runtimeMsg": msgString}

Example:

For example, a successful call to get_results may return

{
    result: success,
    message: '', 
    results: {
        recipeStep: 1, 
        stepElapsedTime: 6.795468807220459, 
        totalRunTime: 6.795468807220459, 
        allSensorReadings: {
            External TEC 1 Sink  - NTC: 95.70217908275949, 
            External TEC 2 Sink - NTC: -6.8595430310119525, 
            Internal TEC1 Face - PT1000: 50.2528315806109, 
            Internal TEC2 Face - PT1000: 95.49693555635625, 
            Fixed Chamber Sensor 1 - PT1000: -19.867902018483818, 
            Fixed Chamber Sensor 2 - PT1000: -11.59236930907528, 
            Fixed Chamber Sensor 3 - PT1000: 23.93133339293081, 
            Free Chamber Sensor 1 - PT1000: 36.57968716400697,
            Free Chamber Sensor 2 - PT1000: 11.711664852874677, 
            Free Chamber Sensor 3 - PT1000: 44.20294542862622, 
            Reference sensors: -22.632708638267445
            }, 
        runtimeMsg: ''
        }
}

See Also:

  • results_chunk for the incremental update message sent regularly by the server

results_chunk - Unimplemented

Message incrementally sent by the server while running containing any new sensor readings acquired.

Not to be confused with the send_results response which returns all the sensor readings from last ran recipe or all the results so far of the currently running recipe.

Parameters:

The top level parameters are

Parameter Description
recipe_step_no The current recipe step number
recipe_step_duration Time (in seconds) spent on the current recipe step
recipe The currently running recipe
results Array of sensor results

Each recipe item consists of the following parameters

Parameter Description
targetT Target temperature for this step
gradient Maximum allowable gradient of the transition
duration Target duration of the step

The results filed is split into arrays of objects containing the sensor values for independent sensors

Parameter Description
sensor_name TName of the sensor
values Array of values

Each field in values is split into

Parameter Description
value Temperature in degrees
time Time (in seconds) since the beginning of the recipe
recipe_step Recipe step associated with this value

Payload Data Schema:

The payload data will be in the form of a JSON string complying to the following JSON Schema

{
        "type": "object",
        "properties": {
            "recipe_step_no": {
                "integer": "string",
                "minimum": 0
            },
            "recipe_step_duration": {
                "integer": "number",
                "minimum": 0
            },
            "recipe": {
                "type": "array",
                "minItems": 1,
                "items": {
                    "type": "object",
                    "properties": {
                        "targetT": {
                            "type": "number"
                        },
                        "gradient": {
                            "type": "number"
                        },
                        "duration": {
                            "type": "number"
                        },
                    },
                    "required": ["targetT", "gradient", "duration"],
                }
            },
            "results": {
                "type": "array",
                "minItems": 1,
                "items": {
                    "type": "object",
                    "properties": {
                        "sensor_name": {
                            "type": "string"
                        },
                        "values": {
                            "type": "array",
                            "minItems": 1,
                            "items": {
                                "type": "object",
                                "properties": {
                                    "value": {
                                        "type": "number"
                                    },
                                    "time": {
                                        "type": "number",
                                        "minimum": 0
                                    },
                                    "recipe_step": {
                                        "type": "integer",
                                        "minimum": 0
                                    },
                                },
                                "required": ["value", "time", "recipe_step"],
                            }
                        }
                    },
                    "required": ["sensor_name", "values"],
                }
            }
        },
        "required": ["current_recipe_step", "recipe", "results"],
    }

Example:

For example, results_chunk may send a message similar to the following

{
    "current_recipe_step": 2, 
    "recipe": [
        {
            "targetT": 90, 
            "gradient": 3.0, 
            "duration": 60
        }, 
        {
            "targetT": 90, 
            "gradient": 1.0, 
            "duration": 200
        }, 
        {
            "targetT": 25, 
            "gradient": 3.0, 
            "duration": 60
        }
    ], 
    "results": [
        {
            "sensor_name": "External TEC 1 Sink  - NTC", 
            "values": [
                {
                    "value": 21, 
                    "time": 10001, 
                    "recipe_step": 0
                }, 
                {
                    "value": 22, 
                    "time": 10002, 
                    "recipe_step": 1
                }, 
                {
                    "value": 23, 
                    "time": 10003, 
                    "recipe_step": 2
                }
            ]
        }, 
        {
            "sensor_name": "Fixed Chamber Sensor 1 - PT1000", 
            "values": [
                {
                    "value": 31, 
                    "time": 20001, 
                    "recipe_step": 0
                }, 
                {
                    "value": 32, 
                    "time": 20002, 
                    "recipe_step": 1
                }, 
                {
                    "value": 33, 
                    "time": 20003, 
                    "recipe_step": 2
                }
            ]
        }
    ]
}

See Also:

results_all

Sent in response to the get_results_all command. This function should not be called until the recipe run has completed.

Warning

Depending on the length of run recorded this file may be several MB in size and take several seconds to download

Parameters:

The top level parameters are

Parameter Description
result One of success, warning or error depending on the operation outcome
message Explanatory message about the result result. Likely to be blank in the case of success.
results List/Array containing all data recorded during run

where the message field is likely to be empty if the result is a success.

Payload Data Schema:

The payload data will be in the form of a JSON string complying to the following JSON Schema

Schema not currently implemented

run_complete

Sent once the running recipe has been completed.

Parameters:

The top level parameters are

Parameter Description
result One of success, warning or error depending on the operation outcome
message Explanatory message about the result result.

Payload Data Schema:

The payload data will be in the form of a JSON string complying to the following JSON Schema

{
    "type": "object",
    "properties": {
        "result": {
            "type": "string",
            "enum": ["success", "warning", "error"]
        },
        "message": {"type": "string"},
    },
    "required": ["result", "message"],
}

error_state

Sent if the server system enters error state. A message may be included giving further information about the error. The error number gives further information about the type of error which occurred.

Parameters:

The payload parameters are

Parameter Description
result 'success' (field not used)
message Optional explanatory message about the error.
'errorNo' Error number (for Exobotics internal use)