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.
This commit is contained in:
2026-04-26 19:56:16 +02:00
parent 2e4eb283b5
commit fc0e18da56
3 changed files with 186 additions and 128 deletions

View File

@@ -1426,6 +1426,12 @@ version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "hex"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
[[package]]
name = "httparse"
version = "1.10.1"
@@ -1625,6 +1631,24 @@ dependencies = [
"regex-automata",
]
[[package]]
name = "mcutie"
version = "3.0.0"
dependencies = [
"embassy-futures",
"embassy-net 0.8.0",
"embassy-sync 0.8.0",
"embassy-time",
"embedded-io 0.7.1",
"embedded-io-async 0.7.0",
"heapless 0.7.17",
"hex",
"log",
"mqttrs",
"once_cell",
"pin-project",
]
[[package]]
name = "measurements"
version = "0.11.1"
@@ -1640,6 +1664,15 @@ version = "2.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273"
[[package]]
name = "mqttrs"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62fc2b40eee1386c55479d534ec95a668e0562d54c6d1dc83bb1962469fec8a7"
dependencies = [
"heapless 0.7.17",
]
[[package]]
name = "nb"
version = "0.1.3"
@@ -1734,6 +1767,10 @@ name = "once_cell"
version = "1.21.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
dependencies = [
"critical-section",
"portable-atomic",
]
[[package]]
name = "onewire"
@@ -1810,6 +1847,26 @@ dependencies = [
"siphasher",
]
[[package]]
name = "pin-project"
version = "1.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1749c7ed4bcaf4c3d0a3efc28538844fb29bcdd7d2b67b2be7e20ba861ff517"
dependencies = [
"pin-project-internal",
]
[[package]]
name = "pin-project-internal"
version = "1.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9b20ed30f105399776b9c883e68e536ef602a16ae6f596d2c473591d6ad64c6"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.110",
]
[[package]]
name = "pin-project-lite"
version = "0.2.16"
@@ -1862,6 +1919,7 @@ dependencies = [
"ina219",
"lib-bms-protocol",
"log",
"mcutie",
"measurements",
"nb 1.1.0",
"onewire",