From 5b1b4ad97f9df38c74ef8240f0a2d678b7e8840f Mon Sep 17 00:00:00 2001 From: Anton Roslund Date: Wed, 6 Aug 2025 22:34:49 +0200 Subject: [PATCH] Update firmware versions stats --- content/sv/status/index.md | 2 +- static/js/status/firmware-versions.js | 19 ++++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/content/sv/status/index.md b/content/sv/status/index.md index 0212ecb..5d8d78a 100644 --- a/content/sv/status/index.md +++ b/content/sv/status/index.md @@ -74,7 +74,7 @@ För mer info se vår [dokumentation]({{}}#position-precision). ## Firmware versioner -Antalet enheter av firmware version som synts i meshet de senaste 30 dagarna. Information om firmware information skickas inte över meshet. Men vi kan se om en enhet kör en gammal firmware version genom att kolla efter ["ok_to_mqtt" bitten](https://github.com/meshtastic/firmware/pull/4643) som infördes i [2.5.0.9ac0e26](https://github.com/meshtastic/firmware/releases/tag/v2.5.0.9ac0e26). +Antalet enheter av firmware version som synts i meshet de senaste 30 dagarna. Information om firmware information skickas inte över meshet. Men det går att härleda till viss del utifrån vilken information de paket som skickas innehåller.
diff --git a/static/js/status/firmware-versions.js b/static/js/status/firmware-versions.js index db6f611..ab70baa 100644 --- a/static/js/status/firmware-versions.js +++ b/static/js/status/firmware-versions.js @@ -10,21 +10,18 @@ async function firmwareVersionGraph() { try { await fetchNodes(); - - const countsByVersion = {}; - // Filter out nodes without firmware_version const nodesWithVersion = nodes.filter(node => node.firmware_version != null); - // Count how many nodes have each firmware version + const countsByVersion = {}; + const validVersions = ['<2.5.0', '>2.5.0', '>2.6.8']; + for (const node of nodesWithVersion) { const version = node.firmware_version; - if(version != '2.4.3 or older') { - countsByVersion['2.5.0 or newer'] = (countsByVersion['2.5.0 or newer'] || 0) + 1; - } - else { - countsByVersion[version] = (countsByVersion[version] || 0) + 1; - } + // Default to '>2.5.0' for other version. + // This is mainly the nodes that report their firmware version using MQTT map_report + const bucket = validVersions.includes(version) ? version : '>2.5.0'; + countsByVersion[bucket] = (countsByVersion[bucket] || 0) + 1; } // Convert to array of { version, count } @@ -49,7 +46,7 @@ async function firmwareVersionGraph() { datasets: [{ label: 'Firmware Version', data: counts, - backgroundColor: ['#7EB26D', '#BF1B00'] + backgroundColor: ['#7EB26D', '#7EB26D', '#BF1B00'] }] }, options: {