Skip to content

Commit 26e8cf8

Browse files
fhirschmannclaude
andcommitted
feat: WiFi signal-strength indicator in the navbar
Show the WiFi signal strength (RSSI as a quality percentage, color-coded green/cyan/magenta) next to the battery indicator in the navbar. Uses the rssi value the device already reports in the websocket pong, so it updates roughly every few seconds. Frontend-only. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent ca7556d commit 26e8cf8

2 files changed

Lines changed: 41 additions & 0 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ neon logo that doubles as the SVG favicon ([`8d9725c`](../../commit/8d9725c)):
6969
| Equalizer profiles: dropdown presets (Flat / Music / Audiobook-Speech / Deep voices / Custom) on top of the 3-band tone control; speech presets cut bass and lift mids/highs so deep narrator voices stay intelligible, persisted in NVS. Profiles can also be assigned per file or directory (right-click in the file browser) — e.g. set the speech profile for all Bibi Blocksberg episodes at once; the RFID tab shows the active profile for the highlighted file (or "No EQ set"). The active profile can be cycled with the bindable command **154** (button/RFID modifier) and set/reported via the MQTT topic `equalizer` (`flat`/`music`/`speech`/`voiceBoost`) | [`300b9dd`](../../commit/300b9dd) |
7070
| Blinking "OK" indicator next to the battery replaces the generic "action successful" toast | [`0870ccc`](../../commit/0870ccc) |
7171
| Blinking "connection lost" icon in the navbar replaces the connection-lost toast | [`c45402b`](../../commit/c45402b) |
72+
| WiFi signal-strength indicator in the navbar (RSSI %, color-coded), next to the battery | [`e4ac7e7`](../../commit/e4ac7e7) |
7273
| Play/pause button in the RFID tab plays the highlighted file/folder (and pauses running playback) | [`8d3d196`](../../commit/8d3d196) |
7374
| Cyberpunk footer below the interface (neon "LEO INDUSTRIES // DIVISION: AUDIO" branding) | [`c21f8bf`](../../commit/c21f8bf) |
7475
| SD card cleanup: removes macOS metadata (`.DS_Store`, `._*`, Spotlight/Trashes) with one click | [`5f38a51`](../../commit/5f38a51) |

‎html/management.html‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,28 @@
229229
text-shadow: 0 0 8px rgba(10, 255, 157, .5);
230230
}
231231

232+
#wifiIndicator {
233+
margin-right: 12px;
234+
font-family: "Share Tech Mono", monospace;
235+
font-size: .9rem;
236+
color: var(--cp-cyan);
237+
text-shadow: 0 0 8px rgba(0, 240, 255, .5);
238+
}
239+
240+
#wifiIndicator #wifiLevel {
241+
margin-left: 3px;
242+
}
243+
244+
#wifiIndicator.wifi-good {
245+
color: var(--cp-green);
246+
text-shadow: 0 0 8px rgba(10, 255, 157, .5);
247+
}
248+
249+
#wifiIndicator.wifi-weak {
250+
color: var(--cp-magenta);
251+
text-shadow: 0 0 8px rgba(255, 42, 109, .6);
252+
}
253+
232254
#batteryIndicator.battery-low {
233255
color: var(--cp-magenta);
234256
text-shadow: 0 0 8px rgba(255, 42, 109, .6);
@@ -1197,6 +1219,9 @@
11971219
<div class="collapse navbar-collapse justify-content-end">
11981220
<span class="navbar-text" id="connLost" data-i18n="[title]toast.conlost"><i class="fas fa-link-slash"></i></span>
11991221
<span class="navbar-text" id="actionOk" aria-hidden="true"><i class="fas fa-check"></i> OK</span>
1222+
<span class="navbar-text" id="wifiIndicator" data-visible="false" data-i18n="[title]nav.wifi">
1223+
<i class="fas fa-wifi" id="wifiIcon"></i><span id="wifiLevel"></span>
1224+
</span>
12001225
<span class="navbar-text" id="batteryIndicator" data-visible="false">
12011226
<i class="fas fa-battery-three-quarters" id="batteryIcon"></i><span id="batteryLevel"></span>
12021227
</span>
@@ -3605,6 +3630,9 @@ <h5 class="modal-title" data-i18n="tools.nvs.erase.title"></h5>
36053630
if ("battery" in socketMsg) {
36063631
updateBatteryIndicator(socketMsg.battery);
36073632
}
3633+
if ("rssi" in socketMsg) {
3634+
updateWifiIndicator(socketMsg.rssi);
3635+
}
36083636
if ("volume" in socketMsg) {
36093637
volumeSlider.setValue(parseInt(socketMsg.volume));
36103638
}
@@ -4881,6 +4909,18 @@ <h5 class="modal-title" data-i18n="tools.nvs.erase.title"></h5>
48814909
}
48824910
}
48834911

4912+
// Update the navbar WiFi indicator from the RSSI (dBm) reported by the device.
4913+
function updateWifiIndicator(rssi) {
4914+
const indicator = document.getElementById('wifiIndicator');
4915+
if (!indicator || rssi == null) return;
4916+
// same quality mapping as the firmware WiFi scan (0..100 %)
4917+
let quality = rssi <= -100 ? 0 : rssi >= -50 ? 100 : 2 * (rssi + 100);
4918+
document.getElementById('wifiLevel').textContent = quality + '%';
4919+
indicator.title = rssi + ' dBm';
4920+
indicator.classList.toggle('wifi-good', quality >= 60);
4921+
indicator.classList.toggle('wifi-weak', quality < 30);
4922+
indicator.setAttribute('data-visible', true);
4923+
}
48844924
var batteryLowWarned = false;
48854925
function updateBatteryIndicator(battery) {
48864926
const indicator = document.getElementById('batteryIndicator');

0 commit comments

Comments
 (0)