updated 3rdparty dependencies
This commit is contained in:
Submodule components/Adafruit_BMP085_Unified updated: c2b9b3e15c...922bc7c543
Submodule components/Adafruit_TSL2561 updated: 98cf7b89b9...3051ce4a77
Submodule components/DHT-sensor-library updated: 5b9e8755b6...8df46788bc
Submodule components/arduino-esp32 updated: a84e0538ff...b0223be116
Submodule components/cpputils updated: faeacdcfbf...47417e77b7
Submodule components/esp-nimble-cpp updated: 7f853fa04b...641f297120
Submodule components/espcpputils updated: 1ef4a9ea56...234dbb23fb
Submodule components/esphttpdutils updated: a78711317b...148e02b6ca
Submodule components/espwifistack updated: 717d877a44...dc31bacf98
57
export.sh
Normal file
57
export.sh
Normal file
@ -0,0 +1,57 @@
|
||||
if [[ $_ == $0 ]] && [[ "$1" != "--skip-source-check" ]]
|
||||
then
|
||||
echo "export.sh has to be sourced, not run in a subshell"
|
||||
echo ". export.sh"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
GOE_ROOT="$(dirname "$BASH_SOURCE")"
|
||||
|
||||
if [[ ! -f "${GOE_ROOT}/esp-idf/export.sh" ]]
|
||||
then
|
||||
echo "esp-idf is missing, please check out all needed submodules!"
|
||||
echo "git submodule update --init --recursive"
|
||||
return
|
||||
fi
|
||||
|
||||
. ${GOE_ROOT}/esp-idf/export.sh
|
||||
|
||||
complete -W "$(./switchconf.sh --list)" ./switchconf.sh
|
||||
|
||||
GOE_INIT_FAILED=
|
||||
|
||||
if [[ -e "build" ]] && [[ ! -L "build" ]]
|
||||
then
|
||||
echo "ERROR: build folder exists but isnt a symlink!"
|
||||
GOE_INIT_FAILED=1
|
||||
fi
|
||||
|
||||
if [[ -e "sdkconfig" ]]
|
||||
then
|
||||
if [[ ! -L "sdkconfig" ]]
|
||||
then
|
||||
echo "ERROR: sdkconfig exists but isnt a symlink!"
|
||||
GOE_INIT_FAILED=1
|
||||
fi
|
||||
else
|
||||
echo "ERROR: sdkconfig does not exist"
|
||||
GOE_INIT_FAILED=1
|
||||
fi
|
||||
|
||||
if [[ -e "config.cmake" ]]
|
||||
then
|
||||
if [[ ! -L "config.cmake" ]]
|
||||
then
|
||||
echo "ERROR: config.cmake exists but isnt a symlink!"
|
||||
GOE_INIT_FAILED=1
|
||||
fi
|
||||
else
|
||||
echo "ERROR: config.cmake does not exist"
|
||||
GOE_INIT_FAILED=1
|
||||
fi
|
||||
|
||||
if [[ ! -z "$GOE_INIT_FAILED" ]]
|
||||
then
|
||||
echo "run ./switchconf.sh to fix all listed issues"
|
||||
return
|
||||
fi
|
@ -6,6 +6,7 @@
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <tl/expected.hpp>
|
||||
|
||||
// forward declares
|
||||
class EspAsyncOta;
|
||||
|
||||
|
@ -23,9 +23,9 @@ namespace {
|
||||
wifi_stack::config makeWifiConfig()
|
||||
{
|
||||
return wifi_stack::config {
|
||||
.wifiEnabled = true,
|
||||
.hostname = config::hostname.value(),
|
||||
.sta = {
|
||||
.enabled = true,
|
||||
.wifis = std::array<wifi_stack::wifi_entry, 10> {
|
||||
wifi_stack::wifi_entry { .ssid = config::sta_ssid.value(), .key = config::sta_key.value() },
|
||||
wifi_stack::wifi_entry { .ssid = {}, .key = {} },
|
||||
|
@ -153,7 +153,7 @@ esp_err_t webserver_root_handler(httpd_req_t *req)
|
||||
if (const auto result = webserver_otaform_display(req, body); result != ESP_OK)
|
||||
return result;
|
||||
|
||||
CALL_AND_EXIT(webserver_resp_send_succ, req, "text/html", body)
|
||||
CALL_AND_EXIT(webserver_resp_send, req, esphttpdutils::ResponseStatus::Ok, "text/html", body)
|
||||
}
|
||||
|
||||
esp_err_t webserver_otainfo_display(httpd_req_t *req, std::string &body)
|
||||
@ -244,7 +244,7 @@ esp_err_t webserver_wifi_display(httpd_req_t *req, std::string &body)
|
||||
{
|
||||
const auto staStatus = wifi_stack::get_sta_status();
|
||||
body += fmt::format("<tr><th>STA status</th><td>{}</td></tr>\n", wifi_stack::toString(staStatus));
|
||||
if (staStatus == wifi_stack::WiFiStaStatus::WL_CONNECTED)
|
||||
if (staStatus == wifi_stack::WiFiStaStatus::CONNECTED)
|
||||
{
|
||||
if (const auto result = wifi_stack::get_sta_ap_info(); result)
|
||||
{
|
||||
@ -575,7 +575,7 @@ esp_err_t webserver_on_handler(httpd_req_t *req)
|
||||
{
|
||||
constexpr const char *msg = "lamp support not enabled!";
|
||||
ESP_LOGW(TAG, "%s", msg);
|
||||
CALL_AND_EXIT(webserver_resp_send_err, req, HTTPD_400_BAD_REQUEST, "text/plain", msg)
|
||||
CALL_AND_EXIT(webserver_resp_send, req, esphttpdutils::ResponseStatus::BadRequest, "text/plain", msg)
|
||||
}
|
||||
|
||||
const bool state = (lampState = true);
|
||||
@ -584,7 +584,7 @@ esp_err_t webserver_on_handler(httpd_req_t *req)
|
||||
if (mqttConnected)
|
||||
mqttVerbosePub(config::topic_lamp_status.value(), state ? "ON" : "OFF", 0, 1);
|
||||
|
||||
CALL_AND_EXIT(webserver_resp_send_succ, req, "text/plain", "ON called...")
|
||||
CALL_AND_EXIT(webserver_resp_send, req, esphttpdutils::ResponseStatus::Ok, "text/plain", "ON called...")
|
||||
}
|
||||
|
||||
esp_err_t webserver_off_handler(httpd_req_t *req)
|
||||
@ -593,7 +593,7 @@ esp_err_t webserver_off_handler(httpd_req_t *req)
|
||||
{
|
||||
constexpr const char *msg = "lamp support not enabled!";
|
||||
ESP_LOGW(TAG, "%s", msg);
|
||||
CALL_AND_EXIT(webserver_resp_send_err, req, HTTPD_400_BAD_REQUEST, "text/plain", msg)
|
||||
CALL_AND_EXIT(webserver_resp_send, req, esphttpdutils::ResponseStatus::BadRequest, "text/plain", msg)
|
||||
}
|
||||
|
||||
const bool state = (lampState = false);
|
||||
@ -602,7 +602,7 @@ esp_err_t webserver_off_handler(httpd_req_t *req)
|
||||
if (mqttConnected)
|
||||
mqttVerbosePub(config::topic_lamp_status.value(), state ? "ON" : "OFF", 0, 1);
|
||||
|
||||
CALL_AND_EXIT(webserver_resp_send_succ, req, "text/plain", "OFF called...")
|
||||
CALL_AND_EXIT(webserver_resp_send, req, esphttpdutils::ResponseStatus::Ok, "text/plain", "OFF called...")
|
||||
}
|
||||
|
||||
esp_err_t webserver_toggle_handler(httpd_req_t *req)
|
||||
@ -611,7 +611,7 @@ esp_err_t webserver_toggle_handler(httpd_req_t *req)
|
||||
{
|
||||
constexpr const char *msg = "lamp support not enabled!";
|
||||
ESP_LOGW(TAG, "%s", msg);
|
||||
CALL_AND_EXIT(webserver_resp_send_err, req, HTTPD_400_BAD_REQUEST, "text/plain", msg)
|
||||
CALL_AND_EXIT(webserver_resp_send, req, esphttpdutils::ResponseStatus::BadRequest, "text/plain", msg)
|
||||
}
|
||||
|
||||
const bool state = (lampState = !lampState);
|
||||
@ -620,14 +620,14 @@ esp_err_t webserver_toggle_handler(httpd_req_t *req)
|
||||
if (mqttConnected)
|
||||
mqttVerbosePub(config::topic_lamp_status.value(), state ? "ON" : "OFF", 0, 1);
|
||||
|
||||
CALL_AND_EXIT(webserver_resp_send_succ, req, "text/plain", "TOGGLE called...")
|
||||
CALL_AND_EXIT(webserver_resp_send, req, esphttpdutils::ResponseStatus::Ok, "text/plain", "TOGGLE called...")
|
||||
}
|
||||
|
||||
esp_err_t webserver_reboot_handler(httpd_req_t *req)
|
||||
{
|
||||
shouldReboot = true;
|
||||
|
||||
CALL_AND_EXIT(webserver_resp_send_succ, req, "text/plain", "REBOOT called...")
|
||||
CALL_AND_EXIT(webserver_resp_send, req, esphttpdutils::ResponseStatus::Ok, "text/plain", "REBOOT called...")
|
||||
}
|
||||
|
||||
esp_err_t webserver_ota_handler(httpd_req_t *req)
|
||||
@ -643,13 +643,13 @@ esp_err_t webserver_ota_handler(httpd_req_t *req)
|
||||
char urlBufEncoded[256];
|
||||
if (const auto result = httpd_query_key_value(query.data(), "url", urlBufEncoded, sizeof(urlBufEncoded)); result == ESP_ERR_NOT_FOUND)
|
||||
{
|
||||
CALL_AND_EXIT(webserver_resp_send_err, req, HTTPD_400_BAD_REQUEST, "text/plain", "url parameter missing")
|
||||
CALL_AND_EXIT(webserver_resp_send, req, esphttpdutils::ResponseStatus::BadRequest, "text/plain", "url parameter missing")
|
||||
}
|
||||
else if (result != ESP_OK)
|
||||
{
|
||||
const auto msg = fmt::format("httpd_query_key_value() {} failed with {}", "url", esp_err_to_name(result));
|
||||
ESP_LOGE(TAG, "%.*s", msg.size(), msg.data());
|
||||
CALL_AND_EXIT(webserver_resp_send_err, req, HTTPD_400_BAD_REQUEST, "text/plain", msg)
|
||||
CALL_AND_EXIT(webserver_resp_send, req, esphttpdutils::ResponseStatus::BadRequest, "text/plain", msg)
|
||||
}
|
||||
|
||||
char urlBuf[257];
|
||||
@ -660,10 +660,10 @@ esp_err_t webserver_ota_handler(httpd_req_t *req)
|
||||
if (const auto result = triggerOta(url); !result)
|
||||
{
|
||||
ESP_LOGE(TAG, "%.*s", result.error().size(), result.error().data());
|
||||
CALL_AND_EXIT(webserver_resp_send_err, req, HTTPD_400_BAD_REQUEST, "text/plain", result.error())
|
||||
CALL_AND_EXIT(webserver_resp_send, req, esphttpdutils::ResponseStatus::BadRequest, "text/plain", result.error())
|
||||
}
|
||||
|
||||
CALL_AND_EXIT(webserver_resp_send_succ, req, "text/plain", "OTA called...")
|
||||
CALL_AND_EXIT(webserver_resp_send, req, esphttpdutils::ResponseStatus::Ok, "text/plain", "OTA called...")
|
||||
}
|
||||
} // namespace
|
||||
} // namespace deckenlampe
|
||||
|
8
open_ide.sh
Executable file
8
open_ide.sh
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ -z "$IDF_PATH" ]]
|
||||
then
|
||||
source export.sh --skip-source-check
|
||||
fi
|
||||
|
||||
qtcreator "deckenlampe" 2>&1 >/dev/null &
|
12
sdkconfig
12
sdkconfig
@ -156,6 +156,18 @@ CONFIG_ARDUINO_SELECTIVE_COMPILATION=y
|
||||
CONFIG_ARDUINO_SELECTIVE_Wire=y
|
||||
# end of Arduino Configuration
|
||||
|
||||
#
|
||||
# espcpputils settings
|
||||
#
|
||||
# CONFIG_ESPCPPUTILS_LOG_LOCAL_LEVEL_NONE is not set
|
||||
# CONFIG_ESPCPPUTILS_LOG_LOCAL_LEVEL_ERROR is not set
|
||||
# CONFIG_ESPCPPUTILS_LOG_LOCAL_LEVEL_WARN is not set
|
||||
CONFIG_ESPCPPUTILS_LOG_LOCAL_LEVEL_INFO=y
|
||||
# CONFIG_ESPCPPUTILS_LOG_LOCAL_LEVEL_DEBUG is not set
|
||||
# CONFIG_ESPCPPUTILS_LOG_LOCAL_LEVEL_VERBOSE is not set
|
||||
CONFIG_ESPCPPUTILS_LOG_LOCAL_LEVEL=3
|
||||
# end of espcpputils settings
|
||||
|
||||
#
|
||||
# Simple WiFi Stack settings
|
||||
#
|
||||
|
Reference in New Issue
Block a user