Yogui79 / IntexPureSpa

Intex® PureSpa remote control for Home Automation
MIT License
61 stars 15 forks source link

Device disconnects from MQTT every 30s #47

Closed guevara777 closed 2 years ago

guevara777 commented 2 years ago

My device worked good for quite a while. Now it´s not working any more....kind of.

After i upgraded the Home Assistant Mosquitto MQTT Broker Addon to Version 6.1.1 the device keeps losing its connection to MQTT every 30s and reconnects 27s later. After reconnect it loses its connection exactly 30s later.

The Home Assinst Mosquitto Broker Logs just say

1652192128: New client connected from 192.168.178.55:54639 as IntexSpa (p2, c1, k15, u'mqtt').
...
1652192143: Client IntexSpa closed its connection.
...
1652192248: New connection from 192.168.178.55:54644 on port 1883.
1652192248: New client connected from 192.168.178.55:54644 as IntexSpa (p2, c1, k15, u'mqtt').
...
1652192263: Client IntexSpa closed its connection.

from the serial monitor in arduino ide i get the following debug data

15:49:31.038 -> [  3517][D][WiFiGeneric.cpp:852] _eventCallback(): Arduino Event: 0 - WIFI_READY
15:49:31.038 -> [  3520][D][WiFiGeneric.cpp:852] _eventCallback(): Arduino Event: 2 - STA_START
15:49:31.083 -> 
15:49:31.083 -> WiFi: Connecting to WLAN_Niehues ... (3.530000s) 
15:49:31.083 -> [  3560][D][WiFiGeneric.cpp:852] _eventCallback(): Arduino Event: 5 - STA_DISCONNECTED
15:49:31.083 -> [  3561][W][WiFiGeneric.cpp:873] _eventCallback(): Reason: 202 - AUTH_FAIL
15:49:31.130 -> [  3564][D][WiFiGeneric.cpp:889] _eventCallback(): WiFi Reconnect Running
15:49:31.177 -> [  3660][D][WiFiGeneric.cpp:852] _eventCallback(): Arduino Event: 4 - STA_CONNECTED
15:49:31.224 -> [  3692][D][WiFiGeneric.cpp:852] _eventCallback(): Arduino Event: 7 - STA_GOT_IP
15:49:31.224 -> [  3692][D][WiFiGeneric.cpp:914] _eventCallback(): STA IP: 192.168.178.55, MASK: 255.255.255.0, GW: 192.168.178.1
15:49:31.224 -> WiFi: Connected (3.698000s), ip : 192.168.178.55 
15:49:31.744 -> MQTT: Connecting to broker "192.168.178.118" with client name "IntexSpa" and username "mqtt" ... (4.209000s) - ok. (4.499000s) 
15:49:32.026 -> MQTT: Subscribed to [IntexSpa/Cmd Power on off]
15:49:32.026 -> MQTT: Subscribed to [IntexSpa/Cmd water filter time]
15:49:32.026 -> MQTT: Subscribed to [IntexSpa/Cmd water filter on off]
15:49:32.026 -> MQTT: Subscribed to [IntexSpa/Cmd bubble on off]
15:49:32.073 -> MQTT: Subscribed to [IntexSpa/Cmd heater on off]
15:49:32.073 -> MQTT: Subscribed to [IntexSpa/Cmd Farenheit Celsius]
15:49:32.073 -> MQTT: Subscribed to [IntexSpa/Cmd decrease]
15:49:32.073 -> MQTT: Subscribed to [IntexSpa/Cmd increase]
15:49:32.073 -> MQTT: Subscribed to [IntexSpa/Cmd Temperature Setpoint]
15:49:32.073 -> MQTT: Subscribed to [IntexSpa/Cmd Reset ESP]
15:49:32.073 -> Debug Pump data : AB 00 00 00 0D 1A 1B 25 00 00 00 00 00 00 00 42 22  
15:49:32.073 -> MQTT << [IntexSpa/Power on] 1
15:49:32.073 -> IntexSpa/Power on 1
15:49:32.073 -> MQTT << [IntexSpa/Bubble on] 0
15:49:32.073 -> IntexSpa/Bubble on 0
15:49:32.073 -> MQTT << [IntexSpa/heater on] 1
15:49:32.121 -> IntexSpa/heater on 1
15:49:32.121 -> MQTT << [IntexSpa/heater state] 2

...

15:50:02.140 -> MQTT! Lost connection (34.614000s). 
15:50:02.140 -> MQTT: Retrying to connect in 15 seconds. 
15:50:17.165 -> MQTT: Connecting to broker "192.168.178.118" with client name "IntexSpa" and username "mqtt" ... (49.614000s)[ 52617][I][WiFiClient.cpp:253] connect(): select returned due to timeout 3000 ms for fd 49
15:50:20.157 -> unable to connect (52.618000s), reason: MQTT_CONNECT_FAILED
15:50:20.157 -> MQTT: Retrying to connect in 15 seconds.
15:50:20.157 -> MQTT!: Failed MQTT connection count: 1 
15:50:35.180 -> MQTT: Connecting to broker "192.168.178.118" with client name "IntexSpa" and username "mqtt" ... (67.628000s)[ 70631][I][WiFiClient.cpp:253] connect(): select returned due to timeout 3000 ms for fd 49
15:50:38.154 -> unable to connect (70.632000s), reason: MQTT_CONNECT_FAILED
15:50:38.154 -> MQTT: Retrying to connect in 15 seconds.
15:50:38.201 -> MQTT!: Failed MQTT connection count: 2 
15:50:53.154 -> MQTT: Connecting to broker "192.168.178.118" with client name "IntexSpa" and username "mqtt" ... (85.642000s)[ 88644][I][WiFiClient.cpp:253] connect(): select returned due to timeout 3000 ms for fd 49
15:50:56.165 -> unable to connect (88.645000s), reason: MQTT_CONNECT_FAILED
15:50:56.165 -> MQTT: Retrying to connect in 15 seconds.
15:50:56.213 -> MQTT!: Failed MQTT connection count: 3 
15:51:11.183 -> MQTT: Connecting to broker "192.168.178.118" with client name "IntexSpa" and username "mqtt" ... (103.655000s)[106658][I][WiFiClient.cpp:253] connect(): select returned due to timeout 3000 ms for fd 49
15:51:14.218 -> unable to connect (106.659000s), reason: MQTT_CONNECT_FAILED
15:51:14.218 -> MQTT: Retrying to connect in 15 seconds.
15:51:14.218 -> MQTT!: Failed MQTT connection count: 4 
15:51:29.181 -> MQTT: Connecting to broker "192.168.178.118" with client name "IntexSpa" and username "mqtt" ... (121.669000s) - ok. (121.717000s) 
15:51:29.228 -> MQTT: Subscribed to [IntexSpa/Cmd Power on off]
15:51:29.228 -> MQTT: Subscribed to [IntexSpa/Cmd water filter time]
15:51:29.306 -> MQTT: Subscribed to [IntexSpa/Cmd water filter on off]
15:51:29.306 -> MQTT: Subscribed to [IntexSpa/Cmd bubble on off]

...

There seems to be a bigger change in that update of mosquitto broker addon. Here is what the Changelog says:

6.1.1
Don't purge openssl in cleanup
6.1.0
Update mosquitto to 2.0.11
Remove mosquitto-auth-plug and replace with mosquitto-go-auth 1.8.2
Change base image from Alpine to Debian (required for mosquitto-go-auth)
Note: Mosquitto 2.0.0 did contain some breaking changes. We don't anticipate most users to be affected by them but if you have a heavily customized mosquitto config we would advise reviewing [their changelog](https://mosquitto.org/ChangeLog.txt).

I dont know how to solve this problem. Any ideas?

Here is my Sketch from Arduino sketch.txt

guevara777 commented 2 years ago

Sorry. Found the problem. My Router gave the same IP-Adress of my ESP32 to a second device. After changing its IP-Adress its now working as it should.