Add ESP32 revision information

This commit is contained in:
Theo Arends 2022-04-23 17:59:37 +02:00
parent c4f233984a
commit 5d40295fa6
3 changed files with 26 additions and 3 deletions

View File

@ -590,14 +590,14 @@ void CmndStatus(void)
",\"" D_JSON_BOOTVERSION "\":%d"
#endif
",\"" D_JSON_COREVERSION "\":\"" ARDUINO_CORE_RELEASE "\",\"" D_JSON_SDKVERSION "\":\"%s\","
"\"CpuFrequency\":%d,\"Hardware\":\"%s\""
"\"CpuFrequency\":%d,\"Hardware\":\"%s%s\""
"%s}}"),
TasmotaGlobal.version, TasmotaGlobal.image_name, GetBuildDateAndTime().c_str()
#ifdef ESP8266
, ESP.getBootVersion()
#endif
, ESP.getSdkVersion(),
ESP.getCpuFreqMHz(), GetDeviceHardware().c_str(),
ESP.getCpuFreqMHz(), GetDeviceHardware().c_str(), GetDeviceHardwareRevision().c_str(),
GetStatistics().c_str());
CmndStatusResponse(2);
}

View File

@ -95,6 +95,10 @@ String GetDeviceHardware(void) {
return F("ESP8266EX");
}
String GetDeviceHardwareRevision(void) {
return "";
}
#endif
/*********************************************************************************************\
@ -659,6 +663,7 @@ typedef struct {
if (rev3) { return F("ESP32-PICO-V3"); } // Max 240MHz, Dual core, LGA 7*7, ESP32-PICO-V3-ZERO, ESP32-PICO-V3-ZERO-DevKit
else { return F("ESP32-PICO-D4"); } // Max 240MHz, Dual core, LGA 7*7, 4MB embedded flash, ESP32-PICO-KIT
case 6: return F("ESP32-PICO-V3-02"); // Max 240MHz, Dual core, LGA 7*7, 8MB embedded flash, 2MB embedded PSRAM, ESP32-PICO-MINI-02, ESP32-PICO-DevKitM-2
case 7: return F("ESP32-D0WDR2-V3"); // Max 240MHz, Dual core, QFN 5*5, ESP32-WROOM-32E, ESP32_WROVER-E, ESP32-DevKitC?
}
#endif // CONFIG_IDF_TARGET_ESP32
return F("ESP32");
@ -767,6 +772,24 @@ typedef struct {
return F("ESP32");
}
String GetDeviceHardwareRevision(void) {
/*
// The structure represents information about the chip
typedef struct {
esp_chip_model_t model; //!< chip model, one of esp_chip_model_t
uint32_t features; //!< bit mask of CHIP_FEATURE_x feature flags
uint8_t cores; //!< number of CPU cores
uint8_t revision; //!< chip revision number
} esp_chip_info_t;
*/
esp_chip_info_t chip_info;
esp_chip_info(&chip_info);
char revision[12];
snprintf_P(revision, sizeof(revision), PSTR(" (rev. %d)"), chip_info.revision);
return revision;
}
/*
* ESP32 v1 and v2 needs some special patches to use PSRAM.
* Standard Tasmota 32 do not include those patches.

View File

@ -2420,7 +2420,7 @@ void HandleInformation(void)
#endif // USE_DISCOVERY
WSContentSend_P(PSTR("}1}2&nbsp;")); // Empty line
WSContentSend_P(PSTR("}1" D_ESP_CHIP_ID "}2%d (%s)"), ESP_getChipId(), GetDeviceHardware().c_str());
WSContentSend_P(PSTR("}1" D_ESP_CHIP_ID "}2%d (%s%s)"), ESP_getChipId(), GetDeviceHardware().c_str(), GetDeviceHardwareRevision().c_str());
#ifdef ESP8266
WSContentSend_P(PSTR("}1" D_FLASH_CHIP_ID "}20x%06X"), ESP.getFlashChipId());
#endif