esp32 version

This commit is contained in:
Dmitry Borisenko
2020-10-19 01:21:20 +03:00
parent b43fd9e389
commit cfd9d5baa0
3 changed files with 15 additions and 5 deletions

View File

@@ -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

View File

@@ -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 обновился успешно

View File

@@ -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());