mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-28 18:38:20 +03:00
Migration of PlatformIO 5.2.0 to 6.1.0 (resp. ESP IDF from 4.4.2 to 5.0.1) (#2305)
* Migration to PlatformIO 6.1.0 * Disable RMTMEM usage as it is no longer allowed -> Smart LEDs not functional! * moved miniz into subfolder of jomjol_fileserver_ota, else it does not build anymore. * cleanup * fix leading NaN (#2310) * Migration to PlatformIO 6.1.0 * Disable RMTMEM usage as it is no longer allowed -> Smart LEDs not functional! * moved miniz into subfolder of jomjol_fileserver_ota, else it does not build anymore. * cleanup * Task watchdog has new config name * Fix return value check. It must be something else than ESP_FAIL, but it does not need to be ESP_OK! * add missing strucures to work around new RMTMEM restriction (untested) --------- Co-authored-by: CaCO3 <caco@ruinelli.ch>
This commit is contained in:
@@ -66,5 +66,4 @@ FILE(GLOB_RECURSE app_sources ${CMAKE_SOURCE_DIR}/main/*.*)
|
||||
|
||||
idf_component_register(SRCS ${app_sources}
|
||||
INCLUDE_DIRS "."
|
||||
# REQUIRES esp_psram) # comming in IDF 5.0
|
||||
)
|
||||
REQUIRES esp_psram)
|
||||
@@ -9,10 +9,9 @@
|
||||
|
||||
//#include "driver/gpio.h"
|
||||
//#include "sdkconfig.h"
|
||||
//#include "esp_psram.h" // Comming in IDF 5.0, see https://docs.espressif.com/projects/esp-idf/en/v5.0-beta1/esp32/migration-guides/release-5.x/system.html?highlight=esp_psram_get_size
|
||||
//#include "spiram.h"
|
||||
#include "esp32/spiram.h"
|
||||
#include "esp_psram.h"
|
||||
#include "esp_pm.h"
|
||||
#include "esp_chip_info.h"
|
||||
|
||||
|
||||
// SD-Card ////////////////////
|
||||
@@ -63,6 +62,11 @@
|
||||
#endif
|
||||
#endif //DEBUG_ENABLE_SYSINFO
|
||||
|
||||
// define `gpio_pad_select_gpip` for newer versions of IDF
|
||||
#if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 3, 0))
|
||||
#include "esp_rom_gpio.h"
|
||||
#define gpio_pad_select_gpio esp_rom_gpio_pad_select_gpio
|
||||
#endif
|
||||
|
||||
#ifdef USE_HIMEM_IF_AVAILABLE
|
||||
#include "esp32/himem.h"
|
||||
@@ -372,14 +376,14 @@ extern "C" void app_main(void)
|
||||
|
||||
// Init external PSRAM
|
||||
// ********************************************
|
||||
esp_err_t PSRAMStatus = esp_spiram_init();
|
||||
if (PSRAMStatus != ESP_OK) { // ESP_FAIL -> Failed to init PSRAM
|
||||
esp_err_t PSRAMStatus = esp_psram_init();
|
||||
if (PSRAMStatus == ESP_FAIL) { // ESP_FAIL -> Failed to init PSRAM
|
||||
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "PSRAM init failed (" + std::to_string(PSRAMStatus) + ")! PSRAM not found or defective");
|
||||
setSystemStatusFlag(SYSTEM_STATUS_PSRAM_BAD);
|
||||
StatusLED(PSRAM_INIT, 1, true);
|
||||
}
|
||||
else { // ESP_OK -> PSRAM init OK --> continue to check PSRAM size
|
||||
size_t psram_size = esp_spiram_get_size(); // size_t psram_size = esp_psram_get_size(); // comming in IDF 5.0
|
||||
size_t psram_size = esp_psram_get_size(); // size_t psram_size = esp_psram_get_size(); // comming in IDF 5.0
|
||||
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "PSRAM size: " + std::to_string(psram_size) + " byte (" + std::to_string(psram_size/1024/1024) +
|
||||
"MB / " + std::to_string(psram_size/1024/1024*8) + "MBit)");
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "version.h"
|
||||
|
||||
#include "esp_wifi.h"
|
||||
#include <netdb.h>
|
||||
|
||||
#include "MainFlowControl.h"
|
||||
#include "esp_log.h"
|
||||
@@ -24,6 +25,8 @@
|
||||
httpd_handle_t server = NULL;
|
||||
std::string starttime = "";
|
||||
|
||||
extern esp_netif_t *sta_netif;
|
||||
|
||||
static const char *TAG = "MAIN SERVER";
|
||||
|
||||
/* An HTTP GET handler */
|
||||
@@ -350,11 +353,15 @@ esp_err_t sysinfo_handler(httpd_req_t *req)
|
||||
char freeheapmem[11];
|
||||
sprintf(freeheapmem, "%lu", (long) getESPHeapSize());
|
||||
|
||||
tcpip_adapter_ip_info_t ip_info;
|
||||
ESP_ERROR_CHECK(tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_STA, &ip_info));
|
||||
esp_netif_ip_info_t ip_info;
|
||||
ESP_ERROR_CHECK(esp_netif_get_ip_info(sta_netif, &ip_info));
|
||||
const char *hostname;
|
||||
ESP_ERROR_CHECK(tcpip_adapter_get_hostname(TCPIP_ADAPTER_IF_STA, &hostname));
|
||||
ESP_ERROR_CHECK(esp_netif_get_hostname(sta_netif, &hostname));
|
||||
|
||||
char ipFormated[4*3+3+1];
|
||||
|
||||
sprintf(ipFormated, IPSTR, IP2STR(&ip_info.ip));
|
||||
|
||||
zw = string("[{") +
|
||||
"\"firmware\": \"" + gitversion + "\"," +
|
||||
"\"buildtime\": \"" + buildtime + "\"," +
|
||||
@@ -364,7 +371,7 @@ esp_err_t sysinfo_handler(httpd_req_t *req)
|
||||
"\"html\": \"" + htmlversion + "\"," +
|
||||
"\"cputemp\": \"" + cputemp + "\"," +
|
||||
"\"hostname\": \"" + hostname + "\"," +
|
||||
"\"IPv4\": \"" + ip4addr_ntoa(&ip_info.ip) + "\"," +
|
||||
"\"IPv4\": \"" + string(ipFormated) + "\"," +
|
||||
"\"freeHeapMem\": \"" + freeheapmem + "\"" +
|
||||
"}]";
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include "freertos/task.h"
|
||||
#include "esp_mac.h"
|
||||
#include "esp_wifi.h"
|
||||
#include "esp_event.h"
|
||||
|
||||
#include "esp_log.h"
|
||||
#include "nvs_flash.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user