DocsReferenceAPI reference

Device

Device info, status, logs, screen language, time zone, BOOT button events, identify and restart. info and nonce are open; the rest need signing

GET /v1/info#

Device info: ID, firmware, memory, Wi-Fi, OTA slots, microSD card, web app version

Open

Open; no signing. Hosts use it to identify the device, its firmware and whether it is paired; the rescue firmware omits the kernel-only sections

Reply#

Device info

Sections are filled in by components; hid, apps, sd, blackbox and www exist only in the kernel

FieldTypeRequiredValuesRangeDescription
okbooleanYestrueAlways true
apiintegerYes≥ 1API version, currently 1
idstringYesDevice ID: stick- plus the last 6 hex digits of the Wi-Fi MAC
modestringYeskernel rescueRunning firmware: kernel, or rescue (rescue firmware)
langstringYeszh enScreen language (GET /v1/lang)
fwobjectYesRunning firmware
projectstringYesProject name: stick_kernel / stick_rescue
versionstringYesVersion
buildstringYespattern ^[0-9a-f]{16}$Build ID: first 16 hex digits of the ELF SHA-256
idfstringYesESP-IDF version
datestringYesBuild time
uptime_msintegerYes≥ 0Milliseconds since boot
reset_reasonstringYespoweron sw panic int_wdt task_wdt wdt brownout deepsleep otherReset reason of this boot: poweron, sw = software restart, panic = crash, int_wdt / task_wdt / wdt = watchdog, brownout = low voltage
heapobjectYesMemory (bytes)
internal_freeintegerYes≥ 0Free internal memory
internal_minintegerYes≥ 0Lowest free internal memory since boot
psram_freeintegerYes≥ 0Free PSRAM
wifiobjectYesWi-Fi
ssidstring | nullYesCurrent (or connecting) network; null if none
rssiinteger | nullYesSignal strength (dBm); null when not connected
ipstring | nullYesIP address; null when not connected
provisioningbooleanYesWi-Fi setup is on (setup hotspot open)
knownintegerYes0–3Number of remembered networks (up to 3)
pairedbooleanYesPaired (the device has a pairing key)
otaobjectYesPartitions and the latest update
runningstringYesRunning partition: rescue / kernel_a / kernel_b
bootstringYesPartition for the next boot
statestringYesvalid pending new invalid aborted undefined emptyPartition state: valid, pending = awaiting confirmation, new = written but not booted yet, invalid / aborted = discarded, undefined = unknown, empty
confirm_left_sinteger | nullYesSeconds until automatic rollback while awaiting confirmation; otherwise null
sign_keystringDigest of the signing public key accepted for Wi-Fi updates (SHA-256 of the public key in the running firmware's signature block, 64 hex digits; empty if unreadable). Firmware from 2026-12-02 on
slotsobject[]YesThe rescue, kernel_a and kernel_b partitions
labelstringYesrescue kernel_a kernel_bPartition name
projectstringProject name
versionstringVersion
buildstringpattern ^[0-9a-f]{16}$Build ID
statestringYesvalid pending new invalid aborted undefined emptyPartition state: valid, pending = awaiting confirmation, new = written but not booted yet, invalid / aborted = discarded, undefined = unknown, empty
lastobjectYesResult of the latest update
resultstringYesnone written confirmed rolled_backnone = no record, written, confirmed, rolled_back
buildstringYesBuild ID involved; empty if none
detailstringYesNote: partition written, how it was confirmed, or why it rolled back
crashobjectYesCrash dump (fetch it with GET /v1/crash); without one, only the present field
presentbooleanYesA crash dump exists
sizeinteger≥ 0Dump size in bytes
taskstringTask that crashed
pcstringCrash address
backtracestring[]Backtrace addresses, up to 16
backtrace_corruptedbooleanThe backtrace is corrupted
buildstringBuild ID of the dump (stick crash --decode finds the ELF by it)
hidobjectHID summary (details in GET /v1/hid)
usbstringYeshid serialUSB mode
mountedbooleanYesThe computer has enumerated the device
armedbooleanYesThe network source is armed
playobjectYesmicroSD card timeline playback (details in GET /v1/hid/play_file)
statestringYesidle checking playing done stoppedPlayback state
pathstring | nullYesPath on the card; null if nothing played
doneintegerYes≥ 0Records executed
recordsintegerYes≥ 0Number of records
appsobjectApps
runningstring | nullYesID of the running app; null if none
statestringYesstopped running errorApp state
autostring | nullYesApp that starts on boot; null if none
fs_usedintegerYes≥ 0Storage bytes used
fs_totalintegerYes≥ 0Storage bytes in total
fontsinteger[]Yes20 24 32 48Font sizes with the full font loaded
time_syncedbooleanYesTime is synced
sdobjectmicroSD card; only the present and reason fields when not mounted
presentbooleanYesThe card is mounted
cardstringCard name (CID)
kindstringSDSC SDHC/SDXC MMC SDIOCard type
bus_khzinteger≥ 0Bus clock (kHz)
totalinteger≥ 0FAT size in bytes
usedinteger≥ 0FAT bytes used
reasonstringno_card not_fat io_errorWhy it is not mounted: no_card, not_fat = not FAT formatted, io_error = read/write error
blackboxobjectBlack-box log (written to the microSD card)
statestringYeswaiting writing full errorwaiting = waiting for a card, writing, full = stopped at 16 MB, error
filestring | nullYesLog file on the card; null if none
bytesintegerYes≥ 0Bytes written
lostintegerYes≥ 0Lines lost since boot
wwwobject | nullDevice web app; null if not installed
versionstringYesWeb app version
apiintegerYesAPI version the web app needs

Error codes#

For errors any endpoint can return, see Common errors.

GET /v1/nonce#

Get a one-time nonce for signing (valid 60 s; authenticated replies also carry X-Stick-Nonce)

Open

Open. Each nonce is single use and expires in 60 s; the device keeps up to 16 and drops the oldest when full. Using the one from the reply header saves this round trip

Reply#

Nonce

One-time nonce for signing

FieldTypeRequiredValuesRangeDescription
okbooleanYestrueAlways true
noncestringYespattern ^[0-9a-f]{32}$32 hex digits; single use
ttl_sintegerYes≥ 1Seconds it stays valid

Error codes#

For errors any endpoint can return, see Common errors.

GET /v1/status#

Status bus snapshot: current states and events

Signature required

active lists the states that are on, recent the latest events; the screen and LED follow them

Reply#

Status snapshot

Status bus snapshot

FieldTypeRequiredValuesRangeDescription
okbooleanYestrueAlways true
activeobject[]YesStates currently on
idstringYesStatus name (status_map.def, e.g. OTA_PENDING)
valueintegerYesValue; -1 = none
detailstringYes≤ 63 bytesDetail; may be empty
since_msintegerYes≥ 0Uptime in ms when it began
recentobject[]YesThe latest 16 events, oldest first
idstringYesStatus name (status_map.def, e.g. OTA_PENDING)
valueintegerYesValue; -1 = none
detailstringYes≤ 63 bytesDetail; may be empty
t_msintegerYes≥ 0Uptime in ms when it happened

Error codes#

For errors any endpoint can return, see Common errors.

GET /v1/logs#

Log ring

Signature required

Fetch incrementally: pass the last next as since. A new boot means the device restarted and numbering starts again at 0. Polling every 300 ms follows the log live

Parameters#

ParameterTypeRequiredValuesRangeDescription
sinceinteger≥ 0Start at this sequence number (inclusive), the last next; omit for the last max lines
maxintegerdefault 2001–500Max lines

Reply#

Logs

A slice of the log ring

FieldTypeRequiredValuesRangeDescription
okbooleanYestrueAlways true
bootstringYespattern ^[0-9a-f]{8}$Boot ID: random per boot; a change means the device restarted
nextintegerYes≥ 0since for the next request
droppedintegerYes≥ 0Lines after since that were overwritten and are lost
linesobject[]YesLog lines, oldest first
seqintegerYes≥ 0Sequence number
msintegerYes≥ 0Uptime in ms
textstringYes≤ 240 bytesText without newline or color codes; long lines are cut and end with …

Error codes#

For errors any endpoint can return, see Common errors.

POST /v1/identify#

Identify: screen and LED signal for 5 s

Signature required

Shows which device this is and changes nothing; no request body

Reply#

Signalled

Successful reply; endpoints add their own fields

FieldTypeRequiredValuesRangeDescription
okbooleanYestrueAlways true

Error codes#

For errors any endpoint can return, see Common errors.

POST /v1/reboot#

Restart 0.5 s after replying

Signature required Restarts

Releases all keys first. Restarting a new kernel that awaits confirmation rolls it back (the bootloader returns to the previous version); no request body

Reply#

Restarting

Successful reply; endpoints add their own fields

FieldTypeRequiredValuesRangeDescription
okbooleanYestrueAlways true

Error codes#

For errors any endpoint can return, see Common errors.

GET /v1/lang#

Screen (system UI) language: zh / en; chosen means someone picked it

Signature required

Applies only to the device screen (system UI); app text and message in replies stay as they are

Reply#

Screen language

FieldTypeRequiredValuesRangeDescription
okbooleanYestrueAlways true
langstringYeszh enCurrent language: zh = Chinese, en = English
chosenbooleanYesSomeone has chosen it; Chinese until then
langsstring[]Yeszh enAvailable languages

Error codes#

For errors any endpoint can return, see Common errors.

POST /v1/lang#

Set the screen language; saved and applied immediately

Signature required

Saved on the device; the screen is rebuilt in the new language at once, without a restart. Replies like GET. Applies only to the device screen (system UI); app text and message in replies stay as they are

Request body#

application/json

Screen language to switch to

FieldTypeRequiredValuesRangeDescription
langstringYeszh enzh = Chinese, en = English

Examples#

Switch to English#

JSON
{"lang": "en"}

Switch to Chinese#

JSON
{"lang": "zh"}

Reply#

Saved; current language

Screen language

FieldTypeRequiredValuesRangeDescription
okbooleanYestrueAlways true
langstringYeszh enCurrent language: zh = Chinese, en = English
chosenbooleanYesSomeone has chosen it; Chinese until then
langsstring[]Yeszh enAvailable languages

Error codes#

StatusCodeDescription
400bad_langlang must be zh or en (also returned when the body is not JSON). See the example “Switch to English” for the correct form
500nvsSaving failed. Retry; if it persists, check stick logs

For errors any endpoint can return, see Common errors.

GET /v1/time#

Time and time zone (POSIX TZ + IANA name)

Signature required Kernel only

The clock syncs over SNTP; the time zone sets local, Lua os.date and the time on screen

Reply#

Time and time zone

FieldTypeRequiredValuesRangeDescription
okbooleanYestrueAlways true
syncedbooleanYesTime is synced (SNTP)
epochinteger | nullYesUnix seconds; null until synced
localstring | nullYesLocal time YYYY-MM-DD HH:MM:SS; null until synced
tzstringYesPOSIX TZ string (CST-8 until set)
zonestringYesIANA time zone name; may be empty

Error codes#

For errors any endpoint can return, see Common errors.

POST /v1/time#

Set the time zone; applied immediately

Signature required Kernel only

Saved on the device and applied at once; replies like GET. The host command stick tz fills both from the local time zone

Request body#

application/json

Time zone to set

FieldTypeRequiredValuesRangeDescription
tzstringYespattern ^[A-Za-z0-9<>+,.:/-]+$length 1–63POSIX TZ string, 1–63 bytes of letters, digits and <>+-,.:/
zonestringpattern ^[!-~]*$length ≤ 63IANA time zone name, for display only; optional (stored empty), ≤ 63 bytes of printable ASCII without spaces

Examples#

Sydney (with daylight saving)#

JSON
{"tz": "AEST-10AEDT,M10.1.0,M4.1.0/3", "zone": "Australia/Sydney"}

tz only#

zone omitted; stored empty

JSON
{"tz": "UTC0"}

Reply#

Saved; current time and time zone

Time and time zone

FieldTypeRequiredValuesRangeDescription
okbooleanYestrueAlways true
syncedbooleanYesTime is synced (SNTP)
epochinteger | nullYesUnix seconds; null until synced
localstring | nullYesLocal time YYYY-MM-DD HH:MM:SS; null until synced
tzstringYesPOSIX TZ string (CST-8 until set)
zonestringYesIANA time zone name; may be empty

Error codes#

StatusCodeDescription
400bad_tztz must be 1–63 bytes of letters, digits and <>+-,.:/; zone ≤ 63 bytes of printable ASCII without spaces. See the example “Sydney (with daylight saving)” for the correct form
500nvsSaving failed. Retry; if it persists, check stick logs

For errors any endpoint can return, see Common errors.

GET /v1/button#

BOOT button event ring (click / double-click / long press / hold; stop marks emergency stop)

Signature required Kernel only

Fetch incrementally: pass the last next as since. Clicks and double-clicks that answer a pairing request belong to the system and are not recorded

Parameters#

ParameterTypeRequiredValuesRangeDescription
sinceintegerdefault 0≥ 0Only events after this sequence number, the last next
maxintegerdefault 321–32Max events (the latest ones)

Reply#

BOOT button events

FieldTypeRequiredValuesRangeDescription
okbooleanYestrueAlways true
nextintegerYes≥ 0Sequence number of the latest event; since for the next request
downbooleanYesBOOT is held now
press_stopbooleanYesThe latest press was an emergency stop
eventsobject[]YesEvents, oldest first (the ring keeps the latest 32)
seqintegerYes≥ 0Sequence number
msintegerYes≥ 0Uptime in ms
evstringYesdown up click double long holddown, up, click, double = double-click, long = long press (0.8 s), hold = held 5 s
stopbooleanYesThis press was an emergency stop

Error codes#

For errors any endpoint can return, see Common errors.

View the source of this page on GitHub