diff --git a/interface/src/framework/system/UploadDownload.tsx b/interface/src/framework/system/UploadDownload.tsx index bf3e535a1..242d96cb2 100644 --- a/interface/src/framework/system/UploadDownload.tsx +++ b/interface/src/framework/system/UploadDownload.tsx @@ -2,7 +2,7 @@ import { type FC, useState } from 'react'; import { toast } from 'react-toastify'; import DownloadIcon from '@mui/icons-material/GetApp'; -import { Box, Button, Link, Typography } from '@mui/material'; +import { Box, Button, Divider, Link, Typography } from '@mui/material'; import * as SystemApi from 'api/system'; @@ -195,6 +195,8 @@ const UploadDownload: FC = () => { {LL.VERSION_ON() + ' '} {data.emsesp_version} ({data.esp_platform}) + {data.model.length > 0 &&

Gateway Hardware: {data.model}

} + {latestVersion && ( {LL.THE_LATEST()} {LL.OFFICIAL()} {LL.RELEASE_IS()} diff --git a/interface/src/types/system.ts b/interface/src/types/system.ts index beb30e6a9..8bdfdddff 100644 --- a/interface/src/types/system.ts +++ b/interface/src/types/system.ts @@ -24,6 +24,7 @@ export interface ESPSystemStatus { psram_size?: number; free_psram?: number; has_loader: boolean; + model: string; } export interface SystemStatus { diff --git a/mock-api/rest_server.ts b/mock-api/rest_server.ts index 74c8eb6b6..372811152 100644 --- a/mock-api/rest_server.ts +++ b/mock-api/rest_server.ts @@ -350,23 +350,26 @@ const GENERATE_TOKEN_ENDPOINT = REST_ENDPOINT_ROOT + 'generateToken'; const ESPsystem_status = { emsesp_version: '3.7-demo', esp_platform: 'ESP32', + max_alloc_heap: 89, cpu_type: 'ESP32-S3', cpu_rev: '0', cpu_cores: 2, - max_alloc_heap: 89, - psram_size: 0, - free_psram: 0, cpu_freq_mhz: 240, free_heap: 143, + arduino_version: 'ESP32 Arduino v2.0.14', sdk_version: 'v4.4.2', + partition: 'app0', flash_chip_size: 4096, flash_chip_speed: 40000000, - fs_used: 40, - fs_free: 24, - partition: 'app0', app_used: 1863, app_free: 121, - arduino_version: 'ESP32 Arduino v2.0.14' + fs_used: 40, + fs_free: 24, + free_mem: 100, + psram_size: 0, + free_psram: 0, + has_loader: true, + model: 'BBQKees Gateway Model E32V2 vE32V2.0P3/2024011' }; const system_status = { diff --git a/src/emsesp.cpp b/src/emsesp.cpp index c27b00416..7ae8a3cbb 100644 --- a/src/emsesp.cpp +++ b/src/emsesp.cpp @@ -1616,6 +1616,8 @@ void EMSESP::start() { if (!nvs_.begin("ems-esp", false, "nvs1")) { // try bigger nvs partition on 16M flash first nvs_.begin("ems-esp", false, "nvs"); // fallback to small nvs } + LOG_DEBUG("NVS device information: %s", system_.getBBQKeesGatewayDetails().c_str()); + #ifndef EMSESP_STANDALONE LOG_INFO("Starting EMS-ESP version %s from %s partition", EMSESP_APP_VERSION, esp_ota_get_running_partition()->label); // welcome message #else @@ -1630,6 +1632,8 @@ void EMSESP::start() { system_.system_restart(); }; + + webSettingsService.begin(); // load EMS-ESP Application settings... // do any system upgrades diff --git a/src/system.cpp b/src/system.cpp index 5238cf67d..a93c370cd 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -1750,4 +1750,18 @@ bool System::ntp_connected() { return ntp_connected_; } +String System::getBBQKeesGatewayDetails() { +#ifndef EMSESP_STANDALONE + if (!EMSESP::nvs_.isKey("mfg")) { + return ""; + } + if (EMSESP::nvs_.getString("mfg") != "BBQKees") { + return ""; + } + return "BBQKees Gateway Model " + EMSESP::nvs_.getString("model") + " v" + EMSESP::nvs_.getString("hwrevision") + "/" + EMSESP::nvs_.getString("batch"); +#else + return ""; +#endif +} + } // namespace emsesp diff --git a/src/version.h b/src/version.h index dbe4622bc..bfd5521a5 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define EMSESP_APP_VERSION "3.7.0-dev.24" +#define EMSESP_APP_VERSION "3.7.0-dev.25" diff --git a/src/web/WebStatusService.cpp b/src/web/WebStatusService.cpp index 7757b1ecc..119ec7291 100644 --- a/src/web/WebStatusService.cpp +++ b/src/web/WebStatusService.cpp @@ -136,6 +136,9 @@ void WebStatusService::ESPsystemStatus(AsyncWebServerRequest * request) { root["has_loader"] = (buffer != 0xFFFFFFFFFFFFFFFF && running->size != partition->size); } } + + root["model"] = EMSESP::system_.getBBQKeesGatewayDetails(); + #endif response->setLength();