mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
esp32 compiling version
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#ifdef FSEditor
|
||||
#include "FSEditor.h"
|
||||
|
||||
#ifdef ESP32
|
||||
#include "LITTLEFS.h"
|
||||
#define LittleFS LITTLEFS
|
||||
@@ -324,3 +324,4 @@ void FSEditor::handleUpload(AsyncWebServerRequest *request, const String &filena
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1,3 +1,4 @@
|
||||
#ifdef SSDP
|
||||
#ifdef ESP8266
|
||||
#include <ESP8266SSDP.h>
|
||||
#endif
|
||||
@@ -52,4 +53,5 @@ String decToHex(uint32_t decValue, byte desiredStringLength) {
|
||||
String hexString = String(decValue, HEX);
|
||||
while (hexString.length() < desiredStringLength) hexString = "0" + hexString;
|
||||
return hexString;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifdef SERVO_ENABLED
|
||||
#include "Servo/Servos.h"
|
||||
|
||||
Servos myServo;
|
||||
|
||||
Servos::Servos(){};
|
||||
@@ -38,3 +38,4 @@ Servo *Servos::get(uint8_t num) {
|
||||
size_t Servos::count() {
|
||||
return _items.size();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -59,7 +59,7 @@ void upgrade_firmware() {
|
||||
t_httpUpdate_return ret = ESPhttpUpdate.updateSpiffs(wifiClient, "http://91.204.228.124:1100/update/esp8266/esp32-esp8266_iot-manager_modules_firmware.spiffs.bin");
|
||||
#else
|
||||
httpUpdate.rebootOnUpdate(false);
|
||||
t_httpUpdate_return ret = httpUpdate.updateSpiffs(client_for_upgrade, "http://91.204.228.124:1100/update/esp32/esp32-esp8266_iot-manager_modules_firmware.spiffs.bin");
|
||||
t_httpUpdate_return ret = httpUpdate.updateSpiffs(wifiClient, "http://91.204.228.124:1100/update/esp32/esp32-esp8266_iot-manager_modules_firmware.spiffs.bin");
|
||||
#endif
|
||||
if (ret == HTTP_UPDATE_OK) {
|
||||
writeFile(String(DEVICE_SCENARIO_FILE), scanerioBackup);
|
||||
@@ -78,7 +78,7 @@ void upgrade_firmware() {
|
||||
#ifdef ESP8266
|
||||
ret = ESPhttpUpdate.update(wifiClient, "http://91.204.228.124:1100/update/esp8266/esp32-esp8266_iot-manager_modules_firmware.ino.bin");
|
||||
#else
|
||||
ret = httpUpdate.update(client_for_upgrade, "http://91.204.228.124:1100/update/esp32/esp32-esp8266_iot-manager_modules_firmware.ino.bin");
|
||||
ret = httpUpdate.update(wifiClient, "http://91.204.228.124:1100/update/esp32/esp32-esp8266_iot-manager_modules_firmware.ino.bin");
|
||||
#endif
|
||||
if (ret == HTTP_UPDATE_OK) {
|
||||
pm.info("done! restart...");
|
||||
|
||||
@@ -20,7 +20,7 @@ void startSTAMode() {
|
||||
|
||||
bool keepConnecting = true;
|
||||
uint8_t tries = 20;
|
||||
sint8_t connRes;
|
||||
int8_t connRes;
|
||||
do {
|
||||
#ifdef ESP8266
|
||||
connRes = WiFi.waitForConnectResult(1000);
|
||||
|
||||
@@ -15,10 +15,12 @@ void initWS();
|
||||
void init() {
|
||||
String login = jsonReadStr(configSetupJson, "weblogin");
|
||||
String pass = jsonReadStr(configSetupJson, "webpass");
|
||||
#ifdef FSEditor
|
||||
#ifdef ESP32
|
||||
server.addHandler(new FSEditor(LittleFS, login, pass));
|
||||
#else
|
||||
server.addHandler(new FSEditor(login, pass));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
server.serveStatic("/css/", LittleFS, "/css/").setCacheControl("max-age=600");
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
|
||||
#include <SSDP.h>
|
||||
|
||||
#include "Class/CallBackTest.h"
|
||||
#include "Class/NotAsinc.h"
|
||||
#include "Class/ScenarioClass.h"
|
||||
@@ -72,9 +73,10 @@ void setup() {
|
||||
pm.info("Broadcast UDP");
|
||||
udpInit();
|
||||
#endif
|
||||
|
||||
#ifdef SSDP
|
||||
pm.info("Ssdp Init");
|
||||
SsdpInit();
|
||||
#endif
|
||||
|
||||
ts.add(
|
||||
TEST, 1000 * 60, [&](void*) {
|
||||
|
||||
Reference in New Issue
Block a user