diff --git a/esp3d/src/core/hal.cpp b/esp3d/src/core/hal.cpp index b8ebbc74..2884811e 100644 --- a/esp3d/src/core/hal.cpp +++ b/esp3d/src/core/hal.cpp @@ -24,6 +24,8 @@ #include "ESP8266WiFi.h" #endif //ARDUINO_ARCH_ESP8266 #if defined(ARDUINO_ARCH_ESP32) +#include +#include #include "WiFi.h" #ifdef __cplusplus extern "C" { @@ -183,6 +185,10 @@ void Hal::analogWriteRange(uint32_t range) //Setup bool Hal::begin() { +#if defined(ARDUINO_ARCH_ESP32) && defined(CAMERA_DEVICE) + log_esp3d("Disable brown out"); + WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); //disable brownout detector +#endif //ARDUINO_ARCH_ESP32 && CAMERA_DEVICE //Clear all wifi state WiFi.persistent(false); WiFi.disconnect(true); diff --git a/esp3d/src/include/version.h b/esp3d/src/include/version.h index 99caef9b..0b9036a0 100644 --- a/esp3d/src/include/version.h +++ b/esp3d/src/include/version.h @@ -22,7 +22,7 @@ #define _VERSION_ESP3D_H //version and sources location -#define FW_VERSION "3.0.0.a52" +#define FW_VERSION "3.0.0.a53" #define REPOSITORY "https://github.com/luc-github/ESP3D/tree/3.0" #endif //_VERSION_ESP3D_H diff --git a/esp3d/src/modules/camera/camera.cpp b/esp3d/src/modules/camera/camera.cpp index 85ff82a3..6832d9ed 100644 --- a/esp3d/src/modules/camera/camera.cpp +++ b/esp3d/src/modules/camera/camera.cpp @@ -28,7 +28,7 @@ #include "esp_http_server.h" #include #include "fd_forward.h" -//#include //not sure this one is needed +#include //not sure this one is needed #include #include diff --git a/esp3d/src/modules/filesystem/sd/sdio_esp32.cpp b/esp3d/src/modules/filesystem/sd/sdio_esp32.cpp index 1b1f6f97..54ab8f18 100644 --- a/esp3d/src/modules/filesystem/sd/sdio_esp32.cpp +++ b/esp3d/src/modules/filesystem/sd/sdio_esp32.cpp @@ -148,10 +148,12 @@ ESP_SDFile ESP_SD::open(const char* path, uint8_t mode) { //do some check if(((strcmp(path,"/") == 0) && ((mode == ESP_FILE_WRITE) || (mode == ESP_FILE_APPEND))) || (strlen(path) == 0)) { + log_esp3d("File open check : failed"); return ESP_SDFile(); } // path must start by '/' if (path[0] != '/') { + log_esp3d("File open path is invalid"); return ESP_SDFile(); } if (mode != ESP_FILE_READ) { @@ -159,7 +161,7 @@ ESP_SDFile ESP_SD::open(const char* path, uint8_t mode) String p = path; p.remove(p.lastIndexOf('/') +1); if (!exists(p.c_str())) { - log_esp3d("Error opening: %s", path); + log_esp3d("Error opening: %s, %s does not exists", path,p.c_str()); return ESP_SDFile(); } } @@ -171,13 +173,18 @@ ESP_SDFile ESP_SD::open(const char* path, uint8_t mode) bool ESP_SD::exists(const char* path) { bool res = false; + String p = path; //root should always be there if started - if (strcmp(path, "/") == 0) { + if (p == "/") { return _started; } - res = SD_MMC.exists(path); + + if (p.endsWith("/")) { + p.remove( p.length() - 1,1); + } + res = SD_MMC.exists(p); if (!res) { - ESP_SDFile root = ESP_SD::open(path, ESP_FILE_READ); + ESP_SDFile root = ESP_SD::open(p.c_str(), ESP_FILE_READ); if (root) { res = root.isDirectory(); } diff --git a/esp3d/src/modules/sensor/dht.cpp b/esp3d/src/modules/sensor/dht.cpp index a3d76557..35748bd4 100644 --- a/esp3d/src/modules/sensor/dht.cpp +++ b/esp3d/src/modules/sensor/dht.cpp @@ -135,7 +135,7 @@ const char * DHTSensorDevice::GetData() if ( String(humidity,1)!="nan") { s= String(temperature,1); s+= "["; - s+= SENSOR__UNIT+ + s+= SENSOR__UNIT; s+="] " + String(humidity,1) + "[%]"; } else { s="DISCONNECTED";