# 📗 Heartbeat

**URL:** <https://forum.espuino.de/t/heartbeat/4583>\
**Category:** Anleitungen\
**Created:** [10. Juli 2026 um 19:09 UTC](https://forum.espuino.de/t/heartbeat/4583 "2026-07-10T19:09:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![biologist](https://forum.espuino.de/user_avatar/forum.espuino.de/biologist/32/66_2.png) [@biologist](https://forum.espuino.de/u/biologist)\
**Post date:** [10. Juli 2026 um 19:09 UTC](https://forum.espuino.de/t/heartbeat/4583/1 "2026-07-10T19:09:28Z")

</div>

Ist eigentlich nur eine Kleinigkeit, aber ich will es dennoch erwähnen.  
Ruft man das Webinterface von ESPuino auf, so liefert dieses der ESP32 aus, es läuft dann jedoch in deinem Browser. Die Gegenseite, also die Serverseite, läuft auf immer auf dem ESP32. Beide Seiten müssen natürlich miteinander kommunizieren, denn sonst können Befehle und Statusmeldungen nicht übertragen werden. Um zu erkennen, ob die Gegenseite erreichbar ist, wird alle drei Sekunden ein Datenpaket von der Website (also vom Browser) im Hintergrund an den Server (also ESP32) geschickt. Der ESP32 muss dieses beantworten, sonst wird ein Fehler angezeigt.

Bislang wurde rechts oben immer eine Meldung (ein sog. Toast) in diesem Falle angezeigt. Aber das war zuweilen nervig. Einerseits habe ich bei diesen Meldungen jetzt generell mal aufgeräumt, andererseits habe ich ein Heartbeat eingeführt. Oben rechts in der blauen Leiste wird ein Herz angezeigt, welches alle drei Sekunden kurz pulsiert. Das ist immer dann, wenn ein solches Datenpaket beantwortet wurde. Kommt keine Antwort zurück, so erscheint das Herz rot.

Alles ok:

 ![Verbindung besteht](https://forum.espuino.de/uploads/default/original/2X/6/65c463e19b9843437b07914d2436520abd0270ba.png)

Alles kaputt:

 ![Verbindung getrennt](https://forum.espuino.de/uploads/default/original/2X/f/f1009865d60bf6eb2ef36e174dac7df3995b1b6d.png)

Ist hier umgesetzt:

> <https://github.com/biologist79/ESPuino/pull/426>
>
> The ping/pong watchdog reset its timeout on every outgoing ping instead of only …on a confirmed pong, so a delayed pong left a stale timeout that fired a false "connection lost" warning later on. Replaced with armConnectionWatchdog(), which only (re-)arms on a positive confirmation (pong or initial connect).
> 
> Also clear the ping/track-progress intervals on socket close to avoid a crash from sending on a null socket, and replace the repeated "connection lost" toast (which was silently swallowed by the toast de-duplication logic) with a \*\*persistent heartbeat icon in the navbar that pulses on each pong\*\*.
> 
> Additionally, several read-only websocket requests (settings, ssids, trackinfo, coverimg, volume, trackProgress, ping, and plain volume-slider drags) fell through to a generic Ok response after already sending their own specific reply, triggering a redundant "action performed successfully" toast. Added a new Silent WebsocketCodeType so these no longer send a second ack, replacing a broken strncmp-based heuristic that could never match.
> 
> Fixed a misplaced i18n key (general.rfid.readerType.description) that was nested incorrectly, causing a missing-key warning in the console.
