System Commands =============== Ping ---- This topic is used to send a ping request to a device over the Command and Control ``cc`` channel. When the device receives this message, it echoes a response back on the corresponding Command Response ``cr`` topic. This serves as a simple mechanism to verify communication and ensure the device is online and responsive. **Topic Structure:** ``/cc//ping`` .. admonition:: Properties - ``"data":`` {*string*} Echo Message - ``"tranID":`` *(optional)* **Example Command** :guilabel:`Subscribe` ``cs/v2/cc/ABCD-EFGH-1234/ping`` .. code-block:: json { "data": "Up up down down left right ping pong", "tranID": "c3p0" } **Response** :guilabel:`Publish` ``cs/v2/cr/ABCD-EFGH-1234/c3p0`` .. code-block:: json { "data": "Up up down down left right ping pong" } .. admonition:: Error Response - **Data null or missing** ``{"error": "Ping expected data"}`` Reboot ------ Instruct the data logger to reboot. This will also trigger: - The last will topic to publish its message - The State topic will publish an offline message **Topic Structure:** ``/cc//reboot`` .. admonition:: Properties - ``"action": "reboot"`` Reboot data logger. - ``"action": "reconnect"`` Close the MQTT connection and reconnect without rebooting. **Example Command** :guilabel:`Subscribe` ``cs/v2/cc/ABCD-EFGH-1234/reboot`` .. code-block:: json { "action": "reboot" } **Response** :guilabel:`Publish` ``cs/v2/cr/ABCD-EFGH-1234/reboot`` .. code-block:: json { "success": "Reboot complete" } Terminal -------- **Aspen Devices Only** Output Aspen terminal responses in an MQTT payload. :guilabel:`Subscribe` ``/cc//terminal`` .. admonition:: Properties - ``"cmd": "terminal"`` - ``"data":`` {*string*} Aspen Terminal command ["SHOW MEMORY" or "M"] - ``"rawResponse":`` {*Boolean*} - ``true`` output raw terminal response no format - ``false`` format terminal response in JSON **Example Command** :guilabel:`Subscribe` ``cs/v2/cc/ABCD-EFGH-1234/terminal`` .. code-block:: json { "cmd": "terminal", "data": "SHOW MEMORY", "rawResponse": true } The response will output on the Command Response topic :guilabel:`Publish` ``/cr//terminal`` Serial TalkThru --------------- Serial TalkThru allows remote interaction with sensors connected to data logger serial ports. It works similar to the terminal mode serial talk through. The data logger will transmit to the serial sensor and receive one response. One transmission is required for each response from the sensor. This feature is not designed to sniff serial sensor output. The desired communication port must be configured prior to using serial talk thru. This command causes the data logger to enter a "talk thru session". The session will stay active, meaning that the sensor port will remain in a state of not transferring data through to the instructions using the port until it is aborted or times out. The timeout associated with a talkThru session is 1 minute. If no further talkThru commands are received within a minute, the session will end, and normal port operation will resume. The session can also be aborted by publishing to the talkThru topic with the JSON key-value pair ``"abort"`` (the value does not matter). **Topic Structure:** ``/cc//talkThru`` .. admonition:: Properties - ``"comPort":`` *(string)* COM port value. - ``"outString":`` *(string)* ASCII string to be sent to sensor. - ``"numberTries":`` *(string,Optional)* ASCII number string indicating number of transmissions of outString. - ``"respDelay":`` *(string,Optional)* ASCII number string indicating time (milliseconds) to wait for the complete response from a sensor. - ``"abort":`` *(string,Optional)* Abort serial TalkThru session (can be any value). Allowable Com Port Values The acceptable com port values listed below must follow the case format shown. CR1000X & CR6 - ComRS232 - ComC1 - ComC3 CR1000X Only - ComC5 - ComC7 CR6 Only - ComU1 - ComU3 - ComU5 - ComU7 - ComU9 - ComU11 CR350 Only - COM1 - COM2 - COM3 SDM - ComXX of SDM com port selected by SDM-SIO module **Example Command** :guilabel:`Subscribe` ``cs/v2/cc/ABCD-EFGH-1234/talkThru`` .. code-block:: json { "comPort": "ComC1", "outString": "1R\r\n", "numberTries": "1", "respDelay": "500", "abort": "" } .. note:: - The presence of the abort parameter means that the data logger will resume reading from the port on the next scan after the outString command executes. - Carriage return terminators must be escaped, as per JSON specifications. - An incomplete response may require a longer respDelay value. **Response** :guilabel:`Publish` ``/cr//talkThru`` .. code-block:: json { "response": "27.6662\r\n" } If an error occurred, the response will be one of the following error messages: .. code-block:: json { "response": "Illegal ComPort" } .. code-block:: json { "response": "No response received" } .. code-block:: json { "response": "ComPort must be open to use MQTT TalkThru" } MQTT Config ----------- .. admonition:: Deprecated The Recipe download method replace the configuration file with additional functionality in a simpler JSON format. This command is to "onboard" or set up the device. The file received from this command must follow the proprietary binary format expected by the parsing routine. Once this file is received it will be parsed as a binary settings file and if valid, the settings applied and the device restarted. :guilabel:`Subscribe` ``/cc//mqttConfig`` .. code-block:: json { "url" : "", "tranID": "" } **Example command:** :guilabel:`Subscribe` ``cs/v2/cc/ABCD-EFGH-1234/mqttConfig`` .. code-block:: json { "url" : "https://example.123.xyz", } **Response** (After reboot) :guilabel:`Publish` ``cs/v2/cr/ABCD-EFGH-1234/mqttConfig`` .. code-block:: json { "success": "MQTT configuration file loaded" } **Example error:** :guilabel:`Publish` ``cs/v2/cr/ABCD-EFGH-1234/mqttConfig`` .. code-block:: json { "error": "MQTT Configuration transfer error" }