Device States
The device is always in one of several states. The state determines which configuration file is active, whether a user is assigned, and what the device is allowed to do.
The current state is reported in devdata.core.state on every
uplink. The complete list of state codes is:
| Code | State | Description |
|---|---|---|
U |
Unallocated | No user assigned; unallocdata.json is active |
A |
Allocated | User assigned; allocdata.json is active |
E |
Error | A fatal error occurred; the device waits for recovery |
D |
DFU | Device Firmware Update in progress |
P |
Provisioning | Device is in provisioning mode (configuration / setup) |
I |
Reserved | Appears in the JSON reference, not yet documented |
B |
Reserved | Appears in the JSON reference, not yet documented |
W |
Reserved | Appears in the JSON reference, not yet documented |
{ "devdata": { "core": { "state": "A", "ts": 987654321, }, },}State transitions
Section titled “State transitions”The device moves between states based on backend commands, local actions, or hardware events.
| Transition | Trigger |
|---|---|
| Unallocated -> Allocated | alloc_local devwork, or IES allocation |
| Allocated -> Unallocated | return_local devwork, or IES return |
| Any -> Provisioning | devcfg.fw.prov_start set to true |
| Provisioning -> Unallocated | return_local devwork, or 180s inactivity timeout |
| Any -> DFU | devcfg.fw.dfu_start set to true, or BLE DFU characteristic |
| Any -> Error | Fatal runtime error (crashes, corrupt filesystem, etc.) |
Related
Section titled “Related”- Allocation & Return – the full allocation flow
- Provisioning – provisioning mode details
- Core State (Uplink) – how state is reported
- Configuration Files – which config file is active in each state