Conversation
# Conflicts: # data/sensors.csv
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.
Pump Telemetry Implementation
This document details the recent updates made to implement universal, on-demand pump telemetry for the AMiGA system.
Summary of Changes
Telemetry Logging Module (
backend/pump_telemetry.py)~/.amiga_runtime_data/pump_telemetry.csv.Time,Component,Action,Direction,Amount (mL),Duration (s), andFrequency (Hz).water_pumpandfood_pump).Pump API Router Logging (
backend/api/routers/pumps.py)pump_telemetry.log_action()function into the API endpoints to record user-triggered actions.api_run_pump_secondslogs a "Manual Prime" event, recording direction, seconds, and Hz.api_run_pumps_secondslogs a "Manual Prime (Multi)" event for multiple pump targets.api_run_pump_mllogs a "Dispense Volume" event, recording the volume (mL).Stepper Pump State Tracking (
backend/pumps.py)self.directionstate attribute to theStepperPumpclass (defaults to"forward").set_direction()method to updateself.direction(forwardorreverse) when the GPIO pins are toggled, allowing the telemetry to accurately record the active motor direction.Testing Infrastructure (
backend/test_telemetry.py)test_telemetry.py) to verify the telemetry module's lifecycle capabilities.Architecture & Benefits
The previous telemetry system relied on continuous background polling. This new architecture creates an event-based ledger. Every time a user initiates a pump action through the frontend dashboard or API, the backend immediately records exactly what operation was performed and its configuration details. This reduces redundant idle data and ensures clean logs.