python3-improv: expose device info + network status over BLE (imx93-jaguar-eink) - #37
Merged
Merged
Conversation
…aguar-eink) Add the SIG Device Information Service (0x180A: manufacturer, model, full SoC UID as Serial Number, firmware/hardware/software revisions) and a Dynamic Devices vendor Network Status characteristic (versioned JSON: state/ssid/ipv4/rssi/iface; read+notify). DIS/vendor services are added after the Improv service so only Improv is advertised (bless advertises services[0]), keeping the legacy advert within budget. Identity is auto-detected (soc0 serial, device-tree model, os-release) and env-overridable for multi-board reuse. Network status is cached and refreshed off the BLE event loop, notifying on Wi-Fi connect. Link state is derived from NetworkManager's numeric device-state code (avoids the "disconnected" contains "connected" substring trap); SSID/RSSI are read only when connected, with an SSID fallback to the active connection. improv.service now advertises eink-<BOARD_ID> (IMPROV_SERVICE_NAME override removed) and sets IMPROV_SERVER_HOST to the live onboarding API. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8985ebd. Configure here.
… link state - compute_net_status: NetworkManager's numeric device state is authoritative; a lingering interface IP no longer upgrades a disconnected/failed device to "connected", and IP/SSID/RSSI are only surfaced when genuinely connected. - Remove the synchronous compute_net_status() calls from wifi_connect() and run() startup, which ran multi-second nmcli subprocesses on the asyncio/BLE event loop and stalled Improv read/write handling. Startup seeds via an executor; provisioning triggers an immediate off-loop refresh through a new asyncio.Event consumed by net_status_loop. Addresses Bugbot findings on PR #37. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Extends the imx93-jaguar-eink Improv BLE onboarding server so a central can read
device identity and live network state during onboarding.
0x180A) — manufacturer, model, firmware /hardware / software revision, and the full SoC UID exposed as Serial
Number (
0x2A25). Values derive from the SoC serial / build info with envoverrides; Improv stays the first advertised service.
JSON:
state,ssid,ipv4,rssi,iface. Cached and re-published onprovisioning state change via a background loop.
eink-<BOARD_ID>(theolder deployed build hardcoded
SERVICE_NAME="Improv");improv.servicenolonger forces
IMPROV_SERVICE_NAMEand pointsIMPROV_SERVER_HOSTat thelive onboarding API.
code instead of substring matching (previously
"disconnected"matched"connected"), and only reads SSID/RSSI when genuinely connected.Companion
App/CLI side lands in
active-esl-onboard(DynamicDevices/active-esl-onboard#8):the Flutter app reads DIS + network status during
provision()and shows it onthe success screen;
improv_provision.pyprints the same fields.Deploy note
This must ship in the OS image and be OTA'd before the bench hot-patch
(
/etc/improv+ systemd drop-in) can be dropped andeink-schedulerunmasked —removing the hot-patch before the image ships reverts to the old script.
Test plan
python3 -m py_compile onboarding-server.pyeink-<BOARD_ID>;improv_provision.py inforeads SoC UID + DIS metadata + live networkstatus; full disconnected→provision flow verified over BLE
image (no hot-patch)
Made with Cursor