Compare commits
No commits in common. "24ba0a09f49a9dd6566d72a785aa8124a1ebb103" and "8e9082f05e8fcf47f2734f88cabb01f34d0460a8" have entirely different histories.
24ba0a09f4
...
8e9082f05e
@ -2,52 +2,48 @@
|
||||
platform = espressif8266
|
||||
board = nodemcuv2
|
||||
framework = arduino
|
||||
board_build.filesystem = littlefs
|
||||
lib_deps =
|
||||
https://github.com/aZholtikov/ZHNetwork
|
||||
https://github.com/aZholtikov/ZHConfig
|
||||
https://github.com/aZholtikov/Async-Web-Server
|
||||
https://github.com/bblanchon/ArduinoJson
|
||||
https://github.com/marvinroger/async-mqtt-client
|
||||
bblanchon/ArduinoJson@^6.19.4
|
||||
me-no-dev/ESP Async WebServer@^1.2.3
|
||||
marvinroger/AsyncMqttClient@^0.9.0
|
||||
|
||||
[env:ESP8266-OTA]
|
||||
platform = espressif8266
|
||||
board = nodemcuv2
|
||||
framework = arduino
|
||||
board_build.filesystem = littlefs
|
||||
upload_port = 192.168.1.113
|
||||
upload_protocol = espota
|
||||
lib_deps =
|
||||
https://github.com/aZholtikov/ZHNetwork
|
||||
https://github.com/aZholtikov/ZHConfig
|
||||
https://github.com/aZholtikov/Async-Web-Server
|
||||
https://github.com/bblanchon/ArduinoJson
|
||||
https://github.com/marvinroger/async-mqtt-client
|
||||
bblanchon/ArduinoJson@^6.19.4
|
||||
me-no-dev/ESP Async WebServer@^1.2.3
|
||||
marvinroger/AsyncMqttClient@^0.9.0
|
||||
|
||||
[env:ESP32]
|
||||
platform = espressif32
|
||||
board = az-delivery-devkit-v4
|
||||
framework = arduino
|
||||
board_build.filesystem = littlefs
|
||||
lib_deps =
|
||||
https://github.com/aZholtikov/ZHNetwork
|
||||
https://github.com/aZholtikov/ZHConfig
|
||||
https://github.com/aZholtikov/Async-Web-Server
|
||||
https://github.com/bblanchon/ArduinoJson
|
||||
https://github.com/marvinroger/async-mqtt-client
|
||||
https://github.com/luc-github/ESP32SSDP
|
||||
bblanchon/ArduinoJson@^6.19.4
|
||||
me-no-dev/ESP Async WebServer@^1.2.3
|
||||
marvinroger/AsyncMqttClient@^0.9.0
|
||||
luc-github/ESP32SSDP@^1.2.0
|
||||
|
||||
[env:ESP32-OTA]
|
||||
platform = espressif32
|
||||
board = az-delivery-devkit-v4
|
||||
framework = arduino
|
||||
board_build.filesystem = littlefs
|
||||
upload_port = 192.168.1.110
|
||||
upload_protocol = espota
|
||||
lib_deps =
|
||||
https://github.com/aZholtikov/ZHNetwork
|
||||
https://github.com/aZholtikov/ZHConfig
|
||||
https://github.com/aZholtikov/Async-Web-Server
|
||||
https://github.com/bblanchon/ArduinoJson
|
||||
https://github.com/marvinroger/async-mqtt-client
|
||||
https://github.com/luc-github/ESP32SSDP
|
||||
bblanchon/ArduinoJson@^6.19.4
|
||||
me-no-dev/ESP Async WebServer@^1.2.3
|
||||
marvinroger/AsyncMqttClient@^0.9.0
|
||||
luc-github/ESP32SSDP@^1.2.0
|
||||
|
20
src/main.cpp
20
src/main.cpp
@ -1,8 +1,7 @@
|
||||
#include "ArduinoJson.h"
|
||||
#include "ArduinoOTA.h"
|
||||
#include "ESPAsyncWebServer.h" // https://github.com/aZholtikov/Async-Web-Server
|
||||
#include "ESPAsyncWebServer.h"
|
||||
#include "AsyncMQTTClient.h"
|
||||
#include "LittleFS.h"
|
||||
#include "Ticker.h"
|
||||
#include "ZHNetwork.h"
|
||||
#include "ZHConfig.h"
|
||||
@ -10,6 +9,7 @@
|
||||
#include "ESP8266SSDP.h"
|
||||
#endif
|
||||
#if defined(ESP32)
|
||||
#include "SPIFFS.h"
|
||||
#include "ESP32SSDP.h"
|
||||
#endif
|
||||
|
||||
@ -34,7 +34,7 @@ void setupWebServer(void);
|
||||
|
||||
void connectToMqtt(void);
|
||||
|
||||
const String firmware{"1.26"};
|
||||
const String firmware{"1.25"};
|
||||
|
||||
String espnowNetName{"DEFAULT"};
|
||||
|
||||
@ -72,7 +72,7 @@ void attributesMessageTimerCallback(void);
|
||||
|
||||
void setup()
|
||||
{
|
||||
LittleFS.begin();
|
||||
SPIFFS.begin();
|
||||
|
||||
loadConfig();
|
||||
|
||||
@ -433,9 +433,9 @@ String getValue(String data, char separator, uint8_t index)
|
||||
|
||||
void loadConfig()
|
||||
{
|
||||
if (!LittleFS.exists("/config.json"))
|
||||
if (!SPIFFS.exists("/config.json"))
|
||||
saveConfig();
|
||||
File file = LittleFS.open("/config.json", "r");
|
||||
File file = SPIFFS.open("/config.json", "r");
|
||||
String jsonFile = file.readString();
|
||||
StaticJsonDocument<1024> json;
|
||||
deserializeJson(json, jsonFile);
|
||||
@ -465,7 +465,7 @@ void saveConfig()
|
||||
json["mqttUserPassword"] = mqttUserPassword;
|
||||
json["topicPrefix"] = topicPrefix;
|
||||
json["system"] = "empty";
|
||||
File file = LittleFS.open("/config.json", "w");
|
||||
File file = SPIFFS.open("/config.json", "w");
|
||||
serializeJsonPretty(json, file);
|
||||
file.close();
|
||||
}
|
||||
@ -505,7 +505,7 @@ void setupWebServer()
|
||||
request->send(200, "text/xml", ssdpSend); });
|
||||
|
||||
webServer.on("/", HTTP_GET, [](AsyncWebServerRequest *request)
|
||||
{ request->send(LittleFS, "/index.htm"); });
|
||||
{ request->send(SPIFFS, "/index.htm"); });
|
||||
|
||||
webServer.on("/setting", HTTP_GET, [](AsyncWebServerRequest *request)
|
||||
{
|
||||
@ -528,8 +528,8 @@ void setupWebServer()
|
||||
|
||||
webServer.onNotFound([](AsyncWebServerRequest *request)
|
||||
{
|
||||
if (LittleFS.exists(request->url()))
|
||||
request->send(LittleFS, request->url());
|
||||
if (SPIFFS.exists(request->url()))
|
||||
request->send(SPIFFS, request->url());
|
||||
else
|
||||
{
|
||||
request->send(404, "text/plain", "File Not Found");
|
||||
|
Loading…
x
Reference in New Issue
Block a user