acme-camera: portalctl types

2d71f1a · Gabriel Morell · 2026-10-13 18:47

3 files +75 -2

Files changed

modified content/presentations/acme-camera.md
+75 −2
@@ -127,8 +127,8 @@ powerctl controls the power domain for the battery charger and reads the fuel ga
127 127 portalctl provides the initial configuration UI and subsequent status web portals
128 128 cameractl reads frames and dispatches them to whatever has been configured
129 129 configctl is the source of truth that gets configuration requests
130 −broker: TODO
131 −infctl: TODO (bonus)
130 +broker: mqtt, likely mosquitto
131 +infctl: inference controller for on-chip npus to load models (bonus)
132 132
133 133 ---
134 134
@@ -219,8 +219,81 @@ struct PowerReading {
219 219
220 220 # Component: Portalctl
221 221
222 +```rust
223 +enum PortalMode {
224 + Setup { ap_ssid: String, ap_psk: String },
225 + Status,
226 + Off,
227 +}
228 +
229 +enum ProvisioningState {
230 + AwaitingCredentials,
231 + JoiningNetwork,
232 + Claiming,
233 + Provisioned,
234 + Failed { reason: String },
235 +}
236 +```
237 +
222 238 Note:
223 239 Interactive wireless authentication and cloud configuration
240 +Setup is a soft-AP on first boot / factory reset, Status once on the home network, Off once cloud-managed
241 +
242 +--
243 +
244 +## Credentials
245 +
246 +```rust
247 +enum WifiSecurity { Open, Wpa2Psk, Wpa3Sae }
248 +
249 +struct WifiCredentials {
250 + ssid: String,
251 + security: WifiSecurity,
252 + passphrase: Option<String>,
253 +}
254 +
255 +struct CloudClaim {
256 + claim_token: String, // QR / app
257 + display_name: String,
258 +}
259 +```
260 +
261 +Note:
262 +claim_token comes from a QR code or the app and is exchanged for device certs
263 +
264 +--
265 +
266 +## Config Requests
267 +
268 +```rust
269 +enum ConfigRequest {
270 + Network(WifiCredentials),
271 + Cloud(CloudClaim),
272 + DisplayName(String),
273 +}
274 +```
275 +
276 +Note:
277 +portalctl publishes these over the broker; configctl validates and applies them
278 +
279 +--
280 +
281 +## Status Portal
282 +
283 +```rust
284 +enum BootSlot { A, B }
285 +
286 +struct DeviceStatus {
287 + display_name: String,
288 + firmware_slot: BootSlot, // A+B boot
289 + state_of_charge: Option<u8>, // powerctl
290 + motion_mode: MotionDetectionMode, // mcuctl
291 + cloud_connected: bool,
292 +}
293 +```
294 +
295 +Note:
296 +Read-only view assembled from the other components via the broker
224 297
225 298 ---
226 299

Parents: e6cddda