Commit Graph
100 Commits
Author SHA1 Message Date
EmpirePhoenix bba959f2a2 Update POST JSON size limit to use SAVEGAME_SLOT_SIZE minus header space 2026-05-30 20:55:51 +02:00
EmpirePhoenix c9a96f37f0 feat: add sensor combine mode with Min, Max, and Avg options, update web UI and configuration for multi-sensor support 2026-05-29 11:22:12 +02:00
EmpirePhoenix fbf97732a4 refactor: update KiCad 3D model paths and zone settings for compatibility with updated libraries 2026-05-28 20:14:51 +02:00
EmpirePhoenix 6b419dba6c Add Wi-Fi scan details display and MQTT publish
- HTML: Add Wi-Fi scan results container to network.html
- Rust: Implement `wifi_scan_details()` with RSSI, channel, auth method
- API & UI: Fetch and display scan results in table format
- MQTT: Publish top 10 networks sorted by RSSI to `/wifi_scan`
2026-05-28 00:46:14 +02:00
EmpirePhoenix 3618b3329c refactor tank info field names and improve null checks in UI 2026-05-27 15:18:46 +02:00
EmpirePhoenix f5f73723d1 retry wifi connection, show canbus FW version, adjust measurement formular 2026-05-27 03:36:39 +02:00
EmpirePhoenix be98380ba4 new toast impl, wip 2026-05-26 13:27:35 +02:00
EmpirePhoenix fe2d227c67 Fix fertilizer calculation and logging 2026-05-26 02:03:19 +02:00
EmpirePhoenix bd5b687430 fix pump test progress bar 2026-05-25 23:22:21 +02:00
EmpirePhoenix 7679fa09dc clippy: fix clippy warnings 2026-05-25 20:11:58 +02:00
EmpirePhoenix d989b41bdd wip website docu 2026-05-21 07:16:39 +02:00
EmpirePhoenix b0f8bcc9da Merge remote-tracking branch 'origin/develop' into develop
# Conflicts:
#	Software/MainBoard/rust/src/hal/water.rs
2026-05-06 09:29:25 +02:00
EmpirePhoenix 103859120c Add initial TODO file with pending tasks for One Wire, Flow Sensor, and PlantProfiles implementation 2026-05-06 09:27:19 +02:00
EmpirePhoenix 403517fdb4 Suppress EMI noise on water flow sensor by filtering short pulses 2026-05-06 09:26:14 +02:00
EmpirePhoenix 11eb8713bf more startup debugging 2026-05-05 18:04:00 +02:00
EmpirePhoenix d903c2bf52 Refactor flow meter logic: replace global mutex with per-instance flow_unit and use critical-section for thread safety. 2026-05-05 16:27:21 +02:00
EmpirePhoenix f8f76674ce Refactor flow meter handling: switch get_flow_meter_value to get_full_flow_count, update related structs and logic to use u32 for flow values. 2026-05-05 01:14:54 +02:00
EmpirePhoenix 3cc5a0d2bd dependency lock upgrade 2026-05-05 00:50:18 +02:00
EmpirePhoenix 3be585ecbf Refactor flow meter handling with interrupt-based logic and global state
- Added `flow_interrupt_handler` for efficient interrupt processing.
- Replaced per-instance `flow_counter` with global atomic and mutex-based state (`FLOW_OVERFLOW_COUNTER`, `FLOW_UNIT`).
- Updated flow meter functions to leverage the new architecture for better modularity and thread safety.
- Switched debugging output from `println!` to `log` for improved logging consistency.
2026-05-05 00:50:18 +02:00
EmpirePhoenix 5b1a945ac3 Replace blocking http_server call with async task using spawner 2026-05-05 00:50:18 +02:00
EmpirePhoenix f4e050d413 Add ChecksumError handling to FatError conversion 2026-05-05 00:50:18 +02:00
EmpirePhoenix 776db785c4 Update hardware and firmware documentation for new modules and features
- Removed outdated TODOs and legacy references in hardware documentation.
- Added details on the new CH32V203-based Sensor Module for CAN bus soil moisture sensors.
- Documented updates to the Battery Management System (CH32V203-based) replacing the older bq34z100 design.
- Refined sensor, pump, and power module descriptions with updated specifications.
- Expanded firmware documentation to include Rust-based ESP32-C6 platform details, new OTA procedure, and MQTT telemetry topics.
- Simplified toolchain setup and compilation process with updated scripts and instructions.
2026-05-05 00:50:18 +02:00
EmpirePhoenix 0ed9d6bb57 Adjust timeouts and constants for improved moisture sensor and backup management accuracy
- Increased CAN measurement timeout to 5000ms for reliability.
- Updated `SAVEGAME_SLOT_SIZE` usage in backup handling for consistency.
- Refined moisture sensor frequency thresholds for better sensor calibration (400Hz-70kHz).
2026-05-03 21:03:13 +02:00
EmpirePhoenix 4771a77686 Merge branch 'test_new_storage' into develop
# Conflicts:
#	Software/MainBoard/rust/src/main.rs
2026-05-03 14:42:08 +02:00
EmpirePhoenix eef165b6de Track overcurrent issues during pump operation
- Added `overcurrent_ma` field to pump results for capturing overcurrent data.
- Enhanced pumping logic to record and propagate overcurrent issues per plant.
- Updated `PumpState` and `PlantState` to handle overcurrent errors.
2026-05-02 01:38:30 +02:00
EmpirePhoenix 1ace878488 Refactor extra1 to fertilizer_pump in HAL and main logic
- Renamed `extra1` method and related calls to `fertilizer_pump` for clarity and better domain alignment.
- Updated HAL implementation to control `extra2` GPIO for fertilizer pump operations.
- Added build script trigger to refresh `VERGEN_BUILD_TIMESTAMP` on each build.
2026-05-01 13:11:47 +02:00
EmpirePhoenix a30d59605d Improve CAN bus error handling and logging
- Enhanced error detection with detailed status logging for bus-off, error warning, and passive errors.
- Added line breaks to CAN and RX error logs for better readability.
- Refined CAN transmission logic and error feedback, including buffer overflow handling.
- Simplified firmware timestamp frame creation and ensured successful sending.
2026-05-01 13:11:37 +02:00
EmpirePhoenix 2ee3615dcd switch fertilizer to extra 1 2026-05-01 10:45:54 +02:00
EmpirePhoenix db0f7daa4c feat: add fertilizer cooldown functionality with web UI, HAL integration, and configuration support 2026-04-30 22:09:04 +02:00
EmpirePhoenix 6809a37d9d feat: add fertilizer pump functionality with configuration, web UI, and HAL integration 2026-04-30 20:44:07 +02:00
EmpirePhoenix 0ca09ed498 feat: add fertilizer pump test functionality with web integration and HAL support 2026-04-30 20:37:07 +02:00
EmpirePhoenix 542ff578bc feat: add bus-off error handling in CAN error status register with error blinking loop 2026-04-30 20:27:38 +02:00
EmpirePhoenix 2e16163b0e feat: implement interleaved sensor measurement timing with slot-based coordination to prevent overlap 2026-04-30 20:19:13 +02:00
EmpirePhoenix 9280bbb244 refactor: rename deep_sleep to deep_sleep_ms for consistency across the codebase 2026-04-30 20:09:48 +02:00
EmpirePhoenix 61806a5fa2 Add mcutie MQTT client implementation and improve library structure
- Integrated `mcutie` library as a core MQTT client for device communication.
- Added support for Home Assistant entities (binary sensor, button) via MQTT.
- Implemented buffer management, async operations, and packet encoding/decoding.
- Introduced structured error handling and device registration features.
- Updated `Cargo.toml` with new dependencies and enabled feature flags for `serde` and `log`.
- Enhanced logging macros with configurable options (`defmt` or `log`).
- Organized codebase into modules (buffer, components, IO, publish, etc.) for better maintainability.
2026-04-27 09:39:29 +02:00
EmpirePhoenix 016047ab23 Update Water HAL: enhance GPIO config with drive mode and input settings
- Added `DriveMode` configuration and input enablement for `one_wire_pin`.
- Improved GPIO initialization with `InputConfig` and default pull settings.
2026-04-26 21:24:51 +02:00
EmpirePhoenix eb276cfa68 Refactor HAL modules: update async support in Water module and reorganize detect_sensors logic
- Replaced `Blocking` with `Async` for ADC operations in `Water` module.
- Improved `detect_sensors` implementation with better structure for sensor messages and autodetection.
- Updated tank ADC sampling to yield between readings, improving efficiency.
2026-04-26 21:01:27 +02:00
EmpirePhoenix f1c85d1d74 Migrate serialization from Bincode to Postcard
- Replaced Bincode with Postcard for serialization/deserialization across configs and save operations.
- Simplified struct derives by removing `bincode`-specific traits.
- Updated `Cargo.toml` and `Cargo.lock` to include `postcard` and dependencies.
- Added padding stripping for deserialization and improved error handling.
- Adjusted serialization logic in `savegame_manager.rs` and related modules.
2026-04-26 20:46:52 +02:00
EmpirePhoenix 097aff5360 Switch savegame serialization format from Bincode to custom parsing
- Replaced Bincode-based serialization/deserialization with a custom save format for better control.
- Introduced save header with magic bytes, timestamp handling, and UTF-8 validation.
- Enhanced error handling for save parsing and increased format flexibility.
- Removed
2026-04-26 20:31:56 +02:00
EmpirePhoenix fc0e18da56 Integrate mcutie library for MQTT functionality
- Added `mcutie` as a dependency in `Cargo.toml` and updated `Cargo.lock`.
- Replaced commented-out MQTT logic with fully implemented functionality in `esp.rs`.
- Enhanced MQTT publish and subscription handling with configurable topics and error handling.
- Updated MQTT connection logic to improve reliability and logging.
2026-04-26 19:56:16 +02:00
EmpirePhoenix 2e4eb283b5 Add AGENTS.md to document repository structure and development guidelines
- Introduced `AGENTS.md` to provide an overview of the repository layout and working conventions.
- Included guidance for firmware, hardware, and website contributions.
- Added validation, file hygiene, and handoff expectations for consistent development practices.
2026-04-26 19:47:07 +02:00
EmpirePhoenix cc92c82ac9 Fix incorrect spawn function call and update dependencies
- Corrected usage of `spawner.spawn` by fixing misplaced error propagation.
- Updated `Cargo.lock` with new and upgraded dependencies, including `base64`, `darling`, and `smoltcp` upgrades.
2026-04-26 19:46:46 +02:00
EmpirePhoenix b8f01f0de9 Remove unused dependencies and imports, cleanup Cargo.lock
- Removed `smoltcp`, `defmt`, and associated dependencies as they are no longer used.
- Updated `Cargo.toml` to exclude unused features from `esp-radio`.
- Cleaned up imports in `esp.rs` for better clarity and consistency.
2026-04-26 19:08:18 +02:00
EmpirePhoenix 79daecf97d add lock for now, as otherwise it wont build 2026-04-26 16:06:13 +02:00
EmpirePhoenix 6b4fd3f701 Add DeepSleep log message and improve formatting consistency
- Introduced `DeepSleep` log message for tracking system sleep events.
- Updated MQTT topic to use `/state` instead of `/firmware/state`.
- Improved code formatting for enhanced readability and maintainability.
2026-04-17 00:31:21 +02:00
EmpirePhoenix 3157ba7e76 Merge branch 'test_new_storage' of ssh://git.mannheim.ccc.de:1337/C3MA/PlantCtrl into test_new_storage 2026-04-16 23:58:38 +02:00
EmpirePhoenix 2493507304 Refactor plant state handling and moisture interpretation
- Replaced `read_hardware_state` with `interpret_raw_values` for better abstraction and clarity.
- Enhanced error handling by introducing `NoMessage` and `NotExpectedMessage` states.
- Updated moisture sensor logic to differentiate expected and unexpected messages.
- Renamed and refactored enum fields for consistency (`raw_hz` to `hz`).
- Minor imports and formatting optimizations.
2026-04-16 23:58:23 +02:00
EmpirePhoenix 0f6cb5243c feat: add pump corrosion protection feature, extend error handling for pump operations, and enhance configuration options 2026-04-16 21:56:46 +02:00
EmpirePhoenix b740574c68 refactor: add timezone support to wait_infinity, improve MQTT updates in config mode, and minor cleanup 2026-04-16 20:42:08 +02:00
EmpirePhoenix 6a71ac4234 Improve flash operation logging and serialization padding
- Added detailed logging for flash write and erase operations.
- Ensured serialized save data is aligned to 4-byte boundaries.
2026-04-14 00:19:18 +02:00
EmpirePhoenix 964bdb0454 fix: handle non-200 responses in config update, ensure progress removal runs only on success 2026-04-13 12:38:00 +02:00
EmpirePhoenix 12405d1bef cleanup 2026-04-12 22:15:52 +02:00
EmpirePhoenix 0e3786a588 Add InterceptorLogger for async log capturing and enhanced debugging
- Implemented `InterceptorLogger` to enable async and sync log capture.
- Integrated log interception for easier diagnostics and debugging.
- Allowed log redirection to serial output via `esp_println`.
2026-04-12 20:45:36 +02:00
EmpirePhoenix b26206eb96 Introduce watchdog and serialization improvements
- Added watchdog timer for improved system stability and responsiveness.
- Switched save data serialization to Bincode for better efficiency.
- Enhanced compatibility by supporting fallback to older JSON format.
- Improved logging during flash operations for easier debugging.
- Simplified SavegameManager by managing storage directly.
2026-04-12 20:38:52 +02:00
EmpirePhoenix 95f7488fa3 Add save timestamp support and log interceptor for enhanced debugging
- Introduced `created_at` metadata for saves, enabling timestamp tracking.
- Added `InterceptorLogger` to capture logs, aiding in error diagnostics.
- Updated web UI to display save creation timestamps.
- Improved save/load functionality to maintain compatibility with older formats.
2026-04-11 22:40:25 +02:00
EmpirePhoenix 0d7074bd89 save tests 2026-04-11 21:34:48 +02:00
EmpirePhoenix bc25fef5ec refactor: consolidate logging and time handling, remove TIME_ACCESS and LOG_ACCESS 2026-04-10 18:53:30 +02:00
EmpirePhoenix 301298522b remove: eliminate file management and LittleFS-based filesystem, implement savegame management for JSON config slots with wear-leveling 2026-04-08 22:12:55 +02:00
EmpirePhoenix 1da6d54d7a new backup adjustments 2026-04-06 19:51:46 +02:00
EmpirePhoenix 0ad7a58219 Improve error handling, ensure robust defaults, and eliminate unsafe unwraps/expectations across modules. 2026-04-06 15:26:52 +02:00
EmpirePhoenix 07aed02fe7 fix mqtt not starting webserver 2026-04-06 12:54:18 +02:00
EmpirePhoenix aef0ffd5a1 add v1 revisio of bms 2026-04-06 12:40:52 +02:00
EmpirePhoenix 4d4fcbe33b store backup now in binary, and let backend serialize/deserialize 2026-04-05 13:30:11 +02:00
EmpirePhoenix 1fa765a5d8 adjust can to hopefull work better 2026-04-01 21:43:16 +02:00
EmpirePhoenix eaa65637f1 Enhance error handling and robustness in TWAI-based sensor detection and moisture measurement. 2026-04-01 01:24:04 +02:00
EmpirePhoenix f1dadd7e6e massivly reduce canbus speed 2026-03-31 18:24:23 +02:00
EmpirePhoenix 7121dd0fae Add silent mode for sensor detection and moisture measurement
- Introduced the `silent` parameter to prevent UI progress updates during automatic operations.
- Enhanced CAN robustness with improved bus-off management, retransmission settings, and jitter tolerance.
- Added auto-refresh functionality for plant moisture and sensor detection with configurable enablement.
2026-03-29 14:21:12 +02:00
EmpirePhoenix 4cf5f6d151 fix: correctly retrieve and display IP address for both IPv4 and IPv6 configurations 2026-03-27 20:45:24 +01:00
EmpirePhoenix 9de5236e65 fix tank sensor 2026-03-27 10:45:33 +01:00
EmpirePhoenix abca324a67 fix website 2026-03-18 01:42:37 +01:00
EmpirePhoenix 57323bad55 Update OTA HTML to display multiple firmware states 2026-03-18 01:32:14 +01:00
EmpirePhoenix 086b0cbe4e Merge branch 'develop' of ssh://git.mannheim.ccc.de:1337/C3MA/PlantCtrl into develop 2026-03-18 01:25:29 +01:00
EmpirePhoenix 39e4e733f3 Fix ota, use MMU to determine running partition, use RMW wrapper for ota_data partition (littelfs handles this internally, so it was no problem prior) 2026-03-18 01:22:33 +01:00
EmpirePhoenix 66e1fe63e0 Revert "new ota logic"
This reverts commit c61a586595.
2026-03-17 22:17:47 +01:00
EmpirePhoenix ce981232f0 Revert "Refactor OTA update handling and improve error reporting."
This reverts commit 7c128a27eb.
2026-03-17 22:17:32 +01:00
EmpirePhoenix 07cf97fffb Revert "Refactor OTA update handling and improve error reporting."
This reverts commit cca13f51d9.
2026-03-17 22:17:28 +01:00
EmpirePhoenix cca13f51d9 Refactor OTA update handling and improve error reporting.
Added a CRC check to firmware uploads, streamlined OTA partition management, and replaced detailed slot states with a single unified state representation. Improved consistency in variable formatting, error handling, and code readability across multiple modules.
2026-03-17 22:16:39 +01:00
EmpirePhoenix 7c128a27eb Refactor OTA update handling and improve error reporting.
Added a CRC check to firmware uploads, streamlined OTA partition management, and replaced detailed slot states with a single unified state representation. Improved consistency in variable formatting, error handling, and code readability across multiple modules.
2026-03-17 22:16:31 +01:00
EmpirePhoenix 924a9ba228 add: script to erase OTA data using cargo espflash 2026-03-17 20:29:51 +01:00
EmpirePhoenix a069888341 reboot after 5 times error code without powercycle 2026-03-17 19:59:55 +01:00
EmpirePhoenix 02c9486e98 canbus fix and ota adjustments 2026-03-15 20:28:53 +01:00
EmpirePhoenix 2d2d7d16cd Merge branch 'develop' of ssh://git.mannheim.ccc.de:1337/C3MA/PlantCtrl into develop 2026-03-15 20:04:02 +01:00
EmpirePhoenix 86f29a336c Merge branch 'develop' of ssh://git.mannheim.ccc.de:1337/C3MA/PlantCtrl into develop 2026-03-15 20:02:05 +01:00
EmpirePhoenix c61a586595 new ota logic 2026-03-15 19:57:19 +01:00
EmpirePhoenix af27f3b820 canbus debugging 2026-03-15 13:43:36 +01:00
EmpirePhoenix 32db326266 update: use Instant to dynamically adjust loop timing and maintain consistent 50ms interval 2026-03-12 21:12:14 +01:00
EmpirePhoenix a4d764c4fe remove: eliminate MoistureSensorState::Disabled, simplify moisture sensor processing, refactor pump logic, and clean up redundant/unnecessary code 2026-03-12 21:12:14 +01:00
EmpirePhoenix 5c78495bd5 update: initialize all pump expander pins to low before setting output mode 2026-03-12 21:12:14 +01:00
EmpirePhoenix 07ab69075a bms intro 2026-03-10 22:38:06 +01:00
EmpirePhoenix 125b3efad3 update: reduce pause duration in blinking sequence from 2 seconds to 400 milliseconds 2026-02-27 23:17:25 +01:00
EmpirePhoenix 9b21d505e6 allow single sensor detection, get rid of sensor disabled hardware state == nomessage 2026-02-27 23:12:40 +01:00
EmpirePhoenix c575fc2c36 add: extend CAN task with collision detection and beacon handling, refactor error blinking logic, and optimize GPIO initialization for modularity 2026-02-27 22:12:52 +01:00
EmpirePhoenix 3128e32fb2 sensor case 2026-02-20 22:20:57 +01:00
EmpirePhoenix 6bba9b1f27 update: adjust sensor STEP file to reflect updated geometries and placement adjustments, correct timestamp, and align with KiCad output changes 2026-02-13 23:24:32 +01:00
EmpirePhoenix c909b33af0 remove: comment out unused plant visibility logic, update moisture sensor processing, and enhance plant ID handling in TWAI communication 2026-02-13 23:24:21 +01:00
EmpirePhoenix 979f982565 add: implement CAN communication channels, create can_task for RX/TX handling, enhance error detection, and reorganize configuration validation logic 2026-02-13 21:53:48 +01:00
EmpirePhoenix e6f8e34f7d remove: delete initial_hal implementation, update moisture sensor logic to handle optional raw values, optimize TWAI management, and improve CAN data handling 2026-02-01 03:57:36 +01:00
EmpirePhoenix ce10d084f8 update: refactor and enhance CAN sensor initialization, reorganize GPIO assignments, improve error detection and logging, and streamline TWAI handling 2026-01-31 00:06:42 +01:00
EmpirePhoenix 355388aa62 update: refactor and enhance CAN sensor initialization, reorganize GPIO assignments, improve error detection and logging, and streamline TWAI handling 2026-01-30 22:01:37 +01:00
EmpirePhoenix 0c0b62e2ed update: improve documentation and restructure code for modular hardware integration, add CAN communication to HAL, and update KiCad layouts 2026-01-23 22:02:14 +01:00