Add ESP32 partition info to GUI

This commit is contained in:
Theo Arends 2022-05-14 17:41:52 +02:00
parent da0a2280b5
commit 5f53f36563
28 changed files with 96 additions and 0 deletions

View File

@ -140,6 +140,7 @@
#define D_PASSWORD "Wagwoord"
#define D_PH "pH"
#define D_MQ "MQ"
#define D_PARTITION "Partition" // As in flash and firmware partition
#define D_PORT "Poort"
#define D_POWER_FACTOR "Krag faktor"
#define D_POWERUSAGE "Krag"
@ -183,6 +184,7 @@
#define D_UPGRADE "opgradeer"
#define D_UPLOAD "Laai op"
#define D_UPTIME "Uptyd"
#define D_USED "used"
#define D_USER "Gebruiker"
#define D_UTC_TIME "UTC"
#define D_UV_INDEX "UV Indeks"

View File

@ -140,6 +140,7 @@
#define D_PASSWORD "Парола"
#define D_PH "pH"
#define D_MQ "MQ"
#define D_PARTITION "Partition" // As in flash and firmware partition
#define D_PORT "Порт"
#define D_POWER_FACTOR "Фактор на мощността"
#define D_POWERUSAGE "Мощност"
@ -183,6 +184,7 @@
#define D_UPGRADE "Обновяване"
#define D_UPLOAD "Качването е"
#define D_UPTIME "Време на работа"
#define D_USED "used"
#define D_USER "Потребител"
#define D_UTC_TIME "UTC"
#define D_UV_INDEX "Индекс на UV"

View File

@ -140,6 +140,7 @@
#define D_PASSWORD "Heslo"
#define D_PH "pH"
#define D_MQ "MQ"
#define D_PARTITION "Partition" // As in flash and firmware partition
#define D_PORT "Port"
#define D_POWER_FACTOR "Účiník"
#define D_POWERUSAGE "Příkon"
@ -183,6 +184,7 @@
#define D_UPGRADE "aktualizace"
#define D_UPLOAD "Nahrání..."
#define D_UPTIME "Uptime"
#define D_USED "used"
#define D_USER "Uživatel"
#define D_UTC_TIME "UTC"
#define D_UV_INDEX "UV Index"

View File

@ -140,6 +140,7 @@
#define D_PASSWORD "Passwort"
#define D_PH "pH"
#define D_MQ "MQ"
#define D_PARTITION "Partition" // As in flash and firmware partition
#define D_PORT "Port"
#define D_POWER_FACTOR "Leistungsfaktor"
#define D_POWERUSAGE "Leistung"
@ -183,6 +184,7 @@
#define D_UPGRADE "update"
#define D_UPLOAD "Upload"
#define D_UPTIME "Laufzeit"
#define D_USED "used"
#define D_USER "Benutzer"
#define D_UTC_TIME "UTC"
#define D_UV_INDEX "UV-Index"

View File

@ -140,6 +140,7 @@
#define D_PASSWORD "Κωδικός"
#define D_PH "pH"
#define D_MQ "MQ"
#define D_PARTITION "Partition" // As in flash and firmware partition
#define D_PORT "Θύρα"
#define D_POWER_FACTOR "Συντελεστής Ισχύος"
#define D_POWERUSAGE "Ισχύς"
@ -183,6 +184,7 @@
#define D_UPGRADE "αναβάθμιση"
#define D_UPLOAD "Ανέβασμα"
#define D_UPTIME "Χρόνος λειτουργίας"
#define D_USED "used"
#define D_USER "Χρήστης"
#define D_UTC_TIME "UTC"
#define D_UV_INDEX "Δείκτης UV"

View File

@ -140,6 +140,7 @@
#define D_PASSWORD "Password"
#define D_PH "pH"
#define D_MQ "MQ"
#define D_PARTITION "Partition" // As in flash and firmware partition
#define D_PORT "Port"
#define D_POWER_FACTOR "Power Factor"
#define D_POWERUSAGE "Power"
@ -183,6 +184,7 @@
#define D_UPGRADE "upgrade"
#define D_UPLOAD "Upload"
#define D_UPTIME "Uptime"
#define D_USED "used"
#define D_USER "User"
#define D_UTC_TIME "UTC"
#define D_UV_INDEX "UV Index"

View File

@ -140,6 +140,7 @@
#define D_PASSWORD "Clave"
#define D_PH "pH"
#define D_MQ "MQ"
#define D_PARTITION "Partition" // As in flash and firmware partition
#define D_PORT "Puerto"
#define D_POWER_FACTOR "Factor de Potencia"
#define D_POWERUSAGE "Potencia"
@ -183,6 +184,7 @@
#define D_UPGRADE "Actualización"
#define D_UPLOAD "Carga"
#define D_UPTIME "Tiempo Encendido"
#define D_USED "used"
#define D_USER "Usuario"
#define D_UTC_TIME "UTC"
#define D_UV_INDEX "Índice UV"

View File

@ -140,6 +140,7 @@
#define D_PASSWORD "Mot de passe"
#define D_PH "pH"
#define D_MQ "MQ"
#define D_PARTITION "Partition" // As in flash and firmware partition
#define D_PORT "Port"
#define D_POWER_FACTOR "Fact de puiss"
#define D_POWERUSAGE "Puissance"
@ -183,6 +184,7 @@
#define D_UPGRADE "la mise à jour" // "Lancer la mise à jour"
#define D_UPLOAD "Upload" // Not better in french
#define D_UPTIME "Durée d'activité"
#define D_USED "used"
#define D_USER "Utilisateur"
#define D_UTC_TIME "UTC"
#define D_UV_INDEX "Indice UV"

View File

@ -140,6 +140,7 @@
#define D_PASSWORD "Wachtwurd"
#define D_PH "pH"
#define D_MQ "MQ"
#define D_PARTITION "Partition" // As in flash and firmware partition
#define D_PORT "Poort"
#define D_POWER_FACTOR "Krêftfaktor"
#define D_POWERUSAGE "Krêft"
@ -183,6 +184,7 @@
#define D_UPGRADE "upgrade"
#define D_UPLOAD "Stjoere"
#define D_UPTIME "Betjenstiid"
#define D_USED "used"
#define D_USER "Brûker"
#define D_UTC_TIME "UTC"
#define D_UV_INDEX "UV-index"

View File

@ -140,6 +140,7 @@
#define D_PASSWORD "סיסמא"
#define D_PH "pH"
#define D_MQ "MQ"
#define D_PARTITION "Partition" // As in flash and firmware partition
#define D_PORT "פורט"
#define D_POWER_FACTOR "גורם כוח"
#define D_POWERUSAGE "כוח"
@ -183,6 +184,7 @@
#define D_UPGRADE "שדרוג"
#define D_UPLOAD "העלאה"
#define D_UPTIME "זמן עליה"
#define D_USED "used"
#define D_USER "משתמש"
#define D_UTC_TIME "UTC"
#define D_UV_INDEX "UV אינדקס"

View File

@ -140,6 +140,7 @@
#define D_PASSWORD "Jelszó"
#define D_PH "pH"
#define D_MQ "MQ"
#define D_PARTITION "Partition" // As in flash and firmware partition
#define D_PORT "Port"
#define D_POWER_FACTOR "Teljesítménytényező"
#define D_POWERUSAGE "Energiafelhasználás"
@ -183,6 +184,7 @@
#define D_UPGRADE "Frissítés"
#define D_UPLOAD "Feltöltés"
#define D_UPTIME "Üzemidő"
#define D_USED "used"
#define D_USER "Felhasználó"
#define D_UTC_TIME "UTC"
#define D_UV_INDEX "UV index"

View File

@ -140,6 +140,7 @@
#define D_PASSWORD "Password"
#define D_PH "pH"
#define D_MQ "MQ"
#define D_PARTITION "Partition" // As in flash and firmware partition
#define D_PORT "Porta"
#define D_POWER_FACTOR "Fattore di potenza"
#define D_POWERUSAGE "Potenza"
@ -183,6 +184,7 @@
#define D_UPGRADE "aggiornamento"
#define D_UPLOAD "Caricamento"
#define D_UPTIME "Tempo accensione"
#define D_USED "used"
#define D_USER "Utente"
#define D_UTC_TIME "UTC"
#define D_UV_INDEX "Indice UV"

View File

@ -140,6 +140,7 @@
#define D_PASSWORD "비밀번호"
#define D_PH "pH"
#define D_MQ "MQ"
#define D_PARTITION "Partition" // As in flash and firmware partition
#define D_PORT "포트"
#define D_POWER_FACTOR "Power Factor"
#define D_POWERUSAGE "전원"
@ -183,6 +184,7 @@
#define D_UPGRADE "업그레이드"
#define D_UPLOAD "업로드"
#define D_UPTIME "가동시간"
#define D_USED "used"
#define D_USER "User"
#define D_UTC_TIME "UTC"
#define D_UV_INDEX "UV 색인"

View File

@ -140,6 +140,7 @@
#define D_PASSWORD "Wachtwoord"
#define D_PH "pH"
#define D_MQ "MQ"
#define D_PARTITION "Partition" // As in flash and firmware partition
#define D_PORT "Poort"
#define D_POWER_FACTOR "Arbeidsfactor"
#define D_POWERUSAGE "Vermogen"
@ -183,6 +184,7 @@
#define D_UPGRADE "opwaarderen"
#define D_UPLOAD "Verzenden"
#define D_UPTIME "Bedrijfstijd"
#define D_USED "used"
#define D_USER "Gebruiker"
#define D_UTC_TIME "UTC"
#define D_UV_INDEX "UV-index"

View File

@ -140,6 +140,7 @@
#define D_PASSWORD "Hasło"
#define D_PH "pH"
#define D_MQ "MQ"
#define D_PARTITION "Partition" // As in flash and firmware partition
#define D_PORT "Port"
#define D_POWER_FACTOR "Cosinus fi"
#define D_POWERUSAGE "Moc"
@ -183,6 +184,7 @@
#define D_UPGRADE "aktualizacji"
#define D_UPLOAD "Wgraj"
#define D_UPTIME "Czas pracy"
#define D_USED "used"
#define D_USER "Użytkownik"
#define D_UTC_TIME "UTC"
#define D_UV_INDEX "Indeks UV"

View File

@ -140,6 +140,7 @@
#define D_PASSWORD "Senha"
#define D_PH "pH"
#define D_MQ "MQ"
#define D_PARTITION "Partition" // As in flash and firmware partition
#define D_PORT "Porta"
#define D_POWER_FACTOR "Fator de potência"
#define D_POWERUSAGE "Potência"
@ -183,6 +184,7 @@
#define D_UPGRADE "atualização"
#define D_UPLOAD "Enviar"
#define D_UPTIME "Tempo de atividade"
#define D_USED "used"
#define D_USER "Usuário"
#define D_UTC_TIME "UTC"
#define D_UV_INDEX "Índice UV"

View File

@ -140,6 +140,7 @@
#define D_PASSWORD "Palavra Chave"
#define D_PH "pH"
#define D_MQ "MQ"
#define D_PARTITION "Partition" // As in flash and firmware partition
#define D_PORT "Porta"
#define D_POWER_FACTOR "Factor de Potência"
#define D_POWERUSAGE "Potência"
@ -183,6 +184,7 @@
#define D_UPGRADE "Atualizar"
#define D_UPLOAD "Enviar"
#define D_UPTIME "Tempo de Atividade"
#define D_USED "used"
#define D_USER "Utilizador"
#define D_UTC_TIME "UTC"
#define D_UV_INDEX "Indíce UV"

View File

@ -140,6 +140,7 @@
#define D_PASSWORD "Parolă"
#define D_PH "pH"
#define D_MQ "MQ"
#define D_PARTITION "Partition" // As in flash and firmware partition
#define D_PORT "Port"
#define D_POWER_FACTOR "Factor de Putere"
#define D_POWERUSAGE "Putere"
@ -183,6 +184,7 @@
#define D_UPGRADE "actualizare"
#define D_UPLOAD "Încărcăre"
#define D_UPTIME "Folosință"
#define D_USED "used"
#define D_USER "Utilizator"
#define D_UTC_TIME "UTC"
#define D_UV_INDEX "Index UV"

View File

@ -140,6 +140,7 @@
#define D_PASSWORD "Пароль"
#define D_PH "pH"
#define D_MQ "MQ"
#define D_PARTITION "Partition" // As in flash and firmware partition
#define D_PORT "Порт"
#define D_POWER_FACTOR "Коэффициент мощности"
#define D_POWERUSAGE "Мощность"
@ -183,6 +184,7 @@
#define D_UPGRADE "обновление"
#define D_UPLOAD "Загрузить"
#define D_UPTIME "Uptime"
#define D_USED "used"
#define D_USER "Пользователь"
#define D_UTC_TIME "UTC"
#define D_UV_INDEX "UV Index"

View File

@ -140,6 +140,7 @@
#define D_PASSWORD "Heslo"
#define D_PH "pH"
#define D_MQ "MQ"
#define D_PARTITION "Partition" // As in flash and firmware partition
#define D_PORT "Port"
#define D_POWER_FACTOR "Účinník"
#define D_POWERUSAGE "Príkon"
@ -183,6 +184,7 @@
#define D_UPGRADE "aktualizáciu"
#define D_UPLOAD "Nahrávanie..."
#define D_UPTIME "Uptime"
#define D_USED "used"
#define D_USER "Používateľ"
#define D_UTC_TIME "UTC"
#define D_UV_INDEX "UV Index"

View File

@ -140,6 +140,7 @@
#define D_PASSWORD "Lösenord"
#define D_PH "pH"
#define D_MQ "MQ"
#define D_PARTITION "Partition" // As in flash and firmware partition
#define D_PORT "Port"
#define D_POWER_FACTOR "Spänningsfaktor"
#define D_POWERUSAGE "Spänning"
@ -183,6 +184,7 @@
#define D_UPGRADE "uppgradera"
#define D_UPLOAD "Ladda upp"
#define D_UPTIME "Upptid"
#define D_USED "used"
#define D_USER "Användare"
#define D_UTC_TIME "UTC"
#define D_UV_INDEX "UV Index"

View File

@ -140,6 +140,7 @@
#define D_PASSWORD "Şifre"
#define D_PH "pH"
#define D_MQ "MQ"
#define D_PARTITION "Partition" // As in flash and firmware partition
#define D_PORT "Port"
#define D_POWER_FACTOR "Güç Faktörü"
#define D_POWERUSAGE "Güç"
@ -183,6 +184,7 @@
#define D_UPGRADE "yükseltme"
#define D_UPLOAD "Yükleme"
#define D_UPTIME "Açık Kalma Süresi"
#define D_USED "used"
#define D_USER "Kullanıcı"
#define D_UTC_TIME "UTC"
#define D_UV_INDEX "UV Indeksi"

View File

@ -140,6 +140,7 @@
#define D_PASSWORD "Гасло"
#define D_PH "pH"
#define D_MQ "MQ"
#define D_PARTITION "Partition" // As in flash and firmware partition
#define D_PORT "Порт"
#define D_POWER_FACTOR "Коефіцієнт потужності"
#define D_POWERUSAGE "Потужність"
@ -183,6 +184,7 @@
#define D_UPGRADE "оновлення"
#define D_UPLOAD "Завантажити"
#define D_UPTIME "Час роботи"
#define D_USED "used"
#define D_USER "Користувач"
#define D_UTC_TIME "UTC"
#define D_UV_INDEX "Індекс УФ"

View File

@ -140,6 +140,7 @@
#define D_PASSWORD "Mật khẩu"
#define D_PH "pH"
#define D_MQ "MQ"
#define D_PARTITION "Partition" // As in flash and firmware partition
#define D_PORT "Cổng"
#define D_POWER_FACTOR "Hệ số công suất"
#define D_POWERUSAGE "Công suất"
@ -183,6 +184,7 @@
#define D_UPGRADE "nâng cấp"
#define D_UPLOAD "Tải lên"
#define D_UPTIME "Thời gian chạy"
#define D_USED "used"
#define D_USER "Người dùng"
#define D_UTC_TIME "UTC"
#define D_UV_INDEX "UV Index"

View File

@ -140,6 +140,7 @@
#define D_PASSWORD "密码"
#define D_PH "pH"
#define D_MQ "MQ"
#define D_PARTITION "Partition" // As in flash and firmware partition
#define D_PORT "端口"
#define D_POWER_FACTOR "功率因数"
#define D_POWERUSAGE "功率"
@ -183,6 +184,7 @@
#define D_UPGRADE "升级"
#define D_UPLOAD "上传"
#define D_UPTIME "运行时间"
#define D_USED "used"
#define D_USER "用户名"
#define D_UTC_TIME "UTC"
#define D_UV_INDEX "紫外线指数"

View File

@ -140,6 +140,7 @@
#define D_PASSWORD "密碼"
#define D_PH "pH"
#define D_MQ "MQ"
#define D_PARTITION "Partition" // As in flash and firmware partition
#define D_PORT "通訊埠"
#define D_POWER_FACTOR "功率因數"
#define D_POWERUSAGE "用電量"
@ -183,6 +184,7 @@
#define D_UPGRADE "升級"
#define D_UPLOAD "上傳"
#define D_UPTIME "啟動時間"
#define D_USED "used"
#define D_USER "使用者名稱"
#define D_UTC_TIME "世界協調時間(UTC)"
#define D_UV_INDEX "紫外線指數"

View File

@ -319,6 +319,34 @@ extern "C" {
#include "rom/spi_flash.h"
#endif
/*
void EspDumpPartitionTable(void) {
esp_partition_iterator_t it = esp_partition_find(ESP_PARTITION_TYPE_ANY, ESP_PARTITION_SUBTYPE_ANY, NULL);
uint32_t count = 0;
for (; it != NULL; it = esp_partition_next(it)) {
++count;
const esp_partition_t *partition = esp_partition_get(it);
AddLog(LOG_LEVEL_DEBUG, PSTR("Partition #%d, name %s, type %d, subtype %d, size %d"), count, partition->label, partition->type, partition->subtype, partition->size);
}
esp_partition_iterator_release(it);
}
*/
uint32_t EspProgramSize(const char *label) {
const esp_partition_t *part = esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_ANY, label);
if (!part) {
return 0;
}
const esp_partition_pos_t part_pos = {
.offset = part->address,
.size = part->size,
};
esp_image_metadata_t data;
data.start_addr = part_pos.offset;
esp_image_verify(ESP_IMAGE_VERIFY, &part_pos, &data);
return data.image_len;
}
bool EspSingleOtaPartition(void) {
return (1 == esp_ota_get_app_partition_count());
}

View File

@ -2468,6 +2468,22 @@ void HandleInformation(void)
WSContentSend_P(PSTR("}1" D_PSR_MAX_MEMORY "}2%d kB"), ESP.getPsramSize() / 1024);
WSContentSend_P(PSTR("}1" D_PSR_FREE_MEMORY "}2%d kB"), ESP.getFreePsram() / 1024);
}
WSContentSend_P(PSTR("}1}2 ")); // Empty line
esp_partition_iterator_t it = esp_partition_find(ESP_PARTITION_TYPE_ANY, ESP_PARTITION_SUBTYPE_ANY, NULL);
for (; it != NULL; it = esp_partition_next(it)) {
const esp_partition_t *part = esp_partition_get(it);
// AddLog(LOG_LEVEL_DEBUG, PSTR("Partition type %d, subtype %d, name %s, size %d"), part->type, part->subtype, part->label, part->size);
uint32_t part_size = part->size / 1024;
if (0 == part->type) { // app
uint32_t prog_size = EspProgramSize(part->label);
uint32_t part_used = ((prog_size / 1024) * 100) / part_size;
WSContentSend_PD(PSTR("}1" D_PARTITION " %s}2%d kB (" D_USED " %d%%)"), part->label, part_size, part_used);
}
if ((1 == part->type) && (130 == part->subtype)) { // data and fs
WSContentSend_PD(PSTR("}1" D_PARTITION " fs}2%d kB"), part_size);
}
}
esp_partition_iterator_release(it);
#else // ESP32
WSContentSend_PD(PSTR("}1" D_FREE_MEMORY "}2%1_f kB"), &freemem);
#endif // ESP32