From 004aff310c879222b3be844cc54d6793a1c8dccb Mon Sep 17 00:00:00 2001 From: "Kwabena W. Agyeman" Date: Wed, 26 Mar 2025 21:16:57 -0700 Subject: [PATCH] sensors/boson: Restore FLIR BOSON Factory defaults on reset. It's possible to load settings into the FLIR BOSON via the desktop GUI which prevent it from outputting the expected image after reset. Always restore the factory default settings and apply all recomended steps to set the video output mode. --- src/omv/sensors/boson.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/omv/sensors/boson.c b/src/omv/sensors/boson.c index 8d13d8982..14d1b8db4 100644 --- a/src/omv/sensors/boson.c +++ b/src/omv/sensors/boson.c @@ -87,10 +87,26 @@ static int reset(omv_csi_t *csi) { return -1; } + // Always restore factory defaults to ensure the camera is in a known state. + FLR_RESULT ret = bosonRestoreFactoryDefaultsFromFlash(); + + // FLIR BOSON may glitch after restoring factory defaults. + if (ret != FLR_OK && ret != FLR_COMM_ERROR_READING_COMM) { + return -1; + } + + if (dvoSetOutputFormat(FLR_DVO_DEFAULT_FORMAT) != FLR_OK) { + return -1; + } + if (dvoSetType(FLR_DVO_TYPE_MONO8) != FLR_OK) { return -1; } + if (dvoApplyCustomSettings() != FLR_OK) { + return -1; + } + if (telemetrySetState(FLR_DISABLE) != FLR_OK) { return -1; }