Implemented web server
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include <esp_ota_ops.h>
|
||||
#endif
|
||||
#include <nvs_flash.h>
|
||||
#include <esp_http_server.h>
|
||||
|
||||
// Arduino includes
|
||||
#include <Arduino.h>
|
||||
@@ -70,10 +71,10 @@ extern "C" void app_main()
|
||||
// return result;
|
||||
}
|
||||
|
||||
nvs_handle_t handle;
|
||||
nvs_handle_t nvsHandle;
|
||||
|
||||
{
|
||||
const auto result = nvs_open("deckenlampe", NVS_READWRITE, &handle);
|
||||
const auto result = nvs_open("deckenlampe", NVS_READWRITE, &nvsHandle);
|
||||
ESP_LOG_LEVEL_LOCAL((result == ESP_OK ? ESP_LOG_INFO : ESP_LOG_ERROR), TAG, "nvs_open(): %s", esp_err_to_name(result));
|
||||
//if (result != ESP_OK)
|
||||
// return result;
|
||||
@@ -112,7 +113,7 @@ extern "C" void app_main()
|
||||
.ssid_hidden = false,
|
||||
.max_connection = 4,
|
||||
.beacon_interval = 100,
|
||||
.ip{10, 128, 250, 181},
|
||||
.ip{192, 168, 4, 1},
|
||||
.subnet{255, 255, 255, 0}
|
||||
},
|
||||
.min_rssi = -90
|
||||
@@ -120,6 +121,17 @@ extern "C" void app_main()
|
||||
|
||||
wifi_stack::init(wifiConfig);
|
||||
|
||||
httpd_handle_t httpdHandle{};
|
||||
|
||||
{
|
||||
httpd_config_t httpConfig HTTPD_DEFAULT_CONFIG();
|
||||
|
||||
const auto result = httpd_start(&httpdHandle, &httpConfig);
|
||||
ESP_LOG_LEVEL_LOCAL((result == ESP_OK ? ESP_LOG_INFO : ESP_LOG_ERROR), TAG, "httpd_start(): %s", esp_err_to_name(result));
|
||||
//if (result != ESP_OK)
|
||||
// return result;
|
||||
}
|
||||
|
||||
while (true)
|
||||
{
|
||||
wifi_stack::update(wifiConfig);
|
||||
|
@@ -71,11 +71,9 @@ CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0
|
||||
#
|
||||
# Security features
|
||||
#
|
||||
CONFIG_SECURE_BOOT_SUPPORTS_RSA=y
|
||||
# CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT is not set
|
||||
# CONFIG_SECURE_BOOT is not set
|
||||
# CONFIG_SECURE_FLASH_ENC_ENABLED is not set
|
||||
# CONFIG_SECURE_DISABLE_ROM_DL_MODE is not set
|
||||
# end of Security features
|
||||
|
||||
#
|
||||
@@ -322,10 +320,11 @@ CONFIG_ESP_TLS_SERVER=y
|
||||
# ESP32-specific
|
||||
#
|
||||
# CONFIG_ESP32_REV_MIN_0 is not set
|
||||
# CONFIG_ESP32_REV_MIN_1 is not set
|
||||
CONFIG_ESP32_REV_MIN_1=y
|
||||
# CONFIG_ESP32_REV_MIN_2 is not set
|
||||
CONFIG_ESP32_REV_MIN_3=y
|
||||
CONFIG_ESP32_REV_MIN=3
|
||||
# CONFIG_ESP32_REV_MIN_3 is not set
|
||||
CONFIG_ESP32_REV_MIN=1
|
||||
CONFIG_ESP32_DPORT_WORKAROUND=y
|
||||
# CONFIG_ESP32_DEFAULT_CPU_FREQ_80 is not set
|
||||
CONFIG_ESP32_DEFAULT_CPU_FREQ_160=y
|
||||
# CONFIG_ESP32_DEFAULT_CPU_FREQ_240 is not set
|
||||
|
Reference in New Issue
Block a user