Fertigation implementation#386
Conversation
- Fixed program array format: fertigation at index 5, name at index 6, date range at index 7 - Updated all program name parsing to use correct index based on fertigation support - Fixed date range enable flag parsing in OSApp.Dates functions - Maintained backward compatibility with old firmware versions - Fixed program name saving to use placeholder or calculated program number instead of 'Program New'
- Sync en_daterange field with flag byte bit 7 when reading programs from file - Ensure en_daterange matches flag byte when endr parameter is not provided - Clear date range values to defaults when date range is disabled - Fixes issue where programs were not starting on schedule due to date range flag mismatch
- Skip fertigation station when scheduling stations from programs (like master stations) - Skip fertigation station in manual_start_program function - Skip fertigation station in runtime queue time-keeping loop - Fertigation station can only run when triggered by stations with fertigation enabled
|
Is there anyone that can review this like @rayshobby or someone with privileges? |
|
Thanks for submitting this! This is a useful but specialized feature that addresses a specific use case. Currently, our policy is to keep the core firmware focused on features we can fully support, understand, test, and document. Because this is a niche implementation, we are hesitant to merge it immediately as it would become a long-term maintenance liability for us. For now, we're going to hold off on merging. If we see increased demand from other users for this specific functionality, we will revisit it. In the meantime, we’ll keep this PR open for those looking for this feature. |
|
Thank you. Yes this probably is more for professional use. I have also made a pull request on the UI side, OpenSprinkler/OpenSprinkler-App#284 please add the same comment there in case someone comes looking for this later on. |
- Replace FertigationConfig{enabled,mode,fert_sid,value}[] with a flat
uint16_t fert_duration[] array (0 = disabled). Halves per-program fert
storage and eliminates three fields that were set but never read.
- Fix uint16_t underflow: cap fert_dur <= station_dur before computing
the centered delay to prevent wrap-around on unsigned subtraction.
- Fix concurrent-group race condition: collect fert_valve_needed across
all stations before touching the hardware bit, so station B cannot
close a valve that station A just opened in the same scheduler tick.
- Remove fragile manual-run program matching by duration (±5 s tolerance
could match the wrong program). Run-once fertigation now flows through
os.runonce_fert[], populated by /cr and cleared when the queue empties.
- Remove /pf endpoint (server_change_program_fert): it was dead code with
no app caller and could silently corrupt stored fert values on round-trip.
- Move ProgramStruct prog declaration outside the inner station loop.
- Remove backward-compat validation loop in program.cpp (referenced the
now-deleted struct fields).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Relates to issue #373
Define a station as fertilization valve