Fix telemetry and some more models

This commit is contained in:
Niklas Jensen
2026-01-01 23:13:22 +01:00
committed by nikguin04
parent 19ebceb959
commit 1117666f26
7 changed files with 611 additions and 51 deletions
@@ -104,6 +104,22 @@ export interface IMUData {
temp: number;
}
export interface StaticSystemInformation {
espPlatform: string;
firmwareVersion: string;
cpuFreqMhz: number;
cpuType: string;
cpuRev: number;
cpuCores: number;
sketchSize: number;
freeSketchSpace: number;
sdkVersion: string;
arduinoVersion: string;
flashChipSize: number;
flashChipSpeed: number;
cpuResetReason: string;
}
export interface IMUCalibrateData {
success: boolean;
}
@@ -179,6 +195,11 @@ export interface HumanInputData {
s1: number;
}
export interface SystemInformation {
analyticsData: AnalyticsData | undefined;
staticSystemInformation: StaticSystemInformation | undefined;
}
export interface SubscribeNotification {
tag: number;
}
@@ -780,6 +801,272 @@ export const IMUData: MessageFns<IMUData> = {
},
};
function createBaseStaticSystemInformation(): StaticSystemInformation {
return {
espPlatform: "",
firmwareVersion: "",
cpuFreqMhz: 0,
cpuType: "",
cpuRev: 0,
cpuCores: 0,
sketchSize: 0,
freeSketchSpace: 0,
sdkVersion: "",
arduinoVersion: "",
flashChipSize: 0,
flashChipSpeed: 0,
cpuResetReason: "",
};
}
export const StaticSystemInformation: MessageFns<StaticSystemInformation> = {
encode(message: StaticSystemInformation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.espPlatform !== "") {
writer.uint32(10).string(message.espPlatform);
}
if (message.firmwareVersion !== "") {
writer.uint32(18).string(message.firmwareVersion);
}
if (message.cpuFreqMhz !== 0) {
writer.uint32(24).uint32(message.cpuFreqMhz);
}
if (message.cpuType !== "") {
writer.uint32(34).string(message.cpuType);
}
if (message.cpuRev !== 0) {
writer.uint32(40).int32(message.cpuRev);
}
if (message.cpuCores !== 0) {
writer.uint32(48).uint32(message.cpuCores);
}
if (message.sketchSize !== 0) {
writer.uint32(56).uint32(message.sketchSize);
}
if (message.freeSketchSpace !== 0) {
writer.uint32(64).uint32(message.freeSketchSpace);
}
if (message.sdkVersion !== "") {
writer.uint32(74).string(message.sdkVersion);
}
if (message.arduinoVersion !== "") {
writer.uint32(82).string(message.arduinoVersion);
}
if (message.flashChipSize !== 0) {
writer.uint32(88).uint32(message.flashChipSize);
}
if (message.flashChipSpeed !== 0) {
writer.uint32(96).uint32(message.flashChipSpeed);
}
if (message.cpuResetReason !== "") {
writer.uint32(106).string(message.cpuResetReason);
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): StaticSystemInformation {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
const end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseStaticSystemInformation();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.espPlatform = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.firmwareVersion = reader.string();
continue;
}
case 3: {
if (tag !== 24) {
break;
}
message.cpuFreqMhz = reader.uint32();
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.cpuType = reader.string();
continue;
}
case 5: {
if (tag !== 40) {
break;
}
message.cpuRev = reader.int32();
continue;
}
case 6: {
if (tag !== 48) {
break;
}
message.cpuCores = reader.uint32();
continue;
}
case 7: {
if (tag !== 56) {
break;
}
message.sketchSize = reader.uint32();
continue;
}
case 8: {
if (tag !== 64) {
break;
}
message.freeSketchSpace = reader.uint32();
continue;
}
case 9: {
if (tag !== 74) {
break;
}
message.sdkVersion = reader.string();
continue;
}
case 10: {
if (tag !== 82) {
break;
}
message.arduinoVersion = reader.string();
continue;
}
case 11: {
if (tag !== 88) {
break;
}
message.flashChipSize = reader.uint32();
continue;
}
case 12: {
if (tag !== 96) {
break;
}
message.flashChipSpeed = reader.uint32();
continue;
}
case 13: {
if (tag !== 106) {
break;
}
message.cpuResetReason = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): StaticSystemInformation {
return {
espPlatform: isSet(object.espPlatform) ? globalThis.String(object.espPlatform) : "",
firmwareVersion: isSet(object.firmwareVersion) ? globalThis.String(object.firmwareVersion) : "",
cpuFreqMhz: isSet(object.cpuFreqMhz) ? globalThis.Number(object.cpuFreqMhz) : 0,
cpuType: isSet(object.cpuType) ? globalThis.String(object.cpuType) : "",
cpuRev: isSet(object.cpuRev) ? globalThis.Number(object.cpuRev) : 0,
cpuCores: isSet(object.cpuCores) ? globalThis.Number(object.cpuCores) : 0,
sketchSize: isSet(object.sketchSize) ? globalThis.Number(object.sketchSize) : 0,
freeSketchSpace: isSet(object.freeSketchSpace) ? globalThis.Number(object.freeSketchSpace) : 0,
sdkVersion: isSet(object.sdkVersion) ? globalThis.String(object.sdkVersion) : "",
arduinoVersion: isSet(object.arduinoVersion) ? globalThis.String(object.arduinoVersion) : "",
flashChipSize: isSet(object.flashChipSize) ? globalThis.Number(object.flashChipSize) : 0,
flashChipSpeed: isSet(object.flashChipSpeed) ? globalThis.Number(object.flashChipSpeed) : 0,
cpuResetReason: isSet(object.cpuResetReason) ? globalThis.String(object.cpuResetReason) : "",
};
},
toJSON(message: StaticSystemInformation): unknown {
const obj: any = {};
if (message.espPlatform !== "") {
obj.espPlatform = message.espPlatform;
}
if (message.firmwareVersion !== "") {
obj.firmwareVersion = message.firmwareVersion;
}
if (message.cpuFreqMhz !== 0) {
obj.cpuFreqMhz = Math.round(message.cpuFreqMhz);
}
if (message.cpuType !== "") {
obj.cpuType = message.cpuType;
}
if (message.cpuRev !== 0) {
obj.cpuRev = Math.round(message.cpuRev);
}
if (message.cpuCores !== 0) {
obj.cpuCores = Math.round(message.cpuCores);
}
if (message.sketchSize !== 0) {
obj.sketchSize = Math.round(message.sketchSize);
}
if (message.freeSketchSpace !== 0) {
obj.freeSketchSpace = Math.round(message.freeSketchSpace);
}
if (message.sdkVersion !== "") {
obj.sdkVersion = message.sdkVersion;
}
if (message.arduinoVersion !== "") {
obj.arduinoVersion = message.arduinoVersion;
}
if (message.flashChipSize !== 0) {
obj.flashChipSize = Math.round(message.flashChipSize);
}
if (message.flashChipSpeed !== 0) {
obj.flashChipSpeed = Math.round(message.flashChipSpeed);
}
if (message.cpuResetReason !== "") {
obj.cpuResetReason = message.cpuResetReason;
}
return obj;
},
create<I extends Exact<DeepPartial<StaticSystemInformation>, I>>(base?: I): StaticSystemInformation {
return StaticSystemInformation.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<StaticSystemInformation>, I>>(object: I): StaticSystemInformation {
const message = createBaseStaticSystemInformation();
message.espPlatform = object.espPlatform ?? "";
message.firmwareVersion = object.firmwareVersion ?? "";
message.cpuFreqMhz = object.cpuFreqMhz ?? 0;
message.cpuType = object.cpuType ?? "";
message.cpuRev = object.cpuRev ?? 0;
message.cpuCores = object.cpuCores ?? 0;
message.sketchSize = object.sketchSize ?? 0;
message.freeSketchSpace = object.freeSketchSpace ?? 0;
message.sdkVersion = object.sdkVersion ?? "";
message.arduinoVersion = object.arduinoVersion ?? "";
message.flashChipSize = object.flashChipSize ?? 0;
message.flashChipSpeed = object.flashChipSpeed ?? 0;
message.cpuResetReason = object.cpuResetReason ?? "";
return message;
},
};
function createBaseIMUCalibrateData(): IMUCalibrateData {
return { success: false };
}
@@ -1956,6 +2243,89 @@ export const HumanInputData: MessageFns<HumanInputData> = {
},
};
function createBaseSystemInformation(): SystemInformation {
return { analyticsData: undefined, staticSystemInformation: undefined };
}
export const SystemInformation: MessageFns<SystemInformation> = {
encode(message: SystemInformation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.analyticsData !== undefined) {
AnalyticsData.encode(message.analyticsData, writer.uint32(10).fork()).join();
}
if (message.staticSystemInformation !== undefined) {
StaticSystemInformation.encode(message.staticSystemInformation, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): SystemInformation {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
const end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseSystemInformation();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.analyticsData = AnalyticsData.decode(reader, reader.uint32());
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.staticSystemInformation = StaticSystemInformation.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object: any): SystemInformation {
return {
analyticsData: isSet(object.analyticsData) ? AnalyticsData.fromJSON(object.analyticsData) : undefined,
staticSystemInformation: isSet(object.staticSystemInformation)
? StaticSystemInformation.fromJSON(object.staticSystemInformation)
: undefined,
};
},
toJSON(message: SystemInformation): unknown {
const obj: any = {};
if (message.analyticsData !== undefined) {
obj.analyticsData = AnalyticsData.toJSON(message.analyticsData);
}
if (message.staticSystemInformation !== undefined) {
obj.staticSystemInformation = StaticSystemInformation.toJSON(message.staticSystemInformation);
}
return obj;
},
create<I extends Exact<DeepPartial<SystemInformation>, I>>(base?: I): SystemInformation {
return SystemInformation.fromPartial(base ?? ({} as any));
},
fromPartial<I extends Exact<DeepPartial<SystemInformation>, I>>(object: I): SystemInformation {
const message = createBaseSystemInformation();
message.analyticsData = (object.analyticsData !== undefined && object.analyticsData !== null)
? AnalyticsData.fromPartial(object.analyticsData)
: undefined;
message.staticSystemInformation =
(object.staticSystemInformation !== undefined && object.staticSystemInformation !== null)
? StaticSystemInformation.fromPartial(object.staticSystemInformation)
: undefined;
return message;
},
};
function createBaseSubscribeNotification(): SubscribeNotification {
return { tag: 0 };
}
@@ -2831,6 +3201,174 @@ export const protoMetadata: ProtoMetadata = {
"reservedRange": [],
"reservedName": [],
"visibility": 0,
}, {
"name": "StaticSystemInformation",
"field": [{
"name": "esp_platform",
"number": 1,
"label": 1,
"type": 9,
"typeName": "",
"extendee": "",
"defaultValue": "",
"oneofIndex": 0,
"jsonName": "espPlatform",
"options": undefined,
"proto3Optional": false,
}, {
"name": "firmware_version",
"number": 2,
"label": 1,
"type": 9,
"typeName": "",
"extendee": "",
"defaultValue": "",
"oneofIndex": 0,
"jsonName": "firmwareVersion",
"options": undefined,
"proto3Optional": false,
}, {
"name": "cpu_freq_mhz",
"number": 3,
"label": 1,
"type": 13,
"typeName": "",
"extendee": "",
"defaultValue": "",
"oneofIndex": 0,
"jsonName": "cpuFreqMhz",
"options": undefined,
"proto3Optional": false,
}, {
"name": "cpu_type",
"number": 4,
"label": 1,
"type": 9,
"typeName": "",
"extendee": "",
"defaultValue": "",
"oneofIndex": 0,
"jsonName": "cpuType",
"options": undefined,
"proto3Optional": false,
}, {
"name": "cpu_rev",
"number": 5,
"label": 1,
"type": 5,
"typeName": "",
"extendee": "",
"defaultValue": "",
"oneofIndex": 0,
"jsonName": "cpuRev",
"options": undefined,
"proto3Optional": false,
}, {
"name": "cpu_cores",
"number": 6,
"label": 1,
"type": 13,
"typeName": "",
"extendee": "",
"defaultValue": "",
"oneofIndex": 0,
"jsonName": "cpuCores",
"options": undefined,
"proto3Optional": false,
}, {
"name": "sketch_size",
"number": 7,
"label": 1,
"type": 13,
"typeName": "",
"extendee": "",
"defaultValue": "",
"oneofIndex": 0,
"jsonName": "sketchSize",
"options": undefined,
"proto3Optional": false,
}, {
"name": "free_sketch_space",
"number": 8,
"label": 1,
"type": 13,
"typeName": "",
"extendee": "",
"defaultValue": "",
"oneofIndex": 0,
"jsonName": "freeSketchSpace",
"options": undefined,
"proto3Optional": false,
}, {
"name": "sdk_version",
"number": 9,
"label": 1,
"type": 9,
"typeName": "",
"extendee": "",
"defaultValue": "",
"oneofIndex": 0,
"jsonName": "sdkVersion",
"options": undefined,
"proto3Optional": false,
}, {
"name": "arduino_version",
"number": 10,
"label": 1,
"type": 9,
"typeName": "",
"extendee": "",
"defaultValue": "",
"oneofIndex": 0,
"jsonName": "arduinoVersion",
"options": undefined,
"proto3Optional": false,
}, {
"name": "flash_chip_size",
"number": 11,
"label": 1,
"type": 13,
"typeName": "",
"extendee": "",
"defaultValue": "",
"oneofIndex": 0,
"jsonName": "flashChipSize",
"options": undefined,
"proto3Optional": false,
}, {
"name": "flash_chip_speed",
"number": 12,
"label": 1,
"type": 13,
"typeName": "",
"extendee": "",
"defaultValue": "",
"oneofIndex": 0,
"jsonName": "flashChipSpeed",
"options": undefined,
"proto3Optional": false,
}, {
"name": "cpu_reset_reason",
"number": 13,
"label": 1,
"type": 9,
"typeName": "",
"extendee": "",
"defaultValue": "",
"oneofIndex": 0,
"jsonName": "cpuResetReason",
"options": undefined,
"proto3Optional": false,
}],
"extension": [],
"nestedType": [],
"enumType": [],
"extensionRange": [],
"oneofDecl": [],
"options": undefined,
"reservedRange": [],
"reservedName": [],
"visibility": 0,
}, {
"name": "IMUCalibrateData",
"field": [{
@@ -3443,6 +3981,42 @@ export const protoMetadata: ProtoMetadata = {
"reservedRange": [],
"reservedName": [],
"visibility": 0,
}, {
"name": "SystemInformation",
"field": [{
"name": "analytics_data",
"number": 1,
"label": 1,
"type": 11,
"typeName": ".AnalyticsData",
"extendee": "",
"defaultValue": "",
"oneofIndex": 0,
"jsonName": "analyticsData",
"options": undefined,
"proto3Optional": false,
}, {
"name": "static_system_information",
"number": 2,
"label": 1,
"type": 11,
"typeName": ".StaticSystemInformation",
"extendee": "",
"defaultValue": "",
"oneofIndex": 0,
"jsonName": "staticSystemInformation",
"options": undefined,
"proto3Optional": false,
}],
"extension": [],
"nestedType": [],
"enumType": [],
"extensionRange": [],
"oneofDecl": [],
"options": undefined,
"reservedRange": [],
"reservedName": [],
"visibility": 0,
}, {
"name": "SubscribeNotification",
"field": [{
@@ -3734,8 +4308,8 @@ export const protoMetadata: ProtoMetadata = {
"trailingComments": "",
"leadingDetachedComments": [],
}, {
"path": [4, 21],
"span": [69, 0, 87, 1],
"path": [4, 23],
"span": [87, 0, 105, 1],
"leadingComments": " WebSocket message wrapper\n Only ONE field will be set at a time (oneof ensures this)\n",
"trailingComments": "",
"leadingDetachedComments": [],
@@ -3751,6 +4325,7 @@ export const protoMetadata: ProtoMetadata = {
".PinConfig": PinConfig,
".KnownNetworkItem": KnownNetworkItem,
".IMUData": IMUData,
".StaticSystemInformation": StaticSystemInformation,
".IMUCalibrateData": IMUCalibrateData,
".ModeData": ModeData,
".ControllerInputData": ControllerInputData,
@@ -3763,6 +4338,7 @@ export const protoMetadata: ProtoMetadata = {
".DownloadOTAData": DownloadOTAData,
".SonarData": SonarData,
".HumanInputData": HumanInputData,
".SystemInformation": SystemInformation,
".SubscribeNotification": SubscribeNotification,
".UnsubscribeNotification": UnsubscribeNotification,
".PingMsg": PingMsg,
+1 -2
View File
@@ -1,5 +1,4 @@
import { HumanInputData, ModeData, ModesEnum } from '$lib/platform_shared/websocket_message'
import type { ControllerInput } from '$lib/types/models'
import { persistentStore } from '$lib/utilities/svelte-utilities'
import { writable, type Writable } from 'svelte/store'
@@ -35,7 +34,7 @@ export const mode: Writable<ModeData> = writable(ModeData.create({ mode: ModesEn
export const walkGait: Writable<WalkGaits> = writable(WalkGaits.Trot)
export const outControllerData = writable([0, 0, 0, 0, 0, 1, 0])
export const outControllerData = writable( HumanInputData.create( {left: {x:0,y:0}, right: {x:0,y:0}, height:0, s1:0, speed:0} ) )
export const kinematicData = writable([0, 0, 0, 0, 1, 0])
+1 -2
View File
@@ -1,5 +1,4 @@
import { DownloadOTAData, RSSIData } from '$lib/platform_shared/websocket_message'
import { DownloadOTA } from '$lib/types/models'
import { writable } from 'svelte/store'
type telemetry_data_type = {
@@ -16,7 +15,7 @@ function createTelemetry() {
setRSSI: (data: RSSIData) => {
update(telemetry_data => { telemetry_data.rssi = data; return telemetry_data })
},
setDownloadOTA: (data: DownloadOTA) => {
setDownloadOTA: (data: DownloadOTAData) => {
update(telemetry_data => { telemetry_data.download_ota = data; return telemetry_data })
}
}
+1 -17
View File
@@ -1,3 +1,4 @@
import type { AnalyticsData } from "$lib/platform_shared/websocket_message";
export type vector = { x: number; y: number }
@@ -65,23 +66,6 @@ export type Rssi = {
ssid: string
}
export type StaticSystemInformation = {
esp_platform: string
firmware_version: string
cpu_freq_mhz: number
cpu_type: string
cpu_rev: number
cpu_cores: number
sketch_size: number
free_sketch_space: number
sdk_version: string
arduino_version: string
flash_chip_size: number
flash_chip_speed: number
cpu_reset_reason: string
}
export type SystemInformation = Analytics & StaticSystemInformation
export type IMU = {
x: number
+4 -4
View File
@@ -21,7 +21,7 @@
useFeatureFlags,
walkGait
} from '$lib/stores'
import { AnalyticsData, AnglesData, DownloadOTAData, ModesEnum, RSSIData, SonarData } from '$lib/platform_shared/websocket_message'
import { AnalyticsData, AnglesData, DownloadOTAData, HumanInputData, ModeData, RSSIData, SonarData } from '$lib/platform_shared/websocket_message'
import { Throttler } from '$lib/utilities'
interface Props {
@@ -39,8 +39,8 @@
addEventListeners()
input.subscribe(data => socket.sendEvent(InputData, InputData.create()))
mode.subscribe(data => socket.sendEvent(ModesD, data))
outControllerData.subscribe(data => socket.sendEvent(HumanInputData, data))
mode.subscribe(data => socket.sendEvent(ModeData, data))
walkGait.subscribe(data => socket.sendEvent(GaitData, data))
servoAnglesOut.subscribe(data => socket.sendEvent(AnglesData, data))
kinematicData.subscribe(data => socket.sendEvent(PositionData, data))
@@ -57,7 +57,7 @@
socket.onEvent('close', handleClose),
socket.onEvent('error', handleError),
socket.on(RSSIData, (data) => telemetry.setRSSI(data)),
socket.on(ModesEnum, (data) => mode.set(data)),
socket.on(ModeData, (data) => mode.set(data)),
socket.on(AnalyticsData, (data) => {analytics.addData(data)}),
socket.on(AnglesData, (data) => {servoAngles.set(data.angles)})
])
+2 -1
View File
@@ -16,11 +16,12 @@
import { VerticalSlider } from '$lib/components/input'
import { gamepadAxes, gamepadButtonsEdges, hasGamepad } from '$lib/stores/gamepad'
import { notifications } from '$lib/components/toasts/notifications'
import { HumanInputData } from '$lib/platform_shared/websocket_message'
let left: nipplejs.JoystickManager
let right: nipplejs.JoystickManager
let data = new Array(7)
let data: HumanInputData = HumanInputData.create( {left: {x:0,y:0}, right: {x:0,y:0}, height:0, s1:0, speed:0} )
$effect(() => {
if ($hasGamepad) {
@@ -7,7 +7,6 @@
import Spinner from '$lib/components/Spinner.svelte'
import { slide } from 'svelte/transition'
import { cubicOut } from 'svelte/easing'
import { type SystemInformation, type Analytics, MessageTopic } from '$lib/types/models'
import { socket } from '$lib/stores/socket'
import { api } from '$lib/api'
import { convertSeconds } from '$lib/utilities'
@@ -32,6 +31,7 @@
} from '$lib/components/icons'
import StatusItem from '$lib/components/StatusItem.svelte'
import ActionButton from './ActionButton.svelte'
import { AnalyticsData, type SystemInformation } from '$lib/platform_shared/websocket_message'
const features = useFeatureFlags()
@@ -51,10 +51,11 @@
const postSleep = async () => await api.post('api/sleep')
onMount(() => socket.on(MessageTopic.analytics, handleSystemData))
let unsub: (() => void) | undefined = undefined;
onMount(() => unsub = socket.on(AnalyticsData, handleSystemData))
onDestroy(() => { if (unsub) unsub() })
onDestroy(() => socket.off(MessageTopic.analytics, handleSystemData))
const handleSystemData = (data: Analytics) => {
const handleSystemData = (data: AnalyticsData) => {
if (systemInformation) {
systemInformation = {
...systemInformation,
@@ -159,58 +160,58 @@
<StatusItem
icon={CPU}
title="Chip"
description={`${systemInformation.cpu_type} Rev ${systemInformation.cpu_rev}`}
description={`${systemInformation.staticSystemInformation?.cpuType} Rev ${systemInformation.staticSystemInformation?.cpuRev}`}
/>
<StatusItem
icon={SDK}
title="SDK Version"
description={`ESP-IDF ${systemInformation.sdk_version} / Arduino ${systemInformation.arduino_version}`}
description={`ESP-IDF ${systemInformation.staticSystemInformation?.sdkVersion} / Arduino ${systemInformation.staticSystemInformation?.arduinoVersion}`}
/>
<StatusItem
icon={CPP}
title="Firmware Version"
description={systemInformation.firmware_version}
description={systemInformation.staticSystemInformation?.firmwareVersion}
/>
<StatusItem
icon={Speed}
title="CPU Frequency"
description={`${systemInformation.cpu_freq_mhz} MHz ${
systemInformation.cpu_cores == 2 ? 'Dual Core' : 'Single Core'
description={`${systemInformation.staticSystemInformation?.cpuFreqMhz} MHz ${
systemInformation.staticSystemInformation?.cpuCores == 2 ? 'Dual Core' : 'Single Core'
}`}
/>
<StatusItem
icon={Heap}
title="Heap (Free / Max Alloc)"
description={`${systemInformation.free_heap} / ${systemInformation.max_alloc_heap} bytes`}
description={`${systemInformation.analyticsData?.freeHeap} / ${systemInformation.analyticsData?.maxAllocHeap} bytes`}
/>
<StatusItem
icon={Pyramid}
title="PSRAM (Size / Free)"
description={`${systemInformation.psram_size} / ${systemInformation.psram_size} bytes`}
description={`${systemInformation.analyticsData!.psramSize - systemInformation.analyticsData!.freePsram} / ${systemInformation.analyticsData?.psramSize} bytes`}
/>
<StatusItem
icon={Sketch}
title="Sketch (Used / Free)"
description={`${(
(systemInformation.sketch_size / systemInformation.free_sketch_space) *
(systemInformation.staticSystemInformation!.sketchSize / systemInformation.staticSystemInformation!.freeSketchSpace) *
100
).toFixed(1)} % of
${systemInformation.free_sketch_space / 1000000} MB used (${
(systemInformation.free_sketch_space - systemInformation.sketch_size) / 1000000
${systemInformation.staticSystemInformation!.freeSketchSpace / 1000000} MB used (${
(systemInformation.staticSystemInformation!.freeSketchSpace - systemInformation.staticSystemInformation!.sketchSize) / 1000000
} MB free)`}
/>
<StatusItem
icon={Flash}
title="Flash Chip (Size / Speed)"
description={`${systemInformation.flash_chip_size / 1000000} MB / ${
systemInformation.flash_chip_speed / 1000000
description={`${systemInformation.staticSystemInformation!.flashChipSize / 1000000} MB / ${
systemInformation.staticSystemInformation!.flashChipSpeed / 1000000
} MHz`}
/>
@@ -218,10 +219,10 @@
icon={Folder}
title="File System (Used / Total)"
description={`${(
(systemInformation.fs_used / systemInformation.fs_total) *
(systemInformation.analyticsData!.fsUsed / systemInformation.analyticsData!.fsTotal) *
100
).toFixed(1)} % of ${systemInformation.fs_total / 1000000} MB used (${
(systemInformation.fs_total - systemInformation.fs_used) / 1000000
).toFixed(1)} % of ${systemInformation.analyticsData!.fsTotal / 1000000} MB used (${
(systemInformation.analyticsData!.fsTotal - systemInformation.analyticsData!.fsUsed) / 1000000
}
MB free)`}
/>
@@ -230,22 +231,22 @@
icon={Temperature}
title="Core Temperature"
description={`${
systemInformation.core_temp == 53.33 ?
systemInformation.analyticsData!.coreTemp == 53.33 ?
'NaN'
: systemInformation.core_temp.toFixed(2) + ' °C'
: systemInformation.analyticsData!.coreTemp.toFixed(2) + ' °C'
}`}
/>
<StatusItem
icon={Stopwatch}
title="Uptime"
description={convertSeconds(systemInformation.uptime)}
description={convertSeconds(systemInformation.analyticsData!.uptime)}
/>
<StatusItem
icon={Power}
title="Reset Reason"
description={systemInformation.cpu_reset_reason}
description={systemInformation.staticSystemInformation?.cpuResetReason}
/>
</div>
{/if}