Upgraded to latest Beta build system
This one is using esp32-arduino 2.0.3
This commit is contained in:
parent
c4d0bb3d3e
commit
5653d0f835
@ -1,2 +0,0 @@
|
|||||||
Import("env")
|
|
||||||
env.Replace( MKSPIFFSTOOL=env.get("PROJECT_DIR") + '/vendor/mklittlefs' )
|
|
||||||
@ -15,22 +15,21 @@ default_envs = esp32
|
|||||||
framework = arduino
|
framework = arduino
|
||||||
|
|
||||||
[env:esp32]
|
[env:esp32]
|
||||||
platform = espressif32
|
platform = https://github.com/Jason2866/platform-espressif32/releases/download/v2.0.3-rc1/platform-espressif32-2.0.3-rc1.zip
|
||||||
|
|
||||||
build_flags =
|
build_flags =
|
||||||
${env.build_flags}
|
${env.build_flags}
|
||||||
-D=${PIOENV}
|
-D=${PIOENV}
|
||||||
|
|
||||||
lib_deps =
|
lib_deps =
|
||||||
https://github.com/lorol/LITTLEFS.git
|
|
||||||
https://github.com/me-no-dev/ESPAsyncWebServer.git
|
https://github.com/me-no-dev/ESPAsyncWebServer.git
|
||||||
bblanchon/ArduinoJson @ ^6.19.4
|
bblanchon/ArduinoJson @ ^6.19.4
|
||||||
|
|
||||||
board = esp32dev
|
board = esp32dev
|
||||||
board_build.partitions = partitions_custom.csv
|
board_build.partitions = partitions_custom.csv
|
||||||
monitor_filters = esp32_exception_decoder
|
board_build.filesystem = littlefs
|
||||||
|
monitor_filters = time, colorize, log2file, esp32_exception_decoder
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
|
|
||||||
extra_scripts = ./littlefsbuilder.py
|
upload_protocol = esptool
|
||||||
|
upload_port = COM3
|
||||||
upload_port = COM4
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
#include "defaults.h"
|
#include "defaults.h"
|
||||||
#include <LITTLEFS.h>
|
#include <LittleFS.h>
|
||||||
|
|
||||||
CONFIG_T config;
|
CONFIG_T config;
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ void ConfigurationClass::init()
|
|||||||
|
|
||||||
bool ConfigurationClass::write()
|
bool ConfigurationClass::write()
|
||||||
{
|
{
|
||||||
File f = LITTLEFS.open(CONFIG_FILENAME, "w");
|
File f = LittleFS.open(CONFIG_FILENAME, "w");
|
||||||
if (!f) {
|
if (!f) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -39,7 +39,7 @@ bool ConfigurationClass::write()
|
|||||||
|
|
||||||
bool ConfigurationClass::read()
|
bool ConfigurationClass::read()
|
||||||
{
|
{
|
||||||
File f = LITTLEFS.open(CONFIG_FILENAME, "r");
|
File f = LittleFS.open(CONFIG_FILENAME, "r");
|
||||||
if (!f) {
|
if (!f) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
#include "WiFiSettings.h"
|
#include "WiFiSettings.h"
|
||||||
#include "defaults.h"
|
#include "defaults.h"
|
||||||
#include "helper.h"
|
#include "helper.h"
|
||||||
#include <LITTLEFS.h>
|
#include <LittleFS.h>
|
||||||
#include <ResetReason.h>
|
#include <ResetReason.h>
|
||||||
|
|
||||||
WebApiClass::WebApiClass()
|
WebApiClass::WebApiClass()
|
||||||
@ -35,7 +35,7 @@ void WebApiClass::init()
|
|||||||
_server.on("/api/ntp/config", HTTP_GET, std::bind(&WebApiClass::onNtpAdminGet, this, _1));
|
_server.on("/api/ntp/config", HTTP_GET, std::bind(&WebApiClass::onNtpAdminGet, this, _1));
|
||||||
_server.on("/api/ntp/config", HTTP_POST, std::bind(&WebApiClass::onNtpAdminPost, this, _1));
|
_server.on("/api/ntp/config", HTTP_POST, std::bind(&WebApiClass::onNtpAdminPost, this, _1));
|
||||||
|
|
||||||
_server.serveStatic("/", LITTLEFS, "/", "max-age=86400").setDefaultFile("index.html");
|
_server.serveStatic("/", LittleFS, "/", "max-age=86400").setDefaultFile("index.html");
|
||||||
_server.onNotFound(std::bind(&WebApiClass::onNotFound, this, _1));
|
_server.onNotFound(std::bind(&WebApiClass::onNotFound, this, _1));
|
||||||
_server.begin();
|
_server.begin();
|
||||||
}
|
}
|
||||||
@ -97,8 +97,8 @@ void WebApiClass::onSystemStatus(AsyncWebServerRequest* request)
|
|||||||
root[F("heap_used")] = ESP.getHeapSize() - ESP.getFreeHeap();
|
root[F("heap_used")] = ESP.getHeapSize() - ESP.getFreeHeap();
|
||||||
root[F("sketch_total")] = ESP.getSketchSize() + ESP.getFreeSketchSpace();
|
root[F("sketch_total")] = ESP.getSketchSize() + ESP.getFreeSketchSpace();
|
||||||
root[F("sketch_used")] = ESP.getSketchSize();
|
root[F("sketch_used")] = ESP.getSketchSize();
|
||||||
root[F("littlefs_total")] = LITTLEFS.totalBytes();
|
root[F("littlefs_total")] = LittleFS.totalBytes();
|
||||||
root[F("littlefs_used")] = LITTLEFS.usedBytes();
|
root[F("littlefs_used")] = LittleFS.usedBytes();
|
||||||
|
|
||||||
root[F("chiprevision")] = ESP.getChipRevision();
|
root[F("chiprevision")] = ESP.getChipRevision();
|
||||||
root[F("chipmodel")] = ESP.getChipModel();
|
root[F("chipmodel")] = ESP.getChipModel();
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
#include "WiFiSettings.h"
|
#include "WiFiSettings.h"
|
||||||
#include "defaults.h"
|
#include "defaults.h"
|
||||||
#include <Arduino.h>
|
#include <Arduino.h>
|
||||||
#include <LITTLEFS.h>
|
#include <LittleFS.h>
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
@ -17,7 +17,7 @@ void setup()
|
|||||||
|
|
||||||
// Initialize file system
|
// Initialize file system
|
||||||
Serial.print(F("Initialize FS... "));
|
Serial.print(F("Initialize FS... "));
|
||||||
if (!LITTLEFS.begin()) {
|
if (!LittleFS.begin()) {
|
||||||
Serial.println(F("failed"));
|
Serial.println(F("failed"));
|
||||||
} else {
|
} else {
|
||||||
Serial.println(F("done"));
|
Serial.println(F("done"));
|
||||||
|
|||||||
BIN
vendor/mklittlefs.exe
vendored
BIN
vendor/mklittlefs.exe
vendored
Binary file not shown.
Loading…
Reference in New Issue
Block a user