Commit Graph

46 Commits

Author SHA1 Message Date
Eduard Iten 6dcb11ae0c fix(modbus_tool): Improve UI stability and readability
- Refactor the curses drawing loop to be state-based, eliminating screen flicker after user input.
- Add a helper function to format uptime from seconds into a human-readable string (d/h/m/s).
2025-07-01 21:17:30 +02:00
Eduard Iten 38d6dbe95a feat(modbus_tool): Add interactive TUI and documentation
- Replace the basic command-line prompt with a full-screen, interactive TUI using the  library.
- The new UI provides a real-time, tabular status display and intuitive, button-style menu navigation.
- Implement a consistent blue background theme for better aesthetics.
- Add a detailed  with installation and usage instructions.
- Fix several bugs in the Modbus communication logic.
2025-07-01 20:59:47 +02:00
Eduard Iten b100a8acf7 feat(shell): Add commands for valve timing
- Add shell commands 'valve set_open_time' and 'valve set_close_time' to configure the virtual valve.
- Extend the 'show_config' command to display the new timing values.
- The new settings are persisted to flash storage.
2025-07-01 18:24:20 +02:00
Eduard Iten 269e9e88a1 feat(valve): Implement safe virtual valve control
- Implement virtual valve logic with time-based movement simulation.
- The valve state is now set to 'OPEN' immediately when the opening process starts, ensuring a safe and correct state representation.
- The state is only set to 'CLOSED' after the closing process has finished.
- Add persistence for max opening and closing times.
2025-07-01 18:15:54 +02:00
Eduard Iten 8cab3eecc1 feat(settings): Implement persistent Modbus configuration
- 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.
2025-07-01 16:44:32 +02:00
Eduard Iten 6a9e4773ea feat(shell): Add commands to configure Modbus
- 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.
2025-07-01 15:27:57 +02:00
Eduard Iten b836f9a2f4 feat(slave_node): Implement system registers
- Add read support for system-level input registers:
  - FIRMWARE_VERSION_MAJOR_MINOR (0xF0)
  - FIRMWARE_VERSION_PATCH (0xF1)
  - DEVICE_STATUS (0xF2)
- Use enums for register addresses to improve readability.
- Implement a workaround for a Kconfig issue by hardcoding the firmware version.
- Stabilize multi-register reads by returning 0 for unhandled input registers instead of an exception.
- NOTE: Writing to holding registers is currently unstable with mbpoll and will be addressed separately.
2025-07-01 14:56:56 +02:00
Eduard Iten 032ddf2cc0 feat(slave_node): Implement uptime registers
- Add a callback for reading Modbus input registers.
- Implement logic to provide the system uptime in seconds, split across two 16-bit registers (UPTIME_SECONDS_LOW at 0x00F3 and UPTIME_SECONDS_HIGH at 0x00F4) as per documentation.
- Return 0 for unhandled registers to prevent "Invalid data" errors with certain Modbus masters.
2025-07-01 14:38:10 +02:00
Eduard Iten 1067796df4 fix(slave_node): Stabilize Modbus RTU communication
The Modbus server was previously unstable, leading to intermittent CRC errors when polled by a master. This was caused by the main thread exiting after initialization, which created timing and race condition issues for the interrupt-driven Modbus stack.

This fix ensures the main thread continues to run in a low-power sleep loop (). This provides a stable context for the Modbus server, resolving the CRC errors and ensuring reliable communication.
2025-07-01 14:30:22 +02:00
Eduard Iten 6f81e84541 feat(slave_node): Implement initial Modbus RTU server
- 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.
2025-07-01 13:41:22 +02:00
Eduard Iten 0d3696bf93 feat(slave_node): Switch to RTT console output
- Reconfigure the project to use SEGGER RTT for console output instead of UART.
- Update the main loop with a new printk message for testing purposes.
2025-07-01 12:36:11 +02:00
Eduard Iten b005fd5c11 feat(slave_node): Enable UART console and printk
- 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.
2025-07-01 12:13:59 +02:00
Eduard Iten 6c15b7021f refactor(slave_node): Clean up initial configuration
- 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.
2025-07-01 12:09:36 +02:00
Eduard Iten 842b204d36 refactor(build): Streamline multi-app CMake configuration
Remove the top-level  and configure each application to directly include the  directory as a module or root. This simplifies the build process by making each application more self-contained while still allowing access to shared boards and libraries.
2025-07-01 12:05:18 +02:00
Eduard Iten 5ce96a662d feat: Establish functional multi-app structure
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.
2025-07-01 11:05:12 +02:00
Eduard Iten fbeaa916b9 feat(project): Restructure software for multi-app setup
- 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.
2025-07-01 08:20:25 +02:00
Eduard Iten 423e3947ab feat(docs): Mark task 1.1 as done
Set the task 'Set up development environment for STM32/Zephyr' to done in all planning files.
2025-06-30 18:46:04 +02:00
Eduard Iten 3fd816daca fix(i18n): Correctly translate SVG files 2025-06-30 18:37:53 +02:00
Eduard Iten 7597f5ddc0 feat(i18n): Add French and Spanish translations 2025-06-30 18:10:51 +02:00
Eduard Iten 5971fde145 feat(docs): Deactivate links to the current language 2025-06-30 18:02:02 +02:00
Eduard Iten f008dfb6f0 fix(docs): Correctly translate SVG architecture image 2025-06-30 17:58:31 +02:00
Eduard Iten f9d4a3b971 docs: Restructure and internationalize documentation 2025-06-30 17:49:22 +02:00
Eduard Iten 0fd6466d81 Added planning 2025-06-30 17:25:32 +02:00
Eduard Iten c23d1f08c0 Added modbus register definitions 2025-06-30 17:18:19 +02:00
Eduard Iten 1dc78c948a Moved architecture image and renamed it for german, to enable translation 2025-06-30 16:25:05 +02:00
Eduard Iten c952b9f897 Added archritecture picture 2025-06-30 16:23:24 +02:00
Eduard Iten 97637a8315 Added concept 2025-06-30 16:15:17 +02:00
Eduard Iten 1b066d343b Hardware updated 2025-06-30 13:52:33 +02:00
Eduard Iten d36f3b85b4 sync 2025-06-20 18:41:50 +02:00
Eduard Iten a4aeaa5f91 Fixed modbus init 2025-06-19 17:09:46 +02:00
Eduard Iten 0b5ad510fe merging 2025-06-19 17:04:34 +02:00
Eduard Iten e9fc370094 canbus, modbus working, valve has to be implemented in real 2025-06-19 16:56:21 +02:00
Eduard Iten 852c5c72be Added shell functions 2025-06-17 16:43:13 +02:00
Eduard Iten 9d017f9f8d Zwischenspeichern 2025-06-16 13:09:27 +02:00
Eduard Iten f995b028e9 Fixed double declaration 2025-06-13 10:28:01 +02:00
Eduard Iten 1a85b40444 Fixed setting in canbus 2025-06-13 10:26:57 +02:00
Eduard Iten ade514cbf3 startet canbus implementation 2025-06-13 09:57:34 +02:00
Eduard Iten bd42d85783 moved modbus Kconfig to defconfig 2025-06-13 08:37:29 +02:00
Eduard Iten dc83c27306 renamed modbus test to fit other tests I will add 2025-06-13 08:29:22 +02:00
Eduard Iten 5ab33e3a7b minimal changes 2025-06-13 08:26:49 +02:00
Eduard Iten adc6275c55 added gitignore to ignore build dirs 2025-06-13 07:48:18 +02:00
Eduard Iten 57f7060c0e Added modbus lib and test 2025-06-12 17:04:34 +02:00
Eduard Iten 8d5139c621 Added board files for valve node 2025-06-12 10:00:49 +02:00
Iten Eduard STAG 6bccb8d792 Added kicad project 2025-06-12 09:50:19 +02:00
Iten Eduard STAG 136a373788 Added minimal README-md 2025-06-12 09:41:24 +02:00
Iten Eduard STAG 5d2ca207c0 first commit 2025-06-12 09:20:17 +02:00