diff --git a/Sming/Arch/Esp32/Components/esp32/project/sdkconfig.defaults.debug b/Sming/Arch/Esp32/Components/esp32/project/sdkconfig.defaults.debug index 758d125f83..cb3c9cab5c 100644 --- a/Sming/Arch/Esp32/Components/esp32/project/sdkconfig.defaults.debug +++ b/Sming/Arch/Esp32/Components/esp32/project/sdkconfig.defaults.debug @@ -16,7 +16,7 @@ CONFIG_IDF_FIRMWARE_CHIP_ID=0x0000 CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=8192 # Mandatory Sming framework changes -CONFIG_ESP_TIMER_TASK_STACK_SIZE=8192 +CONFIG_ESP_TIMER_TASK_STACK_SIZE=16384 CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=8192 # The bootloader logs all type of messages diff --git a/Sming/Arch/Esp32/Components/esp32/project/sdkconfig.defaults.release b/Sming/Arch/Esp32/Components/esp32/project/sdkconfig.defaults.release index d1c7ab696f..255cb2c690 100644 --- a/Sming/Arch/Esp32/Components/esp32/project/sdkconfig.defaults.release +++ b/Sming/Arch/Esp32/Components/esp32/project/sdkconfig.defaults.release @@ -16,7 +16,7 @@ CONFIG_IDF_FIRMWARE_CHIP_ID=0x0000 CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=8192 # Mandatory Sming framework changes -CONFIG_ESP_TIMER_TASK_STACK_SIZE=8192 +CONFIG_ESP_TIMER_TASK_STACK_SIZE=16384 CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=8192 # The bootloader logs only errors diff --git a/Sming/Components/Network/Arch/Esp32/Platform/AccessPointImpl.cpp b/Sming/Components/Network/Arch/Esp32/Platform/AccessPointImpl.cpp index 33fe58ff40..a6cda7928a 100644 --- a/Sming/Components/Network/Arch/Esp32/Platform/AccessPointImpl.cpp +++ b/Sming/Components/Network/Arch/Esp32/Platform/AccessPointImpl.cpp @@ -95,31 +95,42 @@ bool AccessPointImpl::config(const String& ssid, String password, WifiAuthMode m IpAddress AccessPointImpl::getIP() const { + IpAddress addr; esp_netif_ip_info_t info; - ESP_ERROR_CHECK(esp_netif_get_ip_info(apNetworkInterface, &info)); - return info.ip.addr; + if(esp_netif_get_ip_info(apNetworkInterface, &info) == ESP_OK) { + addr = info.ip.addr; + } + return addr; } IpAddress AccessPointImpl::getNetworkBroadcast() const { + IpAddress addr; esp_netif_ip_info_t info; - ESP_ERROR_CHECK(esp_netif_get_ip_info(apNetworkInterface, &info)); - return info.ip.addr | ~info.netmask.addr; + if(esp_netif_get_ip_info(apNetworkInterface, &info) == ESP_OK) { + addr = info.ip.addr | ~info.netmask.addr; + } + return addr; } IpAddress AccessPointImpl::getNetworkMask() const { + IpAddress addr; esp_netif_ip_info_t info; - ESP_ERROR_CHECK(esp_netif_get_ip_info(apNetworkInterface, &info)); - return info.netmask.addr; + if(esp_netif_get_ip_info(apNetworkInterface, &info) == ESP_OK) { + addr = info.netmask.addr; + } + return addr; } IpAddress AccessPointImpl::getNetworkGateway() const { + IpAddress addr; esp_netif_ip_info_t info; - ESP_ERROR_CHECK(esp_netif_get_ip_info(apNetworkInterface, &info)); - - return info.gw.addr; + if(esp_netif_get_ip_info(apNetworkInterface, &info) == ESP_OK) { + addr = info.gw.addr; + } + return addr; } bool AccessPointImpl::setIP(IpAddress address) diff --git a/Sming/Components/Network/Arch/Esp32/Platform/StationImpl.cpp b/Sming/Components/Network/Arch/Esp32/Platform/StationImpl.cpp index 6780762c58..fed72f220d 100644 --- a/Sming/Components/Network/Arch/Esp32/Platform/StationImpl.cpp +++ b/Sming/Components/Network/Arch/Esp32/Platform/StationImpl.cpp @@ -193,23 +193,32 @@ bool StationImpl::setMacAddress(const MacAddress& addr) const IpAddress StationImpl::getNetworkBroadcast() const { + IpAddress addr; esp_netif_ip_info_t info; - ESP_ERROR_CHECK(esp_netif_get_ip_info(stationNetworkInterface, &info)); - return info.ip.addr | ~info.netmask.addr; + if(esp_netif_get_ip_info(stationNetworkInterface, &info) == ESP_OK) { + addr = info.ip.addr | ~info.netmask.addr; + } + return addr; } IpAddress StationImpl::getNetworkMask() const { + IpAddress addr; esp_netif_ip_info_t info; - ESP_ERROR_CHECK(esp_netif_get_ip_info(stationNetworkInterface, &info)); - return info.netmask.addr; + if(esp_netif_get_ip_info(stationNetworkInterface, &info) == ESP_OK) { + addr = info.netmask.addr; + } + return addr; } IpAddress StationImpl::getNetworkGateway() const { + IpAddress addr; esp_netif_ip_info_t info; - ESP_ERROR_CHECK(esp_netif_get_ip_info(stationNetworkInterface, &info)); - return info.gw.addr; + if(esp_netif_get_ip_info(stationNetworkInterface, &info) == ESP_OK) { + addr = info.gw.addr; + } + return addr; } bool StationImpl::setIP(IpAddress address, IpAddress netmask, IpAddress gateway) diff --git a/Sming/Components/Network/src/Network/HttpClient.cpp b/Sming/Components/Network/src/Network/HttpClient.cpp index 723788e3fe..0d54aeff5f 100644 --- a/Sming/Components/Network/src/Network/HttpClient.cpp +++ b/Sming/Components/Network/src/Network/HttpClient.cpp @@ -14,7 +14,7 @@ #include "Data/Stream/FileStream.h" HttpClient::HttpConnectionPool HttpClient::httpConnectionPool; -Timer HttpClient::cleanUpTimer; +SimpleTimer HttpClient::cleanUpTimer; bool HttpClient::send(HttpRequest* request) { @@ -41,7 +41,7 @@ bool HttpClient::send(HttpRequest* request) } if(!cleanUpTimer.isStarted()) { - cleanUpTimer.initializeMs<60000>(&HttpClient::cleanInactive).start(); // run every minute + cleanUpTimer.initializeMs<60000>(HttpClient::cleanInactive).start(); // run every minute } return connection->send(request); } diff --git a/Sming/Components/Network/src/Network/HttpClient.h b/Sming/Components/Network/src/Network/HttpClient.h index e2d332e1a1..80a40fa6f8 100644 --- a/Sming/Components/Network/src/Network/HttpClient.h +++ b/Sming/Components/Network/src/Network/HttpClient.h @@ -23,7 +23,7 @@ #include "Http/HttpRequest.h" #include "Http/HttpClientConnection.h" #include "Data/Stream/LimitedMemoryStream.h" -#include +#include class HttpClient { @@ -145,7 +145,7 @@ class HttpClient static HttpConnectionPool httpConnectionPool; private: - static Timer cleanUpTimer; + static SimpleTimer cleanUpTimer; static void cleanInactive(); }; diff --git a/Sming/Components/ssl/src/Session.cpp b/Sming/Components/ssl/src/Session.cpp index 208fee87c0..6f0143a5de 100644 --- a/Sming/Components/ssl/src/Session.cpp +++ b/Sming/Components/ssl/src/Session.cpp @@ -24,8 +24,8 @@ String Options::toString() const if(field) { \ if(s) { \ s += ", "; \ - s += _F(#field); \ } \ + s += _F(#field); \ } ADD(sessionResume); diff --git a/samples/Basic_IFS/basic_ifs_Esp32.hw b/samples/Basic_IFS/basic_ifs_Esp32.hw index e5a80b47b0..3f3f6e9c17 100644 --- a/samples/Basic_IFS/basic_ifs_Esp32.hw +++ b/samples/Basic_IFS/basic_ifs_Esp32.hw @@ -2,7 +2,7 @@ "base_config": "basic_ifs", "arch": "Esp32", "partitions": { - "rom0": { + "factory": { "size": "960K" } } diff --git a/samples/Basic_WebSkeletonApp/app/application.cpp b/samples/Basic_WebSkeletonApp/app/application.cpp index 187bd579bf..72112247aa 100644 --- a/samples/Basic_WebSkeletonApp/app/application.cpp +++ b/samples/Basic_WebSkeletonApp/app/application.cpp @@ -56,7 +56,7 @@ void init() WifiEvents.onStationDisconnect(STADisconnect); WifiEvents.onStationGotIP(STAGotIP); - startWebServer(); + System.onReady(startWebServer); counterTimer.initializeMs(1000, counterLoop).start(); } diff --git a/samples/Basic_WebSkeletonApp_LTS/app/application.cpp b/samples/Basic_WebSkeletonApp_LTS/app/application.cpp index edd109110b..7c7d00e2b8 100644 --- a/samples/Basic_WebSkeletonApp_LTS/app/application.cpp +++ b/samples/Basic_WebSkeletonApp_LTS/app/application.cpp @@ -24,7 +24,7 @@ void init() WifiEvents.onStationDisconnect(STADisconnect); WifiEvents.onStationGotIP(STAGotIP); - startWebServer(); + System.onReady(startWebServer); counterTimer.initializeMs(1000, counterLoop).start(); }