Go to file
Eduard Iten 8467b3e347 feat: Make valve obstacle detection parameters configurable via settings and shell
This commit introduces configurable obstacle detection thresholds for the valve, allowing them to be set and persisted via the Zephyr settings subsystem and controlled through the shell and Modbus tool.

- `software/lib/valve/Kconfig`: Added new Kconfig options `VALVE_OBSTACLE_THRESHOLD_OPEN_MA` and `VALVE_OBSTACLE_THRESHOLD_CLOSE_MA` for compile-time configuration and default values.
- `software/include/lib/valve.h`: Removed hardcoded defines and added API functions for setting and getting obstacle thresholds.
- `software/lib/valve/valve.c`:
    - Updated `valve_work_handler` to use the new configurable obstacle thresholds.
    - Integrated loading and saving of obstacle thresholds via the settings subsystem in `valve_init`.
    - Implemented the new setter and getter functions for obstacle thresholds.
    - Updated the `LOG_INF` message in `valve_init` to display the new obstacle threshold values.
- `software/apps/slave_node/prj.conf`: Added default values for the new Kconfig options.
- `software/lib/shell_valve/shell_valve.c`: Added new shell commands `valve set_obstacle_open` and `valve set_obstacle_close` to modify the obstacle thresholds, and updated `valve show` to display them.
- `software/tools/modbus_tool/modbus_tool.py`:
    - Defined new Modbus holding registers (`REG_HOLDING_OBSTACLE_THRESHOLD_OPEN_MA`, `REG_HOLDING_OBSTACLE_THRESHOLD_CLOSE_MA`).
    - Updated `poll_status` to read these new registers.
    - Modified the `main_menu` to include "Set Obstacle Open" and "Set Obstacle Close" options in the settings menu, allowing users to view and modify these parameters.
- `software/lib/modbus_server/modbus_server.c`:
    - Updated `holding_reg_rd` to read the new obstacle threshold registers.
    - Updated `holding_reg_wr` to write to the new obstacle threshold registers.
    - Removed incorrect `REG_HOLDING_END_CURRENT_THRESHOLD_OPEN_MA` and `REG_HOLDING_END_CURRENT_THRESHOLD_CLOSE_MA` cases from `input_reg_rd`.
- `software/include/lib/modbus_registers.h`: Created a new header file to centralize Modbus register definitions, which were previously hardcoded in `modbus_tool.py`.
Signed-off-by: Eduard Iten <eduard@iten.pro>
2025-07-11 09:15:19 +02:00
.vscode feat(refactor): Restructure project for improved modularity and clarity 2025-07-03 16:58:43 +02:00
docs Revert "feat(valve): Implement obstacle detection with configurable thresholds" 2025-07-11 00:35:19 +02:00
hardware Hardware updated 2025-06-30 13:52:33 +02:00
software feat: Make valve obstacle detection parameters configurable via settings and shell 2025-07-11 09:15:19 +02:00
.gemini_commit_message.txt fix(valve): Correct VND7050AJ initialization and pin configuration 2025-07-03 19:04:20 +02:00
.gitignore added gitignore to ignore build dirs 2025-06-13 07:48:18 +02:00
README.de.md docs: replace svg logo with png version 2025-07-02 09:22:37 +02:00
README.es.md docs: replace svg logo with png version 2025-07-02 09:22:37 +02:00
README.fr.md docs: replace svg logo with png version 2025-07-02 09:22:37 +02:00
README.md docs: replace svg logo with png version 2025-07-02 09:22:37 +02:00
setup-format-hook.sh added formatting 2025-07-08 16:06:11 +02:00

README.md

Logo

🇩🇪 Deutsch | 🇬🇧 English | 🇫🇷 Français | 🇪🇸 Español

Modular Irrigation System

This project implements a smart, modular irrigation system controlled via Home Assistant.

Documentation

The detailed documentation can be found in the docs/ directory:

  • Concept: Describes the system architecture, the components used, and the basic design decisions.
  • MODBUS Registers: Defines the register map for communication with the slave nodes.
  • Project Plan: Contains the development and implementation plan.

Quick Start

  • Hardware: The KiCad files for the hardware are located in the hardware/ directory.
  • Software: The Zephyr-based firmware for the slave nodes is located in the software/ directory.