Open sincze opened 8 months ago
Sorry for the late reply. There's definitely an attempt made to reconnect. This is called within loop
:
https://github.com/sidoh/esp8266_milight_hub/blob/master/lib/MQTT/MqttClient.cpp#L125
void MqttClient::reconnect() {
if (lastConnectAttempt > 0 && (millis() - lastConnectAttempt) < MQTT_CONNECTION_ATTEMPT_FREQUENCY) {
return;
}
if (! mqttClient.connected()) {
if (connect()) {
subscribe();
sendBirthMessage();
#ifdef MQTT_DEBUG
Serial.println(F("MqttClient - Successfully connected to MQTT server"));
#endif
} else {
Serial.print(F("ERROR: Failed to connect to MQTT server rc="));
Serial.println(mqttClient.state());
}
}
lastConnectAttempt = millis();
}
I'd check the serial logs to see if there's any noise about MQTT disconnects.
Tnx. I also locked the device to 1 AP to see if that helps. So it doesn't roam between multiple AP's.
As said it does obtain wifi but it only lost mqtt messaging traffic.
Describe the bug
I am running firmware": "milight-hub", "version": "1.11.2", on an EPS8266. I've recently switched to MQTT and that works excellent. Devices are automatically created using the Auto Discovery in Domoticz. I am running Mosquitto locally and MQTT explorer to monitor incoming messages.
For some reason the ESP at random times (not daily....) ,decides not to send any more MQTT messages to Mosquitto. As a result lights can not be controlled anymore. To solve this. I need to login to the milight-hub , qo to MQTT settings page and press save.
Steps to reproduce
Just wait and do nothing
Expected behavior
If a connection to the MQTT server is lost for some reason I would expect the gateway to automatically retry this. As I have done by going into the settings of mqtt and press save.
Setup information
Firmware version
"version": "1.11.2"
Output of http://milight-hub.local/about
Output of http://milight-hub.local/settings
Additional context