led-driver: channel default 11, bare ESP-NOW build, settings and USB config updates
Default ESP-NOW channel is now 11. Adds the bare ESP-NOW-only build option (CONFIG_LED_ESPNOW_ONLY) with its sdkconfig fragments, a default hostname from the Wi-Fi MAC, and the related net, link, web and settings changes. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
12a8e225ad
commit
c9838d1cbe
18 files changed
+268
-31
No files matched your search
+19
-3
@@ -3,6 +3,7 @@
|
||||
*/
|
||||
#include "esp_log.h"
|
||||
#include "nvs_flash.h"
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#include "ddp.h"
|
||||
#include "espnow_link.h"
|
||||
@@ -31,13 +32,28 @@ extern "C" void app_main(void)
|
||||
ESP_ERROR_CHECK(presets_init());
|
||||
presets_apply_startup();
|
||||
ESP_ERROR_CHECK(net_start());
|
||||
espnow_link_start(); // ESP-NOW from led-controller, if enabled in settings
|
||||
ESP_ERROR_CHECK(web_start());
|
||||
espnow_link_start(); // ESP-NOW from led-controller (always, in the bare build)
|
||||
#if CONFIG_LED_ESPNOW_ONLY
|
||||
// Bare ESP-NOW driver: nothing else runs, and nothing else is linked in (no calls to it). The settings
|
||||
// come from the controller over ESP-NOW.
|
||||
ota_confirm_later(); // a freshly flashed image is marked good (app rollback is on)
|
||||
ESP_LOGI(TAG, "Ready: bare ESP-NOW driver (settings from the controller over ESP-NOW)");
|
||||
#else
|
||||
usb_cfg_start(); // led-tool over USB; the LEDs and Wi-Fi work without it
|
||||
ESP_ERROR_CHECK(ddp_start());
|
||||
// ESP-NOW only (access point off, Wi-Fi client off): nothing reaches the driver over IP, so no web
|
||||
// interface or DDP. Turning the access point on starts the web interface (net.cpp).
|
||||
if (!net_espnow_only()) {
|
||||
ESP_ERROR_CHECK(web_start());
|
||||
ESP_ERROR_CHECK(ddp_start());
|
||||
}
|
||||
ota_confirm_later();
|
||||
|
||||
if (net_espnow_only()) {
|
||||
ESP_LOGI(TAG, "Ready: ESP-NOW only (set up over USB with led-cli)");
|
||||
return;
|
||||
}
|
||||
char ssid[16];
|
||||
net_ap_ssid(ssid, sizeof(ssid));
|
||||
ESP_LOGI(TAG, "Ready: join Wi-Fi %s and open http://192.168.4.1/, or http://led.local/ on your network", ssid);
|
||||
#endif
|
||||
}
|
||||
Reference in new issue
Block a user