DocsReferenceAPI reference

Debug and drills

Fault drills and UI debugging: make the device drop the network or crash, or inject a status to check the UI. Use dropping and crashing only in drills (stick drill)

POST /v1/debug/status#

Inject a status to check the system screen, banner and icons

Signature required

UI debugging: brings up the system screen, banner or status bar icon of a status. Only the UI sees it; the device's real state does not change. set clears itself when time is up (only the latest injection is kept). While an HID_* status is injected, a click of BOOT counts as an emergency stop

Request body#

application/json

Status to inject

FieldTypeRequiredValuesRangeDescription
idstringYespattern ^[A-Z][A-Z0-9_]*$Status name (status_map.def, such as PROVISIONING, IDENTIFY, WIFI_OFFLINE); same as id in GET /v1/status
opstringset clear event; default setset = show it and clear it when time is up, clear = clear it, event = send a one-off event
valueintegerdefault -1Status value; meaning depends on the status
detailstringDetail text; truncated beyond 63 bytes
secondsintegerdefault 101–120How long set lasts, in seconds, 1–120

Examples#

Banner: identify#

JSON
{"id": "IDENTIFY", "op": "event"}

Status bar shows offline for 15 s#

JSON
{"id": "WIFI_OFFLINE", "op": "set", "seconds": 15}

Clear it#

JSON
{"id": "WIFI_OFFLINE", "op": "clear"}

Reply#

Injected

Successful reply; endpoints add their own fields

FieldTypeRequiredValuesRangeDescription
okbooleanYestrueAlways true

Error codes#

StatusCodeDescription
400bad_argsid is not a known status name, op is not set / clear / event, or seconds is not in 1–120. See the example “Banner: identify” for the correct form

For errors any endpoint can return, see Common errors.

POST /v1/debug/net_drop#

Fault injection: drop the network for N s, then reconnect (this page drops too)

Signature required May go offline

For drills (stick drill wifi): about 300 ms after replying the device disconnects Wi-Fi, neither reconnects nor enters Wi-Fi setup for seconds, then rejoins the same network. The device is unreachable meanwhile

Request body#

application/json · optional

The body is optional (defaults to 20 s)

FieldTypeRequiredValuesRangeDescription
secondsintegerdefault 201–60Seconds offline, 1–60

Examples#

Drop for 10 s#

JSON
{"seconds": 10}

Longest: 60 s#

JSON
{"seconds": 60}

Reply#

Dropping

Disconnects about 300 ms after replying

FieldTypeRequiredValuesRangeDescription
okbooleanYestrueAlways true
secondsintegerYes1–60Seconds offline

Error codes#

StatusCodeDescription
400bad_argsseconds is not an integer in 1–60, or the body is not a JSON object. See the example “Drop for 10 s” for the correct form
409not_connectedWi-Fi is not connected (joining or in setup); nothing to drop

For errors any endpoint can return, see Common errors.

POST /v1/debug/crash#

Fault injection: crash and restart after about 0.5 s

Signature required Restarts

For drills (stick drill crash / crash-wdt): logs one E-level line, then crashes and restarts about 500 ms after replying. It leaves a crash dump as usual (GET /v1/crash), counts toward the consecutive-crash count of boot protection, and the black-box log shows the lines before it

Request body#

application/json · optional

The body is optional (defaults to panic)

FieldTypeRequiredValuesRangeDescription
kindstringpanic int_wdt; default panicpanic = abort(); int_wdt = spin with interrupts off on this core so the interrupt watchdog fires

Examples#

Panic#

JSON
{"kind": "panic"}

Interrupt watchdog#

JSON
{"kind": "int_wdt"}

Reply#

Crashing

Crashes and restarts about 500 ms after replying

FieldTypeRequiredValuesRangeDescription
okbooleanYestrueAlways true
kindstringYespanic int_wdtHow it crashes

Error codes#

StatusCodeDescription
400bad_argskind must be panic or int_wdt, or the body is not a JSON object. See the example “Panic” for the correct form
409busyA crash is already scheduled

For errors any endpoint can return, see Common errors.

View the source of this page on GitHub