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
+12
-3
@@ -509,7 +509,7 @@ static esp_err_t network_post(api_req_t *req)
|
||||
|
||||
esp_err_t err = net_save_network(&n);
|
||||
if (err == ESP_ERR_INVALID_STATE) {
|
||||
return send_error(req, "400 Bad Request", "connect to a Wi-Fi network before turning the access point off");
|
||||
return send_error(req, "400 Bad Request", "connect to a Wi-Fi network or turn ESP-NOW on before turning the access point off");
|
||||
}
|
||||
if (err != ESP_OK) {
|
||||
ESP_LOGW(TAG, "Network apply failed: %s", esp_err_to_name(err));
|
||||
@@ -1368,9 +1368,15 @@ static void api_call_work(void *arg)
|
||||
|
||||
void web_api_call(const char *msg, char *out, size_t cap)
|
||||
{
|
||||
if (!s_server) {
|
||||
// No web interface (Wi-Fi client and access point off): no HTTP or WebSocket handler can run, so
|
||||
// the call runs here, on the USB task
|
||||
ws_dispatch(msg, out, cap);
|
||||
return;
|
||||
}
|
||||
api_call_t c = { msg, out, cap, xSemaphoreCreateBinary() };
|
||||
if (!s_server || !c.done) {
|
||||
envelope(out, cap, 503, "{\"error\":\"web server not running\"}");
|
||||
if (!c.done) {
|
||||
envelope(out, cap, 503, "{\"error\":\"out of memory\"}");
|
||||
} else if (httpd_queue_work(s_server, api_call_work, &c) != ESP_OK) {
|
||||
envelope(out, cap, 503, "{\"error\":\"server busy\"}");
|
||||
} else {
|
||||
@@ -1439,6 +1445,9 @@ static esp_err_t ws_handler(httpd_req_t *req)
|
||||
|
||||
esp_err_t web_start(void)
|
||||
{
|
||||
if (s_server) {
|
||||
return ESP_OK; // already running (net starts it when the access point comes on)
|
||||
}
|
||||
httpd_config_t cfg = HTTPD_DEFAULT_CONFIG();
|
||||
cfg.max_uri_handlers = 30;
|
||||
cfg.stack_size = 8192;
|
||||
|
||||
Reference in new issue
Block a user