Show bbqkees model - #1815

This commit is contained in:
proddy
2024-07-10 12:53:18 +02:00
parent 6f0062be5c
commit 4f40a3d990
7 changed files with 36 additions and 9 deletions

View File

@@ -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 = () => {
<Box p={2} border="2px solid grey" borderRadius={2}>
{LL.VERSION_ON() + ' '}
<b>{data.emsesp_version}</b>&nbsp;({data.esp_platform})
{data.model.length > 0 && <p>Gateway Hardware:&nbsp;{data.model}</p>}
<Divider />
{latestVersion && (
<Box mt={2}>
{LL.THE_LATEST()}&nbsp;{LL.OFFICIAL()}&nbsp;{LL.RELEASE_IS()}

View File

@@ -24,6 +24,7 @@ export interface ESPSystemStatus {
psram_size?: number;
free_psram?: number;
has_loader: boolean;
model: string;
}
export interface SystemStatus {

View File

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

View File

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

View File

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

View File

@@ -1 +1 @@
#define EMSESP_APP_VERSION "3.7.0-dev.24"
#define EMSESP_APP_VERSION "3.7.0-dev.25"

View File

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