chore(devices): TEMP unconditional power_telemetry log + all X- headers
CI / test (push) Has been cancelled

Cycle 4+ polls landed cleanly but power_telemetry stayed silent even
after a php opcache bounce, so the question is whether the firmware
is sending X-Prev-* at all or the controller is filtering them out.
Log unconditionally on every poll and include every X-* request
header so the next poll shows definitively what's arriving over
the wire. Tighten back once diagnosed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-15 15:32:04 -04:00
parent 0489028486
commit 7081d2bee7
+17 -15
View File
@@ -90,21 +90,23 @@ class DeviceImageController extends AbstractController
$currentImageId = (int) $request->headers->get('X-Current-Image-Id', '-1'); $currentImageId = (int) $request->headers->get('X-Current-Image-Id', '-1');
$device->markSeen(); $device->markSeen();
// TEMP: power-monitor — surface the firmware's previous-cycle // TEMP: power-monitor — log every poll with the firmware-side
// telemetry (awake duration + panel-init time) so we can see // headers we care about, even when they're absent, so we can
// whether the PIN_PWR rail cut affects either. Logged on every // tell whether the firmware is sending them at all vs. the
// poll; greppable via `device.poll.power_telemetry`. Remove // controller filtering them out. Greppable via
// alongside the firmware's NVS_KEY_PREV_* writes once validated. // `device.poll.power_telemetry`. Remove alongside the firmware's
$prevAwakeMs = $request->headers->get('X-Prev-Awake-Ms'); // NVS_KEY_PREV_* writes once validated.
$prevPanelInitMs = $request->headers->get('X-Prev-Panel-Init-Ms'); $this->logger->info('device.poll.power_telemetry', [
if ($prevAwakeMs !== null || $prevPanelInitMs !== null) { 'mac' => $mac,
$this->logger->info('device.poll.power_telemetry', [ 'prev_awake_ms' => $request->headers->get('X-Prev-Awake-Ms'),
'mac' => $mac, 'prev_panel_init_ms' => $request->headers->get('X-Prev-Panel-Init-Ms'),
'prev_awake_ms' => $prevAwakeMs, 'boot_reason' => $request->headers->get('X-Boot-Reason'),
'prev_panel_init_ms' => $prevPanelInitMs, 'all_x_headers' => array_filter(
'boot_reason' => $request->headers->get('X-Boot-Reason'), $request->headers->all(),
]); static fn(string $name): bool => str_starts_with(strtolower($name), 'x-'),
} ARRAY_FILTER_USE_KEY,
),
]);
// Auto-correct Device.model from the firmware's X-Panel-Id header. New // Auto-correct Device.model from the firmware's X-Panel-Id header. New
// Devices are created with the default V1 model (see Device entity), so // Devices are created with the default V1 model (see Device entity), so