From 24691978b39c9b875d2dc1a64a42111ebdac7e16 Mon Sep 17 00:00:00 2001 From: Peter Buchegger Date: Wed, 11 Mar 2026 21:07:19 +0100 Subject: [PATCH 01/11] feat: Implement channel management and discovery for ESP-NOW communication - Added WiFi channel management to the WiFi class, allowing retrieval of the current channel. - Updated esp_now.h to define functions for setting and getting the WiFi channel. - Modified sim_espnow.cpp to bind UDP sockets to channels dynamically based on the current WiFi channel. - Enhanced ReceiverApp and TransmitterApp to support channel discovery and migration, including callbacks for channel changes. - Implemented channel scanning logic to find active transmitters and manage channel acquisition. - Added unit tests for channel validation, discovery packet construction, and ChannelScanner functionality. - Updated API endpoints to reflect changes in channel management. --- firmware/data/transmitter/index.html | 6 - firmware/lib/odh-channel/Channel.h | 83 +++++ firmware/lib/odh-channel/ChannelScanner.cpp | 97 ++++++ firmware/lib/odh-channel/ChannelScanner.h | 81 +++++ firmware/lib/odh-channel/library.json | 8 + firmware/lib/odh-config/Config.h | 6 - firmware/lib/odh-protocol/FunctionMap.h | 10 +- firmware/lib/odh-protocol/Protocol.h | 151 +++++---- firmware/lib/odh-radio/IRadioLink.h | 17 +- firmware/lib/odh-radio/ReceiverRadioLink.cpp | 112 +++++-- firmware/lib/odh-radio/ReceiverRadioLink.h | 105 +++---- .../lib/odh-radio/TransmitterRadioLink.cpp | 112 ++++++- firmware/lib/odh-radio/TransmitterRadioLink.h | 88 +++--- firmware/sim/include/WiFi.h | 4 + firmware/sim/include/esp_now.h | 20 +- firmware/sim/sim_build.py | 4 + firmware/sim/src/sim_espnow.cpp | 85 +++-- firmware/src/receiver/ReceiverApp.cpp | 139 ++++++++- firmware/src/receiver/ReceiverApp.h | 17 + firmware/src/receiver/web/ReceiverApi.cpp | 2 +- firmware/src/transmitter/TransmitterApp.cpp | 150 ++++++++- firmware/src/transmitter/TransmitterApp.h | 14 + .../src/transmitter/web/TransmitterApi.cpp | 8 +- firmware/test/test_native/test_channel.cpp | 291 ++++++++++++++++++ firmware/test/test_native/test_protocol.cpp | 102 +++++- 25 files changed, 1398 insertions(+), 314 deletions(-) create mode 100644 firmware/lib/odh-channel/Channel.h create mode 100644 firmware/lib/odh-channel/ChannelScanner.cpp create mode 100644 firmware/lib/odh-channel/ChannelScanner.h create mode 100644 firmware/lib/odh-channel/library.json create mode 100644 firmware/test/test_native/test_channel.cpp diff --git a/firmware/data/transmitter/index.html b/firmware/data/transmitter/index.html index 7f1d58a..26acc40 100644 --- a/firmware/data/transmitter/index.html +++ b/firmware/data/transmitter/index.html @@ -183,10 +183,6 @@

Device

-

Radio

- - -

Battery