mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-10 18:24:27 +05:00
feat: added board info on portal
This commit is contained in:
@@ -512,6 +512,34 @@ protected:
|
||||
doc["system"]["maxFreeBlockHeap"] = getMaxFreeBlockHeap();
|
||||
doc["system"]["minMaxFreeBlockHeap"] = getMaxFreeBlockHeap(true);
|
||||
doc["system"]["resetReason"] = getResetReason();
|
||||
|
||||
#ifdef ARDUINO_ARCH_ESP8266
|
||||
doc["system"]["chipModel"] = esp_is_8285() ? "ESP8285" : "ESP8266";
|
||||
doc["system"]["chipRevision"] = 0;
|
||||
doc["system"]["chipCores"] = 1;
|
||||
doc["system"]["cpuFreq"] = ESP.getCpuFreqMHz();
|
||||
doc["system"]["coreVersion"] = ESP.getCoreVersion();
|
||||
doc["system"]["flashSize"] = ESP.getFlashChipSize();
|
||||
doc["system"]["flashRealSize"] = ESP.getFlashChipRealSize();
|
||||
#elif ARDUINO_ARCH_ESP32
|
||||
doc["system"]["chipModel"] = ESP.getChipModel();
|
||||
doc["system"]["chipRevision"] = ESP.getChipRevision();
|
||||
doc["system"]["chipCores"] = ESP.getChipCores();
|
||||
doc["system"]["cpuFreq"] = ESP.getCpuFreqMHz();
|
||||
doc["system"]["coreVersion"] = ESP.getSdkVersion();
|
||||
doc["system"]["flashSize"] = ESP.getFlashChipSize();
|
||||
doc["system"]["flashRealSize"] = doc["system"]["flashSize"];
|
||||
#else
|
||||
doc["system"]["chipModel"] = 0;
|
||||
doc["system"]["chipRevision"] = 0;
|
||||
doc["system"]["chipCores"] = 0;
|
||||
doc["system"]["cpuFreq"] = 0;
|
||||
doc["system"]["coreVersion"] = 0;
|
||||
doc["system"]["flashSize"] = 0;
|
||||
doc["system"]["flashRealSize"] = 0;
|
||||
#endif
|
||||
|
||||
|
||||
doc.shrinkToFit();
|
||||
|
||||
this->bufferedWebServer->send(200, "application/json", doc);
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">Version:</th>
|
||||
<td><b id="version"></b></td>
|
||||
<td><b id="version"></b>, core/sdk: <b id="core-version"></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Build date:</th>
|
||||
@@ -101,6 +101,10 @@
|
||||
<th scope="row">Free memory:</th>
|
||||
<td><b id="free-heap"></b> of <b id="total-heap"></b> bytes (min: <b id="min-free-heap"></b> bytes)<br />max free block: <b id="max-free-block-heap"></b> bytes (min: <b id="min-max-free-block-heap"></b> bytes)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Board:</th>
|
||||
<td>Chip <b id="chip-model"></b> (rev. <span id="chip-revision"></span>)<br />Cores: <b id="chip-cores"></b>, frequency: <b id="cpu-freq"></b> mHz<br />Flash size: <b id="flash-size"></b> MB (real: <b id="flash-real-size"></b> MB)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Last reset reason:</th>
|
||||
<td><b id="reset-reason"></b></td>
|
||||
@@ -164,6 +168,15 @@
|
||||
setValue('#max-free-block-heap', result.system.maxFreeBlockHeap);
|
||||
setValue('#min-max-free-block-heap', result.system.minMaxFreeBlockHeap);
|
||||
setValue('#reset-reason', result.system.resetReason);
|
||||
|
||||
setValue('#chip-model', result.system.chipModel);
|
||||
setValue('#chip-revision', result.system.chipRevision);
|
||||
setValue('#chip-cores', result.system.chipCores);
|
||||
setValue('#cpu-freq', result.system.cpuFreq);
|
||||
setValue('#core-version', result.system.coreVersion);
|
||||
setValue('#flash-size', result.system.flashSize / 1024 / 1024);
|
||||
setValue('#flash-real-size', result.system.flashRealSize / 1024 / 1024);
|
||||
|
||||
setBusy('#system-busy', '#system-table', false);
|
||||
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user