Telemetry stream: GET /api/telemetry + MCP get_telemetry (#16)
CI / build + unit (push) Successful in 21s

This commit was merged in pull request #16.
This commit is contained in:
2026-09-24 23:56:11 +02:00
parent ba5e60daf0
commit 0571c7095e
11 changed files with 286 additions and 6 deletions
+34
View File
@@ -183,6 +183,40 @@ export class MeshController {
return this.mesh.messages();
}
@Get('telemetry')
@ApiOperation({
summary: 'Telemetry history (last 100)',
description:
"TELEMETRY_APP packets from any node, newest first. Device metrics (uptime/battery/voltage/channel+air utilization) and environment sensor readings where nodes have them; kind is the meshtastic.Telemetry oneof case name — deviceMetrics, environmentMetrics, airQualityMetrics, powerMetrics, localStats, healthMetrics, hostMetrics or trafficManagementStats — and data carries that variant's payload (proto uint64 fields as decimal strings). In-memory only (last 100), reset on every bridge reconnect.",
})
@ApiResponse({
status: 200,
description: 'Telemetry records newest first',
example: [
{
from: 987654321,
at: 1758000123456,
kind: 'deviceMetrics',
data: {
batteryLevel: 87,
voltage: 4.1,
channelUtilization: 12.5,
airUtilTx: 3.2,
uptimeSeconds: 86400,
},
},
{
from: 123456789,
at: 1758000000000,
kind: 'environmentMetrics',
data: { temperature: 21.5, relativeHumidity: 48 },
},
],
})
telemetry() {
return this.mesh.telemetry();
}
@Get('nodes')
@ApiOperation({
summary: 'Known mesh nodes (lean summaries)',