Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion config-102.cvs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ rotation,data,u16,0
autofanspeed,data,u16,1
fanspeed,data,u16,100
selftest,data,u16,1
overheat_mode,data,u16,0
overheat_mode,data,u16,0
captiveportal,data,u16,1
3 changes: 2 additions & 1 deletion config-201.cvs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ rotation,data,u16,0
autofanspeed,data,u16,1
fanspeed,data,u16,100
selftest,data,u16,1
overheat_mode,data,u16,0
overheat_mode,data,u16,0
captiveportal,data,u16,1
3 changes: 2 additions & 1 deletion config-202.cvs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ rotation,data,u16,0
autofanspeed,data,u16,1
fanspeed,data,u16,100
selftest,data,u16,1
overheat_mode,data,u16,0
overheat_mode,data,u16,0
captiveportal,data,u16,1
3 changes: 2 additions & 1 deletion config-203.cvs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ rotation,data,u16,0
autofanspeed,data,u16,1
fanspeed,data,u16,100
selftest,data,u16,1
overheat_mode,data,u16,0
overheat_mode,data,u16,0
captiveportal,data,u16,1
3 changes: 2 additions & 1 deletion config-204.cvs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ rotation,data,u16,0
autofanspeed,data,u16,1
fanspeed,data,u16,100
selftest,data,u16,1
overheat_mode,data,u16,0
overheat_mode,data,u16,0
captiveportal,data,u16,1
3 changes: 2 additions & 1 deletion config-205.cvs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ rotation,data,u16,0
autofanspeed,data,u16,1
fanspeed,data,u16,100
selftest,data,u16,1
overheat_mode,data,u16,0
overheat_mode,data,u16,0
captiveportal,data,u16,1
3 changes: 2 additions & 1 deletion config-207.cvs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ rotation,data,u16,0
autofanspeed,data,u16,1
fanspeed,data,u16,100
selftest,data,u16,1
overheat_mode,data,u16,0
overheat_mode,data,u16,0
captiveportal,data,u16,1
3 changes: 2 additions & 1 deletion config-302.cvs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ rotation,data,u16,0
autofanspeed,data,u16,1
fanspeed,data,u16,100
selftest,data,u16,1
overheat_mode,data,u16,0
overheat_mode,data,u16,0
captiveportal,data,u16,1
3 changes: 2 additions & 1 deletion config-303.cvs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ rotation,data,u16,0
autofanspeed,data,u16,1
fanspeed,data,u16,100
selftest,data,u16,1
overheat_mode,data,u16,0
overheat_mode,data,u16,0
captiveportal,data,u16,1
3 changes: 2 additions & 1 deletion config-400.cvs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ rotation,data,u16,0
autofanspeed,data,u16,1
fanspeed,data,u16,100
selftest,data,u16,1
overheat_mode,data,u16,0
overheat_mode,data,u16,0
captiveportal,data,u16,1
3 changes: 2 additions & 1 deletion config-401.cvs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ rotation,data,u16,0
autofanspeed,data,u16,1
fanspeed,data,u16,100
selftest,data,u16,1
overheat_mode,data,u16,0
overheat_mode,data,u16,0
captiveportal,data,u16,1
3 changes: 2 additions & 1 deletion config-402.cvs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ rotation,data,u16,0
autofanspeed,data,u16,1
fanspeed,data,u16,100
selftest,data,u16,1
overheat_mode,data,u16,0
overheat_mode,data,u16,0
captiveportal,data,u16,1
3 changes: 2 additions & 1 deletion config-403.cvs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ rotation,data,u16,0
autofanspeed,data,u16,1
fanspeed,data,u16,100
selftest,data,u16,1
overheat_mode,data,u16,0
overheat_mode,data,u16,0
captiveportal,data,u16,1
3 changes: 2 additions & 1 deletion config-601.cvs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ rotation,data,u16,0
autofanspeed,data,u16,1
fanspeed,data,u16,100
selftest,data,u16,1
overheat_mode,data,u16,0
overheat_mode,data,u16,0
captiveportal,data,u16,1
3 changes: 2 additions & 1 deletion config-602.cvs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ rotation,data,u16,0
autofanspeed,data,u16,1
fanspeed,data,u16,100
selftest,data,u16,1
overheat_mode,data,u16,0
overheat_mode,data,u16,0
captiveportal,data,u16,1
3 changes: 2 additions & 1 deletion config-701.cvs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ rotation,data,u16,0
autofanspeed,data,u16,1
fanspeed,data,u16,100
selftest,data,u16,1
overheat_mode,data,u16,0
overheat_mode,data,u16,0
captiveportal,data,u16,1
3 changes: 2 additions & 1 deletion config-702.cvs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ rotation,data,u16,0
autofanspeed,data,u16,1
fanspeed,data,u16,100
selftest,data,u16,1
overheat_mode,data,u16,0
overheat_mode,data,u16,0
captiveportal,data,u16,1
3 changes: 2 additions & 1 deletion config-800x.cvs
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ rotation,data,u16,0
autofanspeed,data,u16,1
fanspeed,data,u16,100
selftest,data,u16,0
overheat_mode,data,u16,0
overheat_mode,data,u16,0
captiveportal,data,u16,1
4 changes: 3 additions & 1 deletion config-custom.cvs
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,6 @@ TPS546,data,u16,1
# TMP1075 (0,1)
TMP1075,data,u16,1
# Self-test Power Consumption Target (> 0)
power_cons_tgt,data,u16,12
power_cons_tgt,data,u16,12
# Enable captive portal
captiveportal,data,u16,1
3 changes: 2 additions & 1 deletion config.cvs.example
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ rotation,data,u16,0
autofanspeed,data,u16,1
fanspeed,data,u16,100
selftest,data,u16,1
overheat_mode,data,u16,0
overheat_mode,data,u16,0
captiveportal,data,u16,1
8 changes: 5 additions & 3 deletions main/http_server/http_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -1416,9 +1416,11 @@ esp_err_t start_rest_server(void * pvParameters)
// Start websocket log handler thread
xTaskCreateWithCaps(websocket_task, "websocket_task", 8192, server, 2, NULL, MALLOC_CAP_SPIRAM);

// Start the DNS server that will redirect all queries to the softAP IP
dns_server_config_t dns_config = DNS_SERVER_CONFIG_SINGLE("*" /* all A queries */, "WIFI_AP_DEF" /* softAP netif ID */);
start_dns_server(&dns_config);
// Start the DNS server that will redirect all queries to the softAP IP, only if captive portal is enabled
if (nvs_config_get_bool(NVS_CONFIG_CAPTIVE_PORTAL)) {
dns_server_config_t dns_config = DNS_SERVER_CONFIG_SINGLE("*" /* all A queries */, "WIFI_AP_DEF" /* softAP netif ID */);
start_dns_server(&dns_config);
}

return ESP_OK;
err_start:
Expand Down
1 change: 1 addition & 0 deletions main/nvs_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ static Settings settings[NVS_CONFIG_COUNT] = {
[NVS_CONFIG_TPS546] = {.nvs_key_name = "TPS546", .type = TYPE_BOOL},
[NVS_CONFIG_TMP1075] = {.nvs_key_name = "TMP1075", .type = TYPE_BOOL},
[NVS_CONFIG_POWER_CONSUMPTION_TARGET] = {.nvs_key_name = "power_cons_tgt", .type = TYPE_U16},
[NVS_CONFIG_CAPTIVE_PORTAL] = {.nvs_key_name = "captiveportal", .type = TYPE_BOOL, .default_value = {.b = true}},
};

Settings *nvs_config_get_settings(NvsConfigKey key)
Expand Down
1 change: 1 addition & 0 deletions main/nvs_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ typedef enum {
NVS_CONFIG_TPS546,
NVS_CONFIG_TMP1075,
NVS_CONFIG_POWER_CONSUMPTION_TARGET,
NVS_CONFIG_CAPTIVE_PORTAL,
NVS_CONFIG_COUNT
} NvsConfigKey;

Expand Down