9#include "freertos/FreeRTOS.h"
10#include "freertos/event_groups.h"
11#include "freertos/task.h"
15#include "esp_http_server.h"
19#include "esp_system.h"
27#define WIFI_CONNECTED_BIT BIT0
28#define WIFI_FAILED_BIT BIT1
30#ifndef CONFIG_WEB_PORTAL_WIFI_CONNECT_TIMEOUT_MS
31#define CONFIG_WEB_PORTAL_WIFI_CONNECT_TIMEOUT_MS 15000
34#ifndef CONFIG_WEB_PORTAL_AP_CHANNEL
35#define CONFIG_WEB_PORTAL_AP_CHANNEL 1
38#ifndef CONFIG_WEB_PORTAL_HTTP_MAX_URI_HANDLERS
39#define CONFIG_WEB_PORTAL_HTTP_MAX_URI_HANDLERS 16
42#ifndef CONFIG_WEB_PORTAL_REBOOT_DELAY_MS
43#define CONFIG_WEB_PORTAL_REBOOT_DELAY_MS 1000
46#ifndef CONFIG_WEB_PORTAL_MDNS_ENABLE
47#define CONFIG_WEB_PORTAL_MDNS_ENABLE 1
50#ifndef CONFIG_WEB_PORTAL_MDNS_HOSTNAME
51#define CONFIG_WEB_PORTAL_MDNS_HOSTNAME "alarmclock"
54#ifndef CONFIG_WEB_PORTAL_MDNS_INSTANCE_NAME
55#define CONFIG_WEB_PORTAL_MDNS_INSTANCE_NAME "ESP32-C3 Alarm Clock"
58#ifndef CONFIG_WEB_PORTAL_LOG_AP_CREDENTIALS
59#define CONFIG_WEB_PORTAL_LOG_AP_CREDENTIALS 0
62#define WIFI_CONNECT_TIMEOUT_MS CONFIG_WEB_PORTAL_WIFI_CONNECT_TIMEOUT_MS
63#define WEB_PORTAL_TIMEZONE_CUSTOM_ID "custom"
65extern const uint8_t s_portal_html_start[]
asm(
"_binary_index_html_start");
66extern const uint8_t s_portal_html_end[]
asm(
"_binary_index_html_end");
67extern const uint8_t s_portal_css_start[]
asm(
"_binary_style_css_start");
68extern const uint8_t s_portal_css_end[]
asm(
"_binary_style_css_end");
69extern const uint8_t s_portal_js_start[]
asm(
"_binary_app_js_start");
70extern const uint8_t s_portal_js_end[]
asm(
"_binary_app_js_end");
72static const char *
TAG =
"web_portal";
81 {
"Europe/Stockholm",
"Europe/Stockholm (CET/CEST)"},
82 {
"Europe/London",
"Europe/London (GMT/BST)"},
83 {
"America/New_York",
"America/New_York (EST/EDT)"},
84 {
"America/Chicago",
"America/Chicago (CST/CDT)"},
85 {
"America/Denver",
"America/Denver (MST/MDT)"},
86 {
"America/Los_Angeles",
"America/Los_Angeles (PST/PDT)"},
87 {
"America/Sao_Paulo",
"America/Sao_Paulo (UTC-3)"},
88 {
"Asia/Dubai",
"Asia/Dubai (UTC+4)"},
89 {
"Asia/Kolkata",
"Asia/Kolkata (UTC+5:30)"},
90 {
"Asia/Bangkok",
"Asia/Bangkok (UTC+7)"},
91 {
"Asia/Singapore",
"Asia/Singapore (UTC+8)"},
92 {
"Asia/Tokyo",
"Asia/Tokyo (JST)"},
93 {
"Australia/Sydney",
"Australia/Sydney (AEST/AEDT)"},
94 {
"Pacific/Auckland",
"Pacific/Auckland (NZST/NZDT)"},
117 copy_len = strnlen(src, dest_len - 1);
118 memcpy(dest, src, copy_len);
119 dest[copy_len] =
'\0';
141#if CONFIG_WEB_PORTAL_MDNS_ENABLE
149 if (ret != ESP_OK && ret != ESP_ERR_INVALID_STATE) {
150 ESP_LOGW(
TAG,
"mDNS init failed: %s", esp_err_to_name(ret));
155 ESP_LOGW(
TAG,
"mDNS hostname setup failed");
160 ESP_LOGW(
TAG,
"mDNS instance setup failed");
164 if (mdns_service_add(NULL,
"_http",
"_tcp", http_port, NULL, 0) != ESP_OK) {
165 ESP_LOGW(
TAG,
"mDNS HTTP service registration failed");
178#if CONFIG_WEB_PORTAL_MDNS_ENABLE
183 mdns_service_remove(
"_http",
"_tcp");
191 httpd_resp_set_status(req,
"302 Found");
192 httpd_resp_set_hdr(req,
"Location",
"/");
193 httpd_resp_send(req, NULL, 0);
198 int high_val = isdigit((
unsigned char)high) ? high -
'0' : (toupper((
unsigned char)high) -
'A' + 10);
199 int low_val = isdigit((
unsigned char)low) ? low -
'0' : (toupper((
unsigned char)low) -
'A' + 10);
201 return (
char)((high_val << 4) | low_val);
206 size_t write_index = 0;
208 while (*src !=
'\0' && write_index + 1 < dest_len) {
210 dest[write_index++] =
' ';
212 }
else if (*src ==
'%' && isxdigit((
unsigned char)src[1]) && isxdigit((
unsigned char)src[2])) {
216 dest[write_index++] = *src++;
220 dest[write_index] =
'\0';
225 const size_t key_len = strlen(key);
226 const char *cursor = body;
228 while (cursor != NULL && *cursor !=
'\0') {
229 if (strncmp(cursor, key, key_len) == 0 && cursor[key_len] ==
'=') {
230 const char *value_start = cursor + key_len + 1;
231 const char *value_end = strchr(value_start,
'&');
232 size_t value_len = value_end != NULL ? (size_t)(value_end - value_start) : strlen(value_start);
235 if (value_len >=
sizeof(encoded)) {
236 value_len =
sizeof(encoded) - 1;
239 memcpy(encoded, value_start, value_len);
240 encoded[value_len] =
'\0';
245 cursor = strchr(cursor,
'&');
246 if (cursor != NULL) {
256 const int total_len = req->content_len;
259 if (total_len < 0 || (
size_t)total_len >= buffer_len) {
260 return ESP_ERR_NO_MEM;
263 while (received < total_len) {
264 const int read_len = httpd_req_recv(req, buffer + received, total_len - received);
269 received += read_len;
272 buffer[received] =
'\0';
284 return (int16_t)parsed;
305 esp_event_base_t event_base,
311 if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_START) {
313 }
else if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_DISCONNECTED) {
314 wifi_event_sta_disconnected_t *
event = (wifi_event_sta_disconnected_t *)event_data;
320 "STA disconnected (reason=%u)",
321 (
unsigned int)event->reason);
329 }
else if (event_base == IP_EVENT && event_id == IP_EVENT_STA_GOT_IP) {
330 ip_event_got_ip_t *
event = (ip_event_got_ip_t *)event_data;
333 snprintf(ip_str,
sizeof(ip_str), IPSTR, IP2STR(&event->ip_info.ip));
338 "STA connected: ssid=\"%s\" ip=%s",
342 }
else if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_AP_STACONNECTED) {
343 wifi_event_ap_staconnected_t *
event = (wifi_event_ap_staconnected_t *)event_data;
345 "AP client connected: %02X:%02X:%02X:%02X:%02X:%02X, aid=%d",
353 }
else if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_AP_STADISCONNECTED) {
354 wifi_event_ap_stadisconnected_t *
event = (wifi_event_ap_stadisconnected_t *)event_data;
356 "AP client disconnected: %02X:%02X:%02X:%02X:%02X:%02X, aid=%d",
373 ESP_RETURN_ON_ERROR(esp_netif_init(),
TAG,
"esp_netif_init failed");
375 esp_err_t ret = esp_event_loop_create_default();
376 if (ret != ESP_OK && ret != ESP_ERR_INVALID_STATE) {
382 return ESP_ERR_NO_MEM;
385 esp_netif_create_default_wifi_ap();
386 esp_netif_create_default_wifi_sta();
388 wifi_init_config_t wifi_init_cfg = WIFI_INIT_CONFIG_DEFAULT();
389 ESP_RETURN_ON_ERROR(esp_wifi_init(&wifi_init_cfg),
TAG,
"esp_wifi_init failed");
390 ESP_RETURN_ON_ERROR(esp_wifi_set_storage(WIFI_STORAGE_RAM),
TAG,
"set storage failed");
391 ESP_RETURN_ON_ERROR(esp_event_handler_register(WIFI_EVENT, ESP_EVENT_ANY_ID,
393 TAG,
"register WIFI_EVENT failed");
394 ESP_RETURN_ON_ERROR(esp_event_handler_register(IP_EVENT, IP_EVENT_STA_GOT_IP,
396 TAG,
"register IP_EVENT failed");
404 wifi_config_t ap_cfg = {0};
405 size_t ap_password_len;
408 ap_cfg.ap.ssid_len = strlen(config->
ap_ssid);
410 ap_cfg.ap.max_connection = 4;
413 if (ap_password_len >= 8 && ap_password_len <= 63) {
415 ap_cfg.ap.authmode = WIFI_AUTH_WPA_WPA2_PSK;
416 ap_cfg.ap.pmf_cfg.required =
false;
417 ap_cfg.ap.pmf_cfg.capable =
true;
419 ap_cfg.ap.password[0] =
'\0';
420 ap_cfg.ap.authmode = WIFI_AUTH_OPEN;
421 ap_cfg.ap.pmf_cfg.required =
false;
422 ap_cfg.ap.pmf_cfg.capable =
false;
424 "AP password length %u invalid for WPA/WPA2, starting open AP",
425 (
unsigned int)ap_password_len);
430 ESP_RETURN_ON_ERROR(esp_wifi_set_mode(WIFI_MODE_AP),
TAG,
"set AP mode failed");
431 ESP_RETURN_ON_ERROR(esp_wifi_set_config(WIFI_IF_AP, &ap_cfg),
TAG,
"set AP config failed");
432 ESP_RETURN_ON_ERROR(esp_wifi_start(),
TAG,
"start AP failed");
438 "Started setup AP %s (ch=%u, auth=%s)",
440 (
unsigned int)ap_cfg.ap.channel,
441 ap_cfg.ap.authmode == WIFI_AUTH_OPEN ?
"open" :
"wpa/wpa2");
442#if CONFIG_WEB_PORTAL_LOG_AP_CREDENTIALS
444 "DEBUG AP credentials: ssid=\"%s\" password=\"%s\"",
446 ap_cfg.ap.authmode == WIFI_AUTH_OPEN ?
"<open>" : config->
ap_password);
453 wifi_config_t sta_cfg = {0};
459 sta_cfg.sta.threshold.authmode = WIFI_AUTH_OPEN;
460 sta_cfg.sta.pmf_cfg.capable =
true;
461 sta_cfg.sta.pmf_cfg.required =
false;
467 ESP_RETURN_ON_ERROR(esp_wifi_set_mode(WIFI_MODE_STA),
TAG,
"set STA mode failed");
468 ESP_RETURN_ON_ERROR(esp_wifi_set_config(WIFI_IF_STA, &sta_cfg),
TAG,
"set STA config failed");
470 "Attempting STA connection to SSID \"%s\" (timeout=%u ms)",
473 ESP_RETURN_ON_ERROR(esp_wifi_start(),
TAG,
"start STA failed");
490 ESP_LOGW(
TAG,
"STA connection failed, falling back to AP mode");
496 size_t len = (size_t)(s_portal_html_end - s_portal_html_start);
498 httpd_resp_set_type(req,
"text/html");
499 httpd_resp_send(req, (
const char *)s_portal_html_start, (ssize_t)len);
505 size_t len = (size_t)(s_portal_css_end - s_portal_css_start);
507 httpd_resp_set_type(req,
"text/css");
508 httpd_resp_send(req, (
const char *)s_portal_css_start, (ssize_t)len);
514 size_t len = (size_t)(s_portal_js_end - s_portal_js_start);
516 httpd_resp_set_type(req,
"application/javascript");
517 httpd_resp_send(req, (
const char *)s_portal_js_start, (ssize_t)len);
524 struct tm local_time;
525 int64_t now_epoch = 0;
532 snprintf(json,
sizeof(json),
533 "{\"portal_mode\":%s,\"wifi_connected\":%s,\"ip\":\"%s\","
534 "\"time_valid\":%s,\"epoch\":%lld,\"alarm_active\":%s,"
535 "\"timezone\":%d,\"timezone_location\":\"%s\",\"brightness\":%u}",
539 time_valid ?
"true" :
"false",
540 (
long long)(time_valid ? now_epoch : 0),
546 httpd_resp_set_type(req,
"application/json");
547 httpd_resp_send(req, json, HTTPD_RESP_USE_STRLEN);
557 snprintf(json,
sizeof(json),
558 "{\"wifi_ssid\":\"%s\",\"wifi_configured\":%s,"
559 "\"timezone\":%d,\"timezone_location\":\"%s\","
560 "\"brightness\":%u,\"ap_ssid\":\"%s\"}",
568 httpd_resp_set_type(req,
"application/json");
569 httpd_resp_send(req, json, HTTPD_RESP_USE_STRLEN);
580 int16_t requested_tz_offset;
581 bool reboot_required =
false;
582 bool timezone_offset_updated =
false;
590 sizeof(requested_timezone_location),
594 sizeof(requested_timezone_location),
599 if (strcmp(config.
wifi_ssid, value) != 0) {
600 reboot_required =
true;
608 reboot_required =
true;
615 sizeof(requested_timezone_location),
619 sizeof(requested_timezone_location),
626 timezone_offset_updated =
true;
632 && timezone_offset_updated) {
638 requested_timezone_location);
641 long parsed = strtol(value, NULL, 10);
652 int64_t epoch = strtoll(value, NULL, 10);
665 httpd_resp_set_type(req,
"text/html");
668 ?
"<html><body><p>Saved. Rebooting into the updated Wi-Fi mode...</p></body></html>"
669 :
"<html><body><p>Saved.</p><p><a href=\"/\">Back</a></p></body></html>",
670 HTTPD_RESP_USE_STRLEN);
687 int64_t epoch = strtoll(value, NULL, 10);
707 written = snprintf(json,
sizeof(json),
"{\"count\":%u,\"alarms\":[", (
unsigned int)count);
709 written += snprintf(json + written, (
int)
sizeof(json) - written,
710 "%s{\"index\":%u,\"hour\":%u,\"minute\":%u,\"enabled\":%s}",
713 (
unsigned int)alarms[i].
hour,
714 (
unsigned int)alarms[i].minute,
715 alarms[i].enabled ?
"true" :
"false");
717 snprintf(json + written, (
int)
sizeof(json) - written,
"]}");
719 httpd_resp_set_type(req,
"application/json");
720 httpd_resp_send(req, json, HTTPD_RESP_USE_STRLEN);
729 esp_err_t ret = ESP_FAIL;
734 httpd_resp_set_status(req,
"400 Bad Request");
735 httpd_resp_set_type(req,
"application/json");
736 httpd_resp_send(req,
"{\"ok\":false,\"error\":\"missing action\"}", HTTPD_RESP_USE_STRLEN);
740 if (strcmp(action,
"add") == 0) {
741 uint8_t hour = 0, minute = 0;
744 long v = strtol(value, NULL, 10);
745 hour = (uint8_t)(v < 0 ? 0 : v > 23 ? 23 : v);
748 long v = strtol(value, NULL, 10);
749 minute = (uint8_t)(v < 0 ? 0 : v > 59 ? 59 : v);
752 enabled = (strtol(value, NULL, 10) != 0);
755 }
else if (strcmp(action,
"update") == 0) {
756 uint8_t index = 0, hour = 0, minute = 0;
759 long v = strtol(value, NULL, 10);
760 index = (uint8_t)(v < 0 ? 0 : v);
763 long v = strtol(value, NULL, 10);
764 hour = (uint8_t)(v < 0 ? 0 : v > 23 ? 23 : v);
767 long v = strtol(value, NULL, 10);
768 minute = (uint8_t)(v < 0 ? 0 : v > 59 ? 59 : v);
771 enabled = (strtol(value, NULL, 10) != 0);
774 }
else if (strcmp(action,
"delete") == 0) {
777 long v = strtol(value, NULL, 10);
778 index = (uint8_t)(v < 0 ? 0 : v);
781 }
else if (strcmp(action,
"toggle") == 0) {
784 long v = strtol(value, NULL, 10);
785 index = (uint8_t)(v < 0 ? 0 : v);
790 httpd_resp_set_type(req,
"application/json");
792 ret == ESP_OK ?
"{\"ok\":true}" :
"{\"ok\":false}",
793 HTTPD_RESP_USE_STRLEN);
800 httpd_resp_set_type(req,
"text/html");
802 "<html><body><p>Wi-Fi settings cleared. Rebooting into setup mode...</p></body></html>",
803 HTTPD_RESP_USE_STRLEN);
818 httpd_resp_set_status(req,
"303 See Other");
819 httpd_resp_set_hdr(req,
"Location",
"/");
820 httpd_resp_send(req,
"Redirect to captive portal", HTTPD_RESP_USE_STRLEN);
826 httpd_config_t config = HTTPD_DEFAULT_CONFIG();
834 config.lru_purge_enable =
true;
836 ESP_RETURN_ON_ERROR(httpd_start(&
s_http_server, &config),
TAG,
"httpd_start failed");
838 httpd_uri_t root = {.uri =
"/", .method = HTTP_GET, .handler =
web_portal_root_get, .user_ctx = NULL};
839 httpd_uri_t css = {.uri =
"/style.css", .method = HTTP_GET, .handler =
web_portal_css_get, .user_ctx = NULL};
840 httpd_uri_t js = {.uri =
"/app.js", .method = HTTP_GET, .handler =
web_portal_js_get, .user_ctx = NULL};
841 httpd_uri_t status = {.uri =
"/api/status", .method = HTTP_GET, .handler =
web_portal_status_get, .user_ctx = NULL};
842 httpd_uri_t config_get = {.uri =
"/api/config", .method = HTTP_GET, .handler =
web_portal_config_get, .user_ctx = NULL};
843 httpd_uri_t config_post = {.uri =
"/api/config", .method = HTTP_POST, .handler =
web_portal_config_post, .user_ctx = NULL};
844 httpd_uri_t alarms_get = {.uri =
"/api/alarms", .method = HTTP_GET, .handler =
web_portal_alarms_get, .user_ctx = NULL};
845 httpd_uri_t alarms_post = {.uri =
"/api/alarms", .method = HTTP_POST, .handler =
web_portal_alarms_post, .user_ctx = NULL};
846 httpd_uri_t time_post = {.uri =
"/api/time", .method = HTTP_POST, .handler =
web_portal_time_post, .user_ctx = NULL};
847 httpd_uri_t reset_post = {.uri =
"/api/reset-wifi", .method = HTTP_POST, .handler =
web_portal_reset_wifi_post, .user_ctx = NULL};
850 httpd_uri_t hotspot = {.uri =
"/hotspot-detect.html", .method = HTTP_GET, .handler =
web_portal_captive_redirect, .user_ctx = NULL};
esp_err_t app_state_update_alarm(uint8_t index, uint8_t hour, uint8_t minute, bool enabled)
Replace an existing alarm entry by index.
esp_err_t app_state_toggle_alarm(uint8_t index)
Toggle the enabled flag of an alarm by index.
void app_state_get_alarms(alarm_entry_t *out, uint8_t *count)
Get current alarm list.
esp_err_t app_state_delete_alarm(uint8_t index)
Delete an alarm by index (subsequent alarms shift down).
esp_err_t app_state_add_alarm(uint8_t hour, uint8_t minute, bool enabled)
Add a new alarm.
void app_state_set_wifi_connected(bool connected, const char *ip_address)
Update runtime Wi-Fi status and optional station IP.
esp_err_t app_state_reset_wifi_credentials(void)
Clear persisted Wi-Fi credentials.
void app_state_get_config(app_config_t *config)
Get current persisted configuration.
void app_state_get_snapshot(app_state_snapshot_t *snapshot)
Get a thread-safe snapshot of the full state.
void app_state_set_portal_mode(bool portal_mode)
Update runtime portal mode flag.
esp_err_t app_state_update_config(const app_config_t *config)
Replace persisted configuration with provided values.
Thread-safe application state and persisted configuration APIs.
#define APP_TIMEZONE_LOCATION_MAX_LEN
Maximum timezone location identifier length (without null terminator).
#define APP_WIFI_SSID_MAX_LEN
Maximum Wi-Fi SSID length (without null terminator).
#define APP_ALARM_MAX_COUNT
Maximum number of configurable alarms.
#define APP_IP_ADDRESS_MAX_LEN
Maximum IPv4 address string length including null terminator.
Persisted configuration model.
char wifi_password[APP_WIFI_PASSWORD_MAX_LEN+1]
char timezone_location[APP_TIMEZONE_LOCATION_MAX_LEN+1]
char ap_ssid[APP_AP_SSID_MAX_LEN+1]
char ap_password[APP_AP_PASSWORD_MAX_LEN+1]
char wifi_ssid[APP_WIFI_SSID_MAX_LEN+1]
char sta_ip[APP_IP_ADDRESS_MAX_LEN]
Snapshot of full app state.
void time_service_apply_timezone(const char *location_id, int16_t fallback_offset_min)
Apply a timezone by IANA location ID with DST support.
esp_err_t time_service_set_epoch(int64_t epoch)
Set current UTC epoch and persist it as valid time.
void time_service_notify_network_connected(bool connected)
Notify the service about network connectivity changes.
bool time_service_get_local_time(struct tm *out_tm, int64_t *out_epoch)
Get local time adjusted by the configured timezone offset.
Time service APIs for local time access and synchronization triggers.
#define CONFIG_WEB_PORTAL_REBOOT_DELAY_MS
static void web_portal_start_mdns(uint16_t http_port)
static void web_portal_url_decode(char *dest, size_t dest_len, const char *src)
static uint16_t s_http_port
static int16_t web_portal_clamp_timezone_offset(long parsed)
static esp_err_t web_portal_reset_wifi_post(httpd_req_t *req)
static void web_portal_stop_mdns(void)
static void web_portal_reboot_task(void *arg)
#define WIFI_CONNECT_TIMEOUT_MS
static esp_err_t web_portal_start_sta(const app_config_t *config)
static char s_last_sta_ssid[APP_WIFI_SSID_MAX_LEN+1]
static bool web_portal_form_get_value(const char *body, const char *key, char *out, size_t out_len)
static char web_portal_hex_to_char(char high, char low)
static void web_portal_copy_text(char *dest, size_t dest_len, const char *src)
static esp_err_t web_portal_alarms_post(httpd_req_t *req)
#define CONFIG_WEB_PORTAL_MDNS_INSTANCE_NAME
static esp_err_t web_portal_start_ap(const app_config_t *config)
static bool web_portal_timezone_location_valid(const char *location_id)
static esp_err_t web_portal_status_get(httpd_req_t *req)
static esp_err_t web_portal_root_get(httpd_req_t *req)
static void web_portal_wifi_event_handler(void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data)
static esp_err_t web_portal_start_http_server(void)
static EventGroupHandle_t s_wifi_event_group
static bool s_wifi_initialized
static esp_err_t web_portal_alarms_get(httpd_req_t *req)
static esp_err_t web_portal_read_body(httpd_req_t *req, char *buffer, size_t buffer_len)
static esp_err_t web_portal_js_get(httpd_req_t *req)
static esp_err_t web_portal_not_found_handler(httpd_req_t *req, httpd_err_code_t error)
static esp_err_t web_portal_time_post(httpd_req_t *req)
static bool s_reboot_scheduled
static const size_t s_timezone_option_count
static esp_err_t web_portal_config_get(httpd_req_t *req)
static bool s_mdns_initialized
static esp_err_t web_portal_config_post(httpd_req_t *req)
#define CONFIG_WEB_PORTAL_AP_CHANNEL
#define CONFIG_WEB_PORTAL_HTTP_MAX_URI_HANDLERS
static esp_err_t web_portal_captive_redirect(httpd_req_t *req)
#define CONFIG_WEB_PORTAL_MDNS_HOSTNAME
static void web_portal_schedule_reboot(void)
static void web_portal_send_redirect(httpd_req_t *req)
#define WIFI_CONNECTED_BIT
static esp_err_t web_portal_wifi_init_once(void)
#define WEB_PORTAL_TIMEZONE_CUSTOM_ID
static httpd_handle_t s_http_server
static esp_err_t web_portal_css_get(httpd_req_t *req)
esp_err_t web_portal_start(void)
Start Wi-Fi mode handling and HTTP portal service.
static const web_portal_timezone_option_t s_timezone_options[]
Wi-Fi provisioning/runtime portal service API.