mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-30 20:09:14 +03:00
esp32 version
This commit is contained in:
@@ -3,8 +3,12 @@
|
|||||||
//
|
//
|
||||||
// Firmware
|
// Firmware
|
||||||
//
|
//
|
||||||
|
#ifdef ESP8266
|
||||||
#define FIRMWARE_NAME "esp8266-iotm"
|
#define FIRMWARE_NAME "esp8266-iotm"
|
||||||
|
#endif
|
||||||
|
#ifdef ESP32
|
||||||
|
#define FIRMWARE_NAME "esp32-iotm"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define FIRMWARE_VERSION 258
|
#define FIRMWARE_VERSION 258
|
||||||
#define FLASH_4MB true
|
#define FLASH_4MB true
|
||||||
@@ -39,7 +43,7 @@
|
|||||||
//#define WEBSOCKET_ENABLED
|
//#define WEBSOCKET_ENABLED
|
||||||
//#define LAYOUT_IN_RAM
|
//#define LAYOUT_IN_RAM
|
||||||
//#define UDP_ENABLED
|
//#define UDP_ENABLED
|
||||||
//#define SSDP_ENABLED
|
#define SSDP_ENABLED
|
||||||
|
|
||||||
//
|
//
|
||||||
// Sensors enable/disable
|
// Sensors enable/disable
|
||||||
|
|||||||
@@ -32,7 +32,11 @@ void upgradeInit() {
|
|||||||
|
|
||||||
void getLastVersion() {
|
void getLastVersion() {
|
||||||
if ((WiFi.status() == WL_CONNECTED)) {
|
if ((WiFi.status() == WL_CONNECTED)) {
|
||||||
|
#ifdef ESP8266
|
||||||
String tmp = getURL(F("http://95.128.182.133/projects/iotmanager/esp8266/esp8266ver/esp8266ver.txt"));
|
String tmp = getURL(F("http://95.128.182.133/projects/iotmanager/esp8266/esp8266ver/esp8266ver.txt"));
|
||||||
|
#else
|
||||||
|
String tmp = getURL(F("http://95.128.182.133/projects/iotmanager/esp32/esp32ver/esp32ver.txt"));
|
||||||
|
#endif
|
||||||
if (tmp == "error") {
|
if (tmp == "error") {
|
||||||
lastVersion = -1;
|
lastVersion = -1;
|
||||||
} else {
|
} else {
|
||||||
@@ -88,7 +92,7 @@ bool upgradeFS() {
|
|||||||
t_httpUpdate_return retFS = ESPhttpUpdate.updateSpiffs(wifiClient, F("http://95.128.182.133/projects/iotmanager/esp8266/littlefs/littlefs.bin"));
|
t_httpUpdate_return retFS = ESPhttpUpdate.updateSpiffs(wifiClient, F("http://95.128.182.133/projects/iotmanager/esp8266/littlefs/littlefs.bin"));
|
||||||
#else
|
#else
|
||||||
httpUpdate.rebootOnUpdate(false);
|
httpUpdate.rebootOnUpdate(false);
|
||||||
HTTPUpdateResult retFS = httpUpdate.updateSpiffs(wifiClient, F("http://95.128.182.133/projects/iotmanager/esp8266/littlefs/littlefs.bin"));
|
HTTPUpdateResult retFS = httpUpdate.updateSpiffs(wifiClient, F("http://95.128.182.133/projects/iotmanager/esp32/littlefs/littlefs.bin"));
|
||||||
#endif
|
#endif
|
||||||
if (retFS == HTTP_UPDATE_OK) { //если FS обновилась успешно
|
if (retFS == HTTP_UPDATE_OK) { //если FS обновилась успешно
|
||||||
SerialPrint("I", "Update", "LittleFS upgrade done!");
|
SerialPrint("I", "Update", "LittleFS upgrade done!");
|
||||||
@@ -107,7 +111,7 @@ bool upgradeBuild() {
|
|||||||
t_httpUpdate_return retBuild = ESPhttpUpdate.update(wifiClient, F("http://95.128.182.133/projects/iotmanager/esp8266/firmware/firmware.bin"));
|
t_httpUpdate_return retBuild = ESPhttpUpdate.update(wifiClient, F("http://95.128.182.133/projects/iotmanager/esp8266/firmware/firmware.bin"));
|
||||||
#else
|
#else
|
||||||
httpUpdate.rebootOnUpdate(false);
|
httpUpdate.rebootOnUpdate(false);
|
||||||
HTTPUpdateResult retBuild = httpUpdate.update(wifiClient, F("http://95.128.182.133/projects/iotmanager/esp8266/firmware/firmware.bin"));
|
HTTPUpdateResult retBuild = httpUpdate.update(wifiClient, F("http://95.128.182.133/projects/iotmanager/esp32/firmware/firmware.bin"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (retBuild == HTTP_UPDATE_OK) { //если BUILD обновился успешно
|
if (retBuild == HTTP_UPDATE_OK) { //если BUILD обновился успешно
|
||||||
|
|||||||
@@ -80,11 +80,13 @@ void setup() {
|
|||||||
SerialPrint("I", "Bus", "Bus Init");
|
SerialPrint("I", "Bus", "Bus Init");
|
||||||
busInit();
|
busInit();
|
||||||
|
|
||||||
#ifdef SSDP_EN
|
#ifdef SSDP_ENABLED
|
||||||
SerialPrint("I", "SSDP", "Ssdp Init");
|
SerialPrint("I", "SSDP", "Ssdp Init");
|
||||||
SsdpInit();
|
SsdpInit();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//esp_log_level_set("esp_littlefs", ESP_LOG_NONE);
|
||||||
|
|
||||||
ts.add(
|
ts.add(
|
||||||
TEST, 1000 * 60, [&](void*) {
|
TEST, 1000 * 60, [&](void*) {
|
||||||
SerialPrint("I", "System", printMemoryStatus());
|
SerialPrint("I", "System", printMemoryStatus());
|
||||||
|
|||||||
Reference in New Issue
Block a user