Commit Graph

40 Commits

Author SHA1 Message Date
Tony 449a3a801a Add KNX DALI Gateway Module and Message Queue Implementation
- Introduced KnxDaliModule class for handling DALI message queuing, commissioning, and KNX group-object dispatch.
- Implemented Message and MessageQueue classes for managing message operations.
- Removed obsolete OpenKNX IDF component files and CMake configurations.
- Updated submodule reference for KNX.

Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-05-15 12:34:13 +08:00
Tony 3f15cd7f3f fix(gateway): update DALI query response timeout and activity wait parameters
Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-05-15 10:33:22 +08:00
Tony f005d2bc09 feat(gateway): update BLE connection parameters and enhance DALI timeout configurations
Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-05-15 08:42:20 +08:00
Tony 70ae1ae6cf feat(dali): enhance DALI timing configurations and add new timeout parameters
Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-05-15 03:17:35 +08:00
Tony f2ffb45ca6 feat(gateway): implement LegacyRawPayload function for DALI and USB components
Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-05-15 02:35:37 +08:00
Tony 0b2d00472e Enhance DALI Component Configuration and Functionality
- Updated README.md to include new configuration options for native timing values, TX/RX polarity, power-down polling, and logging levels.
- Introduced new default values for query response timeout and double-send delay in dali.c.
- Implemented a function to drain stale RX frames from the queue to improve query handling.
- Enhanced DALI HAL implementation in dali_hal_idf5.c with additional configuration options for timer resolution and bus power check intervals.
- Added logging capabilities to track bus states and message transmissions in the DALI HAL.
- Improved error handling and message response mechanisms in dali_domain.cpp and gateway_usb_setup.cpp for better communication reliability.
- Refactored GPIO handling to support configurable TX/RX active states in dali_hal.h.
- Introduced legacy query response handling for backward compatibility in the DALI domain.

Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-05-15 01:26:13 +08:00
Tony 4553ed32e7 feat(gateway): add support for KNX TP UART 9-bit mode and enhance UART pin configuration
Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-05-14 22:39:14 +08:00
Tony 39ef630608 feat: Enhance EtsDeviceRuntime constructor and multicast handling
- Updated EtsDeviceRuntime constructor to accept an optional tunnel_client_address parameter with a default value of 0.
- Modified EspIdfPlatform::setupMultiCast to use IPPROTO_UDP for socket creation and improved multicast interface selection based on the current IP address.
- Ensured that the multicast interface is set only if a valid local address is available.
- Adjusted the client address assignment in EtsDeviceRuntime to use the provided tunnel_client_address if valid, falling back to the default otherwise.

Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-05-13 12:47:37 +08:00
Tony b74367e5a0 Refactor GatewayModbus and GatewayNetwork components
- Updated GatewayModbusConfig to allow uart_port and pin values to be -1, indicating an unconfigured state.
- Enhanced GatewayNetworkService to support an additional setup AP button with configurable GPIO and active low settings.
- Refactored boot button configuration logic to reduce redundancy and improve clarity.
- Introduced a new method for handling GPIO input configuration.
- Improved boot button task loop to handle both boot and setup AP buttons more effectively.
- Added programming mode functionality to EtsDeviceRuntime, allowing toggling and querying of the programming state.
- Implemented memory checks to avoid unnecessary reads in EtsDeviceRuntime.
- Enhanced security storage to derive factory FDSK from the device's serial number and store it in NVS.
- Updated factory FDSK loading logic to ensure proper key generation and storage.

Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-05-13 12:36:16 +08:00
Tony df1dd472cc feat(gateway): implement KNX security features including secure session handling and factory certificate management
Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-05-12 21:29:40 +08:00
Tony 888d021343 feat(gateway): update partition sizes and GPIO configurations for W5500 Ethernet
Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-05-12 21:29:00 +08:00
Tony de0edd5ad9 feat(gateway): enhance KNX support with DALI integration and configuration updates
Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-05-12 20:34:33 +08:00
Tony e58115d303 feat(gateway): add KNX Data Secure support and related configurations
Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-05-12 12:48:18 +08:00
Tony 626f86ec4e feat: add support for W5500 SPI Ethernet in gateway
- Introduced configuration options for wired Ethernet support in Kconfig and sdkconfig.
- Implemented Ethernet initialization and event handling in GatewayNetworkService.
- Enhanced app_main to manage Ethernet alongside Wi-Fi.
- Updated GatewayRuntime to store Ethernet information.
- Modified CMakeLists and include files to accommodate new Ethernet dependencies.
- Ensured backward compatibility by allowing Ethernet initialization failures to be ignored.

Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-05-12 08:42:10 +08:00
Tony 36d10702da Add EtsDeviceRuntime class for handling KNX device runtime operations
- Introduced EtsDeviceRuntime class to manage device runtime functionalities including handling tunnel frames and function property commands.
- Added support for individual address management and memory snapshot retrieval.
- Updated EtsMemorySnapshot structure to include individual address.
- Implemented identity application for DALI devices in the memory loader.
- Enhanced CMakeLists.txt to include new source files and compile definitions.
- Updated header files to include new dependencies and declarations.
- Refactored existing memory loading logic to accommodate new device runtime features.

Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-05-12 05:19:14 +08:00
Tony d231460612 fix(git): update .gitignore to include .DS_Store and change knx submodule branch to tonycloud-dev
Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-05-11 12:16:48 +08:00
Tony 70367f53ca Add OpenKNX IDF component with TPUart integration
- Created CMakeLists.txt for the OpenKNX IDF component, ensuring dependencies on OpenKNX and TPUart submodules.
- Implemented Arduino compatibility header for basic functions like millis, delay, pinMode, and digitalRead.
- Developed EspIdfPlatform class for network interface management and multicast communication.
- Added EtsMemoryLoader for loading ETS memory snapshots and managing associations.
- Introduced TpuartUartInterface for UART communication with methods for reading, writing, and managing callbacks.
- Implemented arduino_compat.cpp for Arduino-like functionality on ESP-IDF.
- Created source files for platform and memory loader implementations.
- Updated submodules for knx, knx_dali_gw, and tpuart.

Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-05-11 07:05:40 +08:00
Tony 1b8753636f feat(gateway): add KNX submodule with branch configuration
Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-05-11 04:42:01 +08:00
Tony e94945fc0f feat(gateway): enhance UART configuration validation for Modbus and KNX
Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-05-11 03:44:14 +08:00
Tony bf23cf0b79 feat(gateway_knx): add TP-UART control and initialization functionality
Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-05-11 02:40:31 +08:00
Tony 1a8ee06ec1 Implement KNX Gateway functionality with support for DALI integration
- Added gateway_knx.cpp to handle KNX communication and DALI bridge requests.
- Implemented functions for encoding/decoding KNX telegrams and managing group writes.
- Introduced GatewayKnxBridge and GatewayKnxTpIpRouter classes for managing KNX to DALI routing and IP tunneling.
- Added configuration handling for KNX settings, including UART and multicast options.
- Implemented error handling and logging for various KNX operations.

Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-05-08 18:19:37 +08:00
Tony 029785ff1d feat(gateway): Update SDK configuration and add 485 control bridge
- Changed flash size configuration from 16MB to 4MB and updated partition table filename.
- Introduced two gateway channels with UART configurations for communication.
- Added support for gateway cache and startup services including BLE and Wi-Fi.
- Enabled SPI RAM and configured its parameters for better memory management.
- Enhanced the gateway bridge service to handle generated Modbus points more efficiently.
- Refactored the gateway Modbus component to improve point management and added new methods for point description and generation.
- Implemented a new Gateway485ControlBridge for handling 485 control communication with UART.
- Added necessary files for the 485 control bridge including configuration and implementation.

Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-05-06 00:39:58 +08:00
Tony 34d2d9caa0 Add serial configuration support to Gateway Modbus
- Introduced GatewayModbusSerialConfig structure to encapsulate serial communication settings.
- Added clamping functions for integer and size values to ensure valid configuration ranges.
- Updated GatewayModbusConfigFromValue to parse serial configuration from JSON input.
- Implemented transport type checking functions for TCP, RTU, ASCII, and Serial.
- Enhanced GatewayModbusConfigToValue to include serial configuration in output.

Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-05-04 14:34:05 +08:00
Tony 640e78f688 feat(gateway_bridge): enhance DaliBridgeRequest parsing with support for unknown keys
Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-05-04 09:46:24 +08:00
Tony ee1246c942 feat(gateway_bacnet): add bacnet_stack submodule and update CMakeLists.txt path
Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-05-04 03:23:34 +08:00
Tony 7424b43bdd Add diagnostic bit support to Gateway Modbus
- Introduced new enum value `kShortDiagnosticBit` to `GatewayModbusGeneratedKind`.
- Enhanced `GatewayModbusPoint` and `GatewayModbusPointBinding` structures to include diagnostic snapshot, boolean key, and device type.
- Added new diagnostic bit specifications and updated the corresponding arrays for generated discrete inputs and holding registers.
- Implemented `addGeneratedDiagnosticPoint` function to handle the creation of diagnostic points.
- Updated `rebuildMap` method to include generated diagnostic points during the map rebuilding process.

Co-authored-by: Copilot <copilot@github.com>
2026-05-04 02:26:09 +08:00
Tony 694217eb2c Add Gateway Modbus component with configuration and bridge implementation
- Created CMakeLists.txt for the Gateway Modbus component.
- Added header file `gateway_modbus.hpp` defining configuration structures, enums, and point structures.
- Implemented the `gateway_modbus.cpp` source file containing the logic for managing Modbus points, including reading and writing operations.
- Introduced utility functions for converting configurations to and from DaliValue, and for handling Modbus space and access types.
- Established a bridge class to manage Modbus points and their interactions with the DaliBridgeEngine.

Co-authored-by: Copilot <copilot@github.com>
2026-05-04 01:19:05 +08:00
Tony 8aa5a451a4 feat(gateway_bacnet): add support for new BACnet object types and enhance state management functions
Co-authored-by: Copilot <copilot@github.com>
2026-05-04 01:18:44 +08:00
Tony 30a96c5125 feat(gateway_bacnet): enhance BACnet object binding with out_of_service and reliability fields
feat(gateway_bacnet): add functions to clear BACnet objects and set their states

feat(gateway_bridge): implement discovery inventory management and scanning functionality

fix(gateway_bridge): update handleGet to support new inventory and effective model actions

refactor(gateway_bridge): improve BACnet binding handling and reliability reporting

Co-authored-by: Copilot <copilot@github.com>
2026-05-02 21:16:32 +08:00
Tony fa2eae87cf feat(gateway): enhance DALI command handling with mirroring and new target types 2026-05-02 03:19:02 +08:00
Tony 639fdd860e feat(gateway): implement reconciliation mechanism and command prioritization
- Introduced a reconciliation job structure to manage the reconciliation process for gateway channels.
- Added methods to schedule and run reconciliation steps, including group, scene, and settings reconciliation.
- Implemented a locking mechanism to ensure thread safety during reconciliation operations.
- Enhanced command handling in GatewayRuntime to classify commands by priority (control, normal, maintenance).
- Updated command enqueueing and processing to respect command priorities, ensuring maintenance commands are handled appropriately.
- Added configuration options for enabling/disabling cache functionality in GatewayRuntime.
- Improved logging to include cache status during runtime initialization.

Co-authored-by: Copilot <copilot@github.com>
2026-05-02 03:04:06 +08:00
Tony 70c39ea1e1 Refactor GatewayController to integrate GatewayCache
- Updated CMakeLists.txt to require gateway_cache component.
- Modified gateway_controller.hpp to include GatewayCache and adjust constructor.
- Removed internal scene and group management logic from GatewayController, delegating to GatewayCache.
- Simplified scene and group operations by utilizing GatewayCache methods for enabling, setting details, and deleting.
- Eliminated NVS storage handling code, as scene and group data is now managed by GatewayCache.
- Updated command handling methods to use cached data instead of internal structures.

Co-authored-by: Copilot <copilot@github.com>
2026-05-01 04:39:58 +08:00
Tony d16c289626 feat(gateway_network): integrate GatewayBridgeService and add bridge handling
- Updated CMakeLists.txt to require gateway_bridge component.
- Modified GatewayNetworkService to include a pointer to GatewayBridgeService.
- Added new HTTP handlers for bridge GET and POST requests.
- Implemented query utility functions for handling request parameters.
- Enhanced response handling for bridge actions with JSON responses.

Co-authored-by: Copilot <copilot@github.com>
2026-05-01 03:54:02 +08:00
Tony 2c1aa28d4f feat(gateway): implement serial communication handling in DaliDomainService and GatewayController
Co-authored-by: Copilot <copilot@github.com>
2026-05-01 01:59:32 +08:00
Tony ae4669e1b3 feat(gateway): add ESP-Touch smartconfig provisioning support and enhance network management
Co-authored-by: Copilot <copilot@github.com>
2026-04-30 18:49:38 +08:00
Tony 4ce3513dd2 feat: Add DALI raw frame handling and USB setup bridge
- Introduced DaliRawFrame structure to encapsulate raw frame data.
- Enhanced DaliDomainService to manage raw frame sinks and processing.
- Implemented raw frame task for asynchronous handling of incoming DALI frames.
- Integrated raw frame handling in GatewayBleBridge and GatewayNetworkService.
- Added GatewayUsbSetupBridge to facilitate USB Serial/JTAG communication with DALI.
- Configured ESP-NOW for wireless communication and setup management.
- Updated GatewayRuntime to support clearing wireless credentials on boot button long press.
- Enhanced CMakeLists to include new components and dependencies.

Co-authored-by: Copilot <copilot@github.com>
2026-04-30 04:15:05 +08:00
Tony 3d8d00c3dd feat(gateway): enhance GatewayNetworkService with HTTP and UDP support, add status LED control
Co-authored-by: Copilot <copilot@github.com>
2026-04-30 00:54:53 +08:00
Tony 52aa2fc129 feat(gateway): add GatewayNetworkService and enhance runtime channel handling
Co-authored-by: Copilot <copilot@github.com>
2026-04-29 23:54:33 +08:00
Tony 4433fe97c7 feat(gateway): implement GatewayController and enhance GatewayRuntime
- Added GatewayController class to manage gateway operations, including command handling, scene and group management, and BLE state management.
- Introduced methods for scene and group storage, including loading, saving, and deleting scenes/groups.
- Enhanced GatewayRuntime with BLE management capabilities, including methods to check and set BLE state, and to generate BLE gateway names.
- Implemented utility functions for string normalization and CSV parsing.
- Added notification sinks for various events in the GatewayController.

Co-authored-by: Copilot <copilot@github.com>
2026-04-29 23:02:40 +08:00
Tony f4756ce816 Initial commit 2026-04-29 18:53:26 +08:00