RepRap Firmware Status responses

From RepRap
Revision as of 13:40, 12 January 2015 by Zombiepantslol (talk | contribs) (Created page with "Because the old-style Duet status response has become somewhat clumsy, I (zpl) decided to introduce a new status response. Its main goal is to achieve better readability and e...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Because the old-style Duet status response has become somewhat clumsy, I (zpl) decided to introduce a new status response. Its main goal is to achieve better readability and enhanced flexibility for different machine setups. They may be utilised either from the HTTP server (see rr_status) or from an attached device using the "M105 S" code.

Please note: These changes haven't been officially released yet, so if there are any comments or suggested improvements, please edit this page and make your changes. And if you know a way to make the JSON data look pretty on the page, please go ahead and do so.

Overview

In general, there shall be three different response types depending on the values required:

  1. Default status response
  2. Enhanced status response
  3. Print status response

Types 2) and 3) shall begin with the default response, only additional values may be added there.

Design guidelines

To avoid messing up this new status response in the future, it's mandatory to keep these design guidelines in mind:

  1. Per cent values are reported as floats on a scale between 0 and 100. Their precision may differ.
  2. Feedrates and accelerations are given in mm/sec or mm/sec²
  3. Temperatures are floats with exactly one decimal place
  4. Boolean values are displayed as either 0 (false) or 1 (true)
  5. Durations and times are reported in seconds with at least one decimal place
  6. Any of the following responses must represent valid JSON data

Status Response Definitions

Default Status Response (type 1)

This one is indended to report basic values. It shall contain only those parameters that are expected to change quickly. Its keys must be either encapsulated or have unique names, so the data remains valid even if additional keys are added by other status response types.

{ "status":"STATE", "coords": { "axesHomed": [0, 0, 0], // If this list contains only one item, we're dealing with a delta printer "extr":[0.0, 0.0], "extrRaw":[0.0, 0.0], "xyz":[0.0, 0.0, 0.0] }, "currentTool":1, // 0 means none "output":{ // This "beepDuration":3000, // is // These are only included "beepFrequency":2000, // missing // in webserver responses "message":"" // by }, // default "params": { "atxPower":0, "fanPercent":100.0, "speedFactor":100.00, "extrFactors":[100.0, 100.0] }, "seq":0, // Only included in webserver response to indicate a new G-code response "sensors": { "probe":0, "probeSecondary":[0,0], // Hidden for unmodulated probes, otherwise its array size depends on the probe type (usually 1 or 2) "fanRPM":0 }, "temps": { "bed": { // Missing "current":20.0, // if no "active":-273.1, // heated "state":0 // bed }, // is present "heads": { "current":[25.0, 25.0], "active":[0.0, 0.0], "standby":[0.0, 0.0], "state":[2, 1] // 0: off, 1: standby, 2: active, 3: fault (same for bed) } } }

with state being one of:

  • I (idle, no movement or code is being performed)
  • B (busy, live movement is in progress or a macro file is being run)
  • P (printing a file)
  • D (decelerating, pausing a running print)
  • S (stopped, live print has been paused)
  • R (resuming a paused print)
  • H (halted, after emergency stop)

Extended Status Response (type 2)

These values are considered to be rather static and aren't expected to change very frequently. It may be polled less frequently than the standard response.

{ "axisMins": [0.0, 0.0, 0.0], "axisMaxes": [220.0, 200.0, 180.0], "accelerations": [1000.0, 1000.0, 1000.0, 1000.0], "coldExtrudeTemp": 0.0, "coldRetractTemp": 0.0, "minFeedrates": [10.0, 10.0, 0.5, 0.33, 0.33, 0.33, 0.33, 0.33], "maxFeedrates": [250.0, 250.0, 3.0, 60.0, 60.0, 60.0, 60.0, 60.0], "name": "My RepRap 1", "probe:" { "threshold": 500, "height": 2.6, "type": 1 }, "tools": [ { "heaters":[0], "drives":[0] }, { "heaters":[1], "drives":[1] } ] }

Print Status Response (type 3)

This status response only adds print-related information. It may be polled instead of type 1 when a file print is in progress.

{ "currentLayer": 0, "fractionPrinted": 0.0, // one decimal place

"firstLayerDuration", 0.0, "printDuration", 0.0, "warmUpDuration", 0.0,

"timesLeft: { "file": 0.0, "filament": 0.0, "layer": 0.0 } }