LittleFS, and some mprovements

This commit is contained in:
Yuri Trikoz
2020-06-20 22:51:14 +03:00
parent db5b8d7258
commit 6fbd555474
22 changed files with 870 additions and 890 deletions

View File

@@ -6,7 +6,7 @@
#include <ESP32Servo.h>
#include <HTTPClient.h>
#include <HTTPUpdate.h>
#include <SPIFFS.h>
#include <LittleFS.h>
#include <WiFi.h>
#include <analogWrite.h>

View File

@@ -8,6 +8,7 @@
#include <ArduinoJson.h>
#include <ESP8266HTTPUpdateServer.h>
#include <ESPAsyncWebServer.h>
#include <LittleFS.h>
#include <SPIFFSEditor.h>
#include "Consts.h"
@@ -44,7 +45,7 @@
#ifdef WS_enable
extern AsyncWebSocket ws;
//extern AsyncEventSource events;
#endif
#endif
extern TickerScheduler ts;
@@ -56,9 +57,6 @@ extern AsyncWebServer server;
extern DallasTemperature sensors;
/*
* Global vars
*/
@@ -82,14 +80,13 @@ enum { ROUTER_SEARCHING,
UDP_DB,
TEST };
extern boolean just_load;
extern String configSetupJson; //все настройки
extern String configLiveJson; //все данные с датчиков (связан с mqtt)
extern String configOptionJson; //для трансфера
extern String chipID;
extern String chipId;
extern String prex;
extern String all_widgets;
extern String scenario;
@@ -187,6 +184,7 @@ extern void clean_log_date();
extern void choose_log_date_and_send();
// Main
extern void setChipId();
extern void getMemoryLoad(String text);
extern void saveConfig();
extern String getURL(const String &urls);

View File

@@ -7,24 +7,24 @@
* Чтение строки из файла
* возвращает стоку из файла в которой есть искомое слово found
*/
String readFileString(const String& filename, const String& str_to_found);
String readFileString(const String filename, const String to_find);
/*
* Добовление строки в файл
*/
String addFile(const String& fileName, const String& str);
String addFile(const String filename, const String str);
/*
* Запись строки в файл
*/
String writeFile(const String& fileName, const String& str);
String writeFile(const String filename, const String str);
/*
* Чтение файла в строку
*/
String readFile(const String& fileName, size_t len);
String readFile(const String filename, size_t max_size);
/*
* Размер файла
*/
String sizeFile(const String& fileName);
String getFileSize(const String filename);

View File

@@ -1,6 +1,7 @@
#pragma once
#include <Arduino.h>
#include <TZ.h>
void Time_Init();
@@ -23,11 +24,14 @@ String getTimeUnix();
*/
boolean getUnixTimeStr(String&);
String GetTimeWOsec();
String getTimeWOsec();
String GetDate();
/*
* Получение даты
*/
String getDate();
String GetDataDigital();
String getDateDigitalFormated();
int timeToMin(String Time);