#758·gobot

[firmata] Handling loss of connection with the TCPAdaptor

Author: abishekmuthianCreated Jun 27, 2020Updated Nov 1, 2024
Labelsbugenhancement

I'm using ESP8266(server) and so TCPAdaptor(firmata) along with MQTTAdapter.

I tried different methodologies to handle connection loss,

  1. Checking at regular intervals for connections, but connections are returned even if the actual WiFi connection is lost (switching off the ESP8266).

  2. Trying to connect with adaptor at regular intervals, but returns "client is already connected" even when connection
    is lost.

I found setAutoReconnect for MQTTAdaptor, which I assume handles connection loss for the same. But what is the recommended strategy to handle connection loss of TCPAdaptor?