Skip to content

54 implement knxip connector for building automation#55

Merged
lxsaah merged 28 commits intomainfrom
54-implement-knxip-connector-for-building-automation
Nov 20, 2025
Merged

54 implement knxip connector for building automation#55
lxsaah merged 28 commits intomainfrom
54-implement-knxip-connector-for-building-automation

Conversation

@lxsaah
Copy link
Copy Markdown
Contributor

@lxsaah lxsaah commented Nov 20, 2025

Closes #54

Added

  • Initial implementation of KNX/IP connector
  • Dual runtime support (Tokio and Embassy)
  • KNXnet/IP Tunneling protocol support
  • Inbound monitoring (KNX bus → AimDB records)
  • Outbound control (AimDB records → KNX bus)
  • Group address parsing (3-level format)
  • DPT type support via knx-pico integration
  • Automatic reconnection on connection loss (5s interval)
  • ACK timeout handling with 3-second timeout for outbound telegrams
  • Heartbeat/keepalive (CONNECTIONSTATE_REQUEST every 55s)
  • Comprehensive unit tests (group addresses, frames, connection state)
  • Production deployment guide in README.md
  • tokio-knx-connector-demo example with bidirectional control
  • embassy-knx-connector-demo example for embedded systems

Fixed

  • Proper sequence number tracking for ACK validation
  • TUNNELING_ACK detection and processing
  • Pending ACK cleanup on timeout

Known Limitations

  • No KNX Secure support (plaintext only)
  • No group address discovery
  • Fire-and-forget publishing (no bus-level confirmation)
  • Single connection per gateway instance
  • No routing mode support

- Added production status documentation in lib.rs.
- Refactored tokio_client.rs to implement pending ACK tracking for outbound telegrams.
- Introduced timeout detection for ACKs, with logging for timed-out sequences.
- Updated group address parsing in examples to handle various data formats.
- Added comprehensive integration tests for connection state management and frame building.
- Implemented unit tests for group address parsing and formatting.
@lxsaah lxsaah requested a review from Copilot November 20, 2025 19:57
@lxsaah lxsaah self-assigned this Nov 20, 2025
@lxsaah lxsaah linked an issue Nov 20, 2025 that may be closed by this pull request
59 tasks
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a KNX/IP connector for building automation, adding bidirectional communication with KNX bus systems. The implementation includes dual runtime support (Tokio and Embassy), protocol handling with automatic reconnection, ACK timeout detection, and comprehensive testing infrastructure.

Key Changes:

  • KNX/IP connector with full tunneling protocol support
  • Dual runtime implementations (Tokio for standard systems, Embassy for embedded)
  • Comprehensive examples and deployment documentation
  • Integration with knx-pico library for DPT type conversion

Reviewed Changes

Copilot reviewed 29 out of 30 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
aimdb-knx-connector/src/tokio_client.rs Core Tokio-based KNX client with connection management and telegram handling
aimdb-knx-connector/src/embassy_client.rs Embassy-based KNX client for embedded systems
aimdb-knx-connector/src/lib.rs Public API and feature flag configuration
examples/tokio-knx-connector-demo/src/main.rs Demo application showing bidirectional KNX integration
examples/embassy-knx-connector-demo/src/main.rs Embedded demo for STM32H563ZI with button control
aimdb-knx-connector/tests/* Unit tests for group addresses, frames, and connection state
aimdb-embassy-adapter/src/lib.rs New source_with_context method for hardware-dependent producers
aimdb-embassy-adapter/src/buffer.rs Fixed Watch buffer to use persistent receiver
_external/knx-pico Added submodule for KNX protocol implementation
aimdb-mqtt-connector/src/embassy_client.rs Type alias cleanup for consistency

Comment thread examples/tokio-knx-connector-demo/README.md Outdated
Comment thread examples/tokio-knx-connector-demo/README.md Outdated
Comment thread aimdb-embassy-adapter/src/buffer.rs
Comment thread aimdb-knx-connector/src/tokio_client.rs
Comment thread aimdb-knx-connector/src/embassy_client.rs
Comment thread examples/embassy-knx-connector-demo/src/main.rs
lxsaah and others added 2 commits November 20, 2025 21:04
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@lxsaah lxsaah merged commit e9027f2 into main Nov 20, 2025
10 checks passed
@lxsaah lxsaah deleted the 54-implement-knxip-connector-for-building-automation branch November 20, 2025 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement KNX/IP Connector for Building Automation

2 participants