This commit introduces the VND7050AJ driver as a new submodule and integrates it into the project.
Key changes include:
- Added as a git submodule.
- Enhanced the gateway application () with LittleFS and the settings subsystem.
- Implemented new shell commands (, , ) for managing custom settings.
- Added functionality to compact the settings file.
- Updated to include new library dependencies and log return code.
- Adjusted include paths for in relevant files.
Signed-off-by: Eduard Iten <eduard@iten.pro>
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>
feat: Configure valve logging via Kconfig
This commit adds a Kconfig option to control the log level of the valve library.
- : Added the new Kconfig option.
- : Updated to use and adjusted log levels for debug messages.
- : Enabled debug logging for the valve library by setting .
refactor: Adjust k-vcc calibration value for VND7050AJ
Updated the calibration value in from 4139 to 3816 for the VND7050AJ driver.
Signed-off-by: Eduard Iten <eduard@iten.pro>
- Renamed shell commands in and to be shorter
and remove underscores (e.g., to ).
- Consolidated get functions into a single show command for both valve
and Modbus settings (e.g., , ).
- Adjusted output formatting for show commands to be right-aligned and
remove horizontal lines for better readability.
- Fixed missing getter function implementations in and their
declarations in .
- Ensured is correctly selected in
to make valve shell commands available.
- Updated Doxygen comments in header files (valve.h, fwu.h, modbus_server.h) to be consistent and in English.
- Translated German register names in docs/modbus-registers.de.md to English.
- Updated docs/concept.de.md to reflect new details on current measurement and sensors.
- Updated docs/planning.de.md to reflect completed tasks in Phase 1.
- Implemented VND7050AJ and core functionality including current and voltage measurement and end-position detection.
- Switch from simulated to real ADC readings in adc_sensor library
- Add GPIO control for VND7050AJ sensor selection (sen, s0, s1 pins)
- Implement proper ADC device and channel setup for voltage/current measurements
- Enable ADC driver in prj.conf (CONFIG_ADC=y)
- Disable simulation mode (CONFIG_ADC_SENSOR_SIMULATED=n)
- Add devicetree bindings for custom supply voltage and motor current sensors
- Update overlay with adc_sensors nodes using PB4, PB5, PB6 pins
- Integrate real ADC readings into Modbus server registers
- Support HSE/HSI clock source toggling in overlay configuration
Introduces device tree bindings for custom ADC voltage and current sensors,
allowing for flexible configuration of sensor inputs and associated GPIOs.
This enables proper hardware abstraction for ADC measurements.
The example overlay file
has been removed as its content is now integrated or superseded by the new
binding definitions.
Adds a commented-out clock configuration to the file. This allows switching the clock source from the external high-speed oscillator (HSE) to the internal high-speed oscillator (HSI), which can be useful if an external crystal is not present.
Also, removes the debug log level for the settings subsystem from the project configuration.
This commit introduces a major refactoring of the project structure to align
with Zephyr's recommended multi-application and library organization.
Key changes include:
- Relocation of custom modules from 'software/modules/' to 'software/lib/'.
- Introduction of a central 'software/CMakeLists.txt' to manage application
and library subdirectories.
- Creation of new Kconfig files for 'software/' and 'software/apps/slave_node/'
to define project-wide and application-specific configurations.
- Removal of the 'gateway' and 'stm32g431_tests' applications.
- Removal of 'shell_modbus.c' and 'shell_system.c' from 'slave_node' application's
direct source files, indicating a shift towards library-based shell commands.
- Updates to 'software/apps/slave_node/CMakeLists.txt', 'prj.conf', and
'boards/bluepill_f103rb.conf' to reflect the new structure and dependencies.
Refactor slave_node application to support building for both bluepill_f103rb and
weact_stm32g431_core boards.
- Moved RTT-specific console and shell backend configurations from prj.conf
into board-specific .conf files (bluepill_f103rb.conf).
- Configured USART2 as console/shell for weact_stm32g431_core.
- Added Device Tree Overlay for weact_stm32g431_core to enable USART1 for Modbus
communication (PA9/PA10).
- Integrate the Zephyr Settings subsystem to persist Modbus parameters.
- Use NVS (Non-Volatile Storage) as the backend with a dedicated flash partition.
- Modbus baudrate and slave ID are now loaded at startup.
- Changes made via the shell are saved to flash and survive a reboot.
- Add a 'reset' command to the shell for easier testing.
- Fix all compiler and devicetree warnings for a clean build.
- Implement a new 'modbus' command in the shell.
- Add sub-commands 'set_baud', 'set_id', and 'show'.
- Add validation for baud rate and slave ID inputs.
- The new parameters are applied to the Modbus server at runtime, allowing for live reconfiguration of the communication settings.
- The shell backend is set to RTT.
- Add a basic Modbus RTU server implementation based on Zephyr samples.
- Configure usart1 for Modbus via a board overlay.
- The server initializes and runs, but polling with mbpoll results in a timeout.
- This commit captures a functional but non-working state for further debugging.
- Enable the console subsystem and printk for debugging output.
- Configure the console to use the UART peripheral (usart1 on PA9/PA10).
- Disable RTT to ensure UART is the active console.
- Remove redundant DTS_ROOT from CMakeLists.txt as it's inferred from BOARD_ROOT.
- Clear the project configuration (prj.conf) to start with a minimal baseline.
This commit captures a working multi-app build where the board definition is located in the 'software' directory and explicitly included by the slave_node application. This serves as a stable baseline.
- Reorganize the software directory to support multiple Zephyr applications (gateway, slave_node).
- Create a clear separation between applications and shared libraries.
- Add placeholder files for gateway and slave_node applications.