Skip to content

calibration: persist through the backend calibration service - #7

Open
babo989 wants to merge 1 commit into
mainfrom
fix/575-calibration-service
Open

babo989 wants to merge 1 commit into
mainfrom
fix/575-calibration-service

Conversation

@babo989

@babo989 babo989 commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Companion to fairscope/PlanktoScope#1013they have to land together. That PR removes
imager/image {action:"save_settings"} from the imager, which is what all three calibration
copies call today, so on its own it would leave calibration silently not persisting.

  • all three copies (Preview, Acquisition, Calibration) publish calibration/save instead of
    calling the controllers directly
  • Preview reads retained status/calibration into acq_led_intensity and gains, which is
    what restores LED brightness after a reload — on_led_toggle already sent
    value: this.acq_led_intensity, that field was just never populated
  • routing: one new mqtt in (status/calibration), one new mqtt out, and a
    calibration/save rule on the two switch nodes that whitelist topics

Gains are divided by 100 on the way out: the flows carry them ×100, calibration.json stores
true gains, the backend multiplies back up for the imager.

The three copies are still triplicated. Each is now a single line calling one backend
procedure, which is the precondition for collapsing them — worth its own PR.

The three calibration copies saved by calling the controllers directly, and
imager/image {action:"save_settings"} no longer exists — it was removed when
calibration persistence moved to the backend. All three now publish
calibration/save with the values they converged on.

Preview also hydrates from retained status/calibration, which populates
acq_led_intensity on page load, so the LED toggle comes back at the calibrated
brightness instead of full scale after a reboot or an off/on cycle.

Requires fairscope/PlanktoScope#1013.
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