#include "ArduinoJson.h"
WebCfgServer::WebCfgServer(NukiWrapper* nuki, NukiOpenerWrapper* nukiOpener, NukiNetwork* network, Gpio* gpio, EthServer* ethServer, Preferences* preferences, bool allowRestartToPortal, uint8_t partitionType)
@@ -318,7 +319,6 @@ void WebCfgServer::initialize()
esp_ota_set_boot_partition(esp_ota_get_next_update_partition(NULL));
restartEsp(RestartReason::OTAReboot);
});
- #if (ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(5, 0, 0))
_server.on("/autoupdate", [&]() {
if (_hasCredentials && !_server.authenticate(_credUser, _credPassword)) {
return _server.requestAuthentication();
@@ -347,7 +347,6 @@ void WebCfgServer::initialize()
waitAndProcess(true, 1000);
restartEsp(RestartReason::OTAReboot);
});
- #endif
_server.on("/uploadota", HTTP_POST, [&]() {
if (_hasCredentials && !_server.authenticate(_credUser, _credPassword)) {
return _server.requestAuthentication();
@@ -415,7 +414,6 @@ void WebCfgServer::buildOtaHtml(String &response, bool errored)
response.concat("Initiating Over-the-air update. This will take about two minutes, please be patient.
You will be forwarded automatically when the update is complete.
");
- #if (ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(5, 0, 0))
response.concat("");
- #endif
if(_partitionType == 1)
{
@@ -612,16 +615,12 @@ void WebCfgServer::handleOtaUpload()
filename = "/" + filename;
}
_otaStartTs = esp_timer_get_time() / 1000;
- #if (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0))
- esp_task_wdt_init(30, false);
- #else
esp_task_wdt_config_t twdt_config = {
.timeout_ms = 30000,
.idle_core_mask = 0,
.trigger_panic = false,
};
esp_task_wdt_reconfigure(&twdt_config);
- #endif
#ifndef NUKI_HUB_UPDATER
_network->disableAutoRestarts();
@@ -2539,7 +2538,7 @@ void WebCfgServer::buildNukiConfigHtml(String &response)
#endif
printInputField(response, "RSBC", "Restart if bluetooth beacons not received (seconds; -1 to disable)", _preferences->getInt(preference_restart_ble_beacon_lost), 10, "");
printInputField(response, "TXPWR", "BLE transmit power in dB (minimum -12, maximum 9)", _preferences->getInt(preference_ble_tx_power, 9), 10, "");
-
+
response.concat("");
response.concat("
");
response.concat("");
diff --git a/src/main.cpp b/src/main.cpp
index 02756d1..0468d43 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -244,16 +244,13 @@ esp_err_t _http_event_handler(esp_http_client_event_t *evt)
case HTTP_EVENT_DISCONNECTED:
Log->println("HTTP_EVENT_DISCONNECTED");
break;
- #if (ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(5, 0, 0))
case HTTP_EVENT_REDIRECT:
Log->println("HTTP_EVENT_REDIRECT");
break;
- #endif
}
return ESP_OK;
}
-#if (ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(5, 0, 0))
void otaTask(void *pvParameter)
{
uint8_t partitionType = checkPartition();
@@ -297,36 +294,21 @@ void otaTask(void *pvParameter)
esp_task_wdt_reset();
}
-#endif
void setupTasks(bool ota)
{
// configMAX_PRIORITIES is 25
-
- #if (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0))
- esp_task_wdt_init(300, true);
- #else
esp_task_wdt_config_t twdt_config = {
.timeout_ms = 300000,
.idle_core_mask = 0,
.trigger_panic = true,
};
esp_task_wdt_reconfigure(&twdt_config);
- #endif
if(ota)
{
- #if (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0))
- xTaskCreatePinnedToCore(networkTask, "ntw", preferences->getInt(preference_task_size_network, NETWORK_TASK_SIZE), NULL, 3, &networkTaskHandle, 1);
- esp_task_wdt_add(networkTaskHandle);
- #ifndef NUKI_HUB_UPDATER
- xTaskCreatePinnedToCore(nukiTask, "nuki", preferences->getInt(preference_task_size_nuki, NUKI_TASK_SIZE), NULL, 2, &nukiTaskHandle, 1);
- esp_task_wdt_add(nukiTaskHandle);
- #endif
- #else
xTaskCreatePinnedToCore(otaTask, "ota", 8192, NULL, 2, &otaTaskHandle, 1);
esp_task_wdt_add(otaTaskHandle);
- #endif
}
else
{
diff --git a/src/networkDevices/EthLan8720Device.cpp b/src/networkDevices/EthLan8720Device.cpp
index c399355..98b8497 100644
--- a/src/networkDevices/EthLan8720Device.cpp
+++ b/src/networkDevices/EthLan8720Device.cpp
@@ -76,13 +76,11 @@ void EthLan8720Device::initialize()
WiFi.setHostname(_hostname.c_str());
-#if (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0))
- _hardwareInitialized = ETH.begin(_phy_addr, _power, _mdc, _mdio, _type, _clock_mode, _use_mac_from_efuse);
-#elif CONFIG_IDF_TARGET_ESP32
+ #if CONFIG_IDF_TARGET_ESP32
_hardwareInitialized = ETH.begin(_type, _phy_addr, _mdc, _mdio, _power, _clock_mode);
-#else
+ #else
_hardwareInitialized = false;
-#endif
+ #endif
ETH.setHostname(_hostname.c_str());
if(!_ipConfiguration->dhcpEnabled())
diff --git a/src/networkDevices/EthLan8720Device.h b/src/networkDevices/EthLan8720Device.h
index 22062c8..12a4197 100644
--- a/src/networkDevices/EthLan8720Device.h
+++ b/src/networkDevices/EthLan8720Device.h
@@ -1,33 +1,26 @@
#pragma once
-#if (ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(5, 0, 0))
- #ifndef CONFIG_IDF_TARGET_ESP32
- typedef enum {
- ETH_CLOCK_GPIO0_IN = 0,
- ETH_CLOCK_GPIO16_OUT = 2,
- ETH_CLOCK_GPIO17_OUT = 3
- } eth_clock_mode_t;
+#ifndef CONFIG_IDF_TARGET_ESP32
+ typedef enum {
+ ETH_CLOCK_GPIO0_IN = 0,
+ ETH_CLOCK_GPIO16_OUT = 2,
+ ETH_CLOCK_GPIO17_OUT = 3
+ } eth_clock_mode_t;
- #define ETH_PHY_TYPE ETH_PHY_MAX
- #else
- #define ETH_PHY_TYPE ETH_PHY_LAN8720
- #endif
+ #define ETH_PHY_TYPE ETH_PHY_MAX
+#else
+ #define ETH_PHY_TYPE ETH_PHY_LAN8720
+#endif
#define ETH_CLK_MODE ETH_CLOCK_GPIO0_IN
-
#define ETH_PHY_ADDR 0
#define ETH_PHY_MDC 23
#define ETH_PHY_MDIO 18
#define ETH_PHY_POWER -1
#define ETH_RESET_PIN 1
-#endif
#include
-#if (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0))
-#include
-#else
#include
-#endif
#include
#include "NetworkDevice.h"
#ifndef NUKI_HUB_UPDATER
diff --git a/src/networkDevices/WifiDevice.h b/src/networkDevices/WifiDevice.h
index 1d4ce8e..1455eea 100644
--- a/src/networkDevices/WifiDevice.h
+++ b/src/networkDevices/WifiDevice.h
@@ -1,11 +1,7 @@
#pragma once
#include
-#if (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0))
-#include
-#else
#include
-#endif
#include
#include "NetworkDevice.h"
#include "WiFiManager.h"
diff --git a/updater/pio_package.py b/updater/pio_package.py
index 01143bf..f7fe86e 100644
--- a/updater/pio_package.py
+++ b/updater/pio_package.py
@@ -8,8 +8,6 @@ from pathlib import Path
def get_board_name(env):
board = env.get('BOARD_MCU')
- if env.get('BOARD') == 'esp32-solo1':
- board = env.get('BOARD').replace('-', '')
return board
def create_target_dir(env):
diff --git a/updater/pio_package_pre_solo1.py b/updater/pio_package_pre_solo1.py
deleted file mode 100644
index b04f92e..0000000
--- a/updater/pio_package_pre_solo1.py
+++ /dev/null
@@ -1,42 +0,0 @@
-import re, shutil, os
-from datetime import datetime, timezone
-
-if not os.path.exists('src/networkDevices/'):
- os.mkdir('src/networkDevices')
-
-shutil.copy("../src/main.cpp", "src/main.cpp")
-shutil.copy("../src/Config.h", "src/Config.h")
-shutil.copy("../src/Logger.h", "src/Logger.h")
-shutil.copy("../src/NukiNetwork.h", "src/NukiNetwork.h")
-shutil.copy("../src/Ota.h", "src/Ota.h")
-shutil.copy("../src/PreferencesKeys.h", "src/PreferencesKeys.h")
-shutil.copy("../src/RestartReason.h", "src/RestartReason.h")
-shutil.copy("../src/WebCfgServer.h", "src/WebCfgServer.h")
-shutil.copy("../src/WebCfgServerConstants.h", "src/WebCfgServerConstants.h")
-
-shutil.copy("../src/Logger.cpp", "src/Logger.cpp")
-shutil.copy("../src/NukiNetwork.cpp", "src/NukiNetwork.cpp")
-shutil.copy("../src/Ota.cpp", "src/Ota.cpp")
-shutil.copy("../src/WebCfgServer.cpp", "src/WebCfgServer.cpp")
-
-shutil.copy("../src/networkDevices/EthLan8720Device.h", "src/networkDevices/EthLan8720Device.h")
-shutil.copy("../src/networkDevices/IPConfiguration.h", "src/networkDevices/IPConfiguration.h")
-shutil.copy("../src/networkDevices/NetworkDevice.h", "src/networkDevices/NetworkDevice.h")
-shutil.copy("../src/networkDevices/W5500Device.h", "src/networkDevices/W5500Device.h")
-shutil.copy("../src/networkDevices/WifiDevice.h", "src/networkDevices/WifiDevice.h")
-
-shutil.copy("../src/networkDevices/EthLan8720Device.cpp", "src/networkDevices/EthLan8720Device.cpp")
-shutil.copy("../src/networkDevices/IPConfiguration.cpp", "src/networkDevices/IPConfiguration.cpp")
-shutil.copy("../src/networkDevices/NetworkDevice.cpp", "src/networkDevices/NetworkDevice.cpp")
-shutil.copy("../src/networkDevices/W5500Device.cpp", "src/networkDevices/W5500Device.cpp")
-shutil.copy("../src/networkDevices/WifiDevice.cpp", "src/networkDevices/WifiDevice.cpp")
-
-regex = r"\#define NUKI_HUB_DATE \"(.*)\""
-content_new = ""
-
-with open ('src/Config.h', 'r' ) as readfile:
- file_content = readfile.read()
- content_new = re.sub(regex, "#define NUKI_HUB_DATE \"" + datetime.now(timezone.utc).strftime("%Y-%m-%d") + "\"", file_content, flags = re.M)
-
-with open('src/Config.h', 'w') as writefile:
- writefile.write(content_new)
diff --git a/updater/platformio.ini b/updater/platformio.ini
index afdaa1c..68d985f 100644
--- a/updater/platformio.ini
+++ b/updater/platformio.ini
@@ -63,23 +63,4 @@ board = nuki-esp32-s3
[env:updater_esp32-c6]
extends = env:updater_esp32dev
-board = esp32-c6-devkitm-1
-
-[env:updater_esp32solo1]
-platform = https://github.com/tasmota/platform-espressif32/releases/download/2023.10.03/platform-espressif32-2023.10.03.zip
-framework = arduino
-board = esp32-solo1
-extra_scripts =
- pre:pio_package_pre_solo1.py
- post:pio_package.py
-build_flags =
- ${env.build_flags}
- -DFRAMEWORK_ARDUINO_SOLO1
-lib_deps =
- AsyncTCP=symlink://../lib/AsyncTCP
- Ethernet=symlink://../lib/Ethernet
- HTTPClient=symlink://../lib/HTTPClient
- WebServer=symlink://../lib/WebServer
- WiFiManager=symlink://../lib/WiFiManager
-lib_ignore =
- NetworkClientSecure
\ No newline at end of file
+board = esp32-c6-devkitm-1
\ No newline at end of file