Skip to content

python3-improv: report Foundries enrolment/OTA state in Device-Status (ota block) - #45

Merged
ajlennon merged 2 commits into
mainfrom
board/foundries-ota-status
Jul 20, 2026
Merged

python3-improv: report Foundries enrolment/OTA state in Device-Status (ota block)#45
ajlennon merged 2 commits into
mainfrom
board/foundries-ota-status

Conversation

@ajlennon

Copy link
Copy Markdown
Member

Summary

Adds an ota block to the Improv Device-Status superset (vendor char e5f10002) so the app and cloud can see, during BLE onboarding, whether an imx93-jaguar-eink board is enrolled to a Foundries factory and running the OTA client.

This is the board-lane half of the Foundries onboard/offboard feature (Alex-directed 2026-07-20): report Foundries state over Improv, with app/admin controls to onboard (BLE-triggered on-device lmp-device-register) and offboard (cloud→Foundries API, admin-only). Cross-lane work orders are in MemPalace esl/decisions.

ota block

field source notes
registered /var/sota/sota.toml exists config lmp-device-register writes + aktualizr-lite.service ConditionPathExists gate; absent ⇒ not enrolled
factory/tag/hwid/target/os_version /etc/os-release baked at image build
daemon systemctl is-active aktualizr-lite OTA poller running
up_to_date null (on purpose) authoritative answer comes from cloud→Foundries API

All signals are root-free/best-effort and self-reported (untrusted until attested — roadmap P2-1), consistent with time/sec.

Verification

  • py_compile clean; no new pyflakes findings.
  • Offline JSON shape asserted.
  • Validated on eink-0167 (un-enrolled) against real /etc/os-release + /var/sota: {"registered":false,"factory":"eink","tag":"main-imx93-jaguar-eink","hwid":"imx93-jaguar-eink","target":25,"os_version":"5.0.11-25-96","daemon":false,"up_to_date":null}. Flips to registered:true/daemon:true after registration.

Test plan

  • Build lands in a new eink target; read e5f10002 over BLE pre-/post-registration.
  • App renders the ota block (app lane).

Made with Cursor

Alex J Lennon and others added 2 commits July 20, 2026 13:42
… (ota block)

Add an `ota` block to the Improv Device-Status superset (vendor char
e5f10002) so the app/cloud can see, during onboarding, whether the board is
enrolled to a Foundries factory and running the OTA client:

  - registered: /var/sota/sota.toml present (the config lmp-device-register
    writes and aktualizr-lite.service's ConditionPathExists gate); absent =>
    not enrolled to any factory
  - factory/tag/hwid/target/os_version: from /etc/os-release
  - daemon: aktualizr-lite.service active
  - up_to_date: null on the board on purpose — authoritative "on latest target"
    comes from the cloud->Foundries API, not a possibly-OFFLINE device

All signals are root-free/best-effort and self-reported (untrusted until
attested, roadmap P2-1). Verified on eink-0167 (currently un-enrolled):
{"registered":false,"factory":"eink","tag":"main-imx93-jaguar-eink",
"hwid":"imx93-jaguar-eink","target":25,"os_version":"5.0.11-25-96",
"daemon":false,"up_to_date":null}.

Supports the app/admin onboard/offboard-to-Foundries feature (BLE-triggered
on-device registration + cloud offboard via Foundries API).

Co-authored-by: Cursor <cursoragent@cursor.com>
Hot-patching the ota block onto eink-0167 showed the characteristic value
truncatedating mid-JSON at 512 bytes (full payload with the legacy flat mirror
was ~580). Drop the flat top-level state/ssid/ipv4/rssi/iface mirror (the
app has preferred nested net since #41) and add a progressive shrink
(time.iso → ota.os_version/hwid) before publish so a long SSID can't
silently corrupt the JSON. Re-verified over BLE: complete ota block with
registered:false/factory:eink/target:25/daemon:false.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Jul 20, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_9daec275-c7e8-48a4-a0a3-b0e141a8281a)

@ajlennon
ajlennon merged commit 8d7e2f7 into main Jul 20, 2026
2 checks passed
@ajlennon
ajlennon deleted the board/foundries-ota-status branch July 20, 2026 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant