Ciao ragazzi, da qualche settimana ho notato di avere dei problemi con la connessione al servizio MQTT dei miei due Sonoff Basic R2 modificati con firmware Tasmota 6.5.0.
La struttura di tutta la rete è composta come segue:
- router principale presente in una camera della casa collegato alla linea telefonica;
- Raspberry Pi 3 b+ collegato al router principale via ethernet sul quale è è presente "Hassi.io" versione 2.12, add-on "Configurator" versione 3.4, add-on "Mosquitto broker" versione 4.3;
- router secondario posizionato nel salone di casa, collegato via ethernet al router principale e configurato come semplice access point;
- due Sonoff Basic R2 modificati entrambi con firmware Tasmota 6.5.0, collegati via wifi al router secondario. I due Sonoff distano relativamente 5 metri (potenza wifi 52%) e 10 metri (potenza wifi 46%).
Mi sono accorto della presenza di un problema notando che i led del router secondario lampeggiavano molto velocemente e ininterrottamente. Stesso discorso per il led della porta ethernet del Raspberry.
Andando a leggere i log del dell'add-on "Mosquitto broker" è uscito fuori che ogni pochi secondi si verifica questo:
1561200492: New client connected from 192.168.1.205 as DVES_FA0334 (c1, k10, u'mosquitto').
1561200512: Socket error on client DVES_FA0334, disconnecting.
1561200513: New connection from 192.168.1.205 on port 1883.
[INFO] found mosquitto on Home Assistant
1561200514: New client connected from 192.168.1.205 as DVES_FA0334 (c1, k10, u'mosquitto').
1561200649: Socket error on client DVES_5A4EB1, disconnecting.
1561200650: New connection from 192.168.1.206 on port 1883.
[INFO] found mosquitto on Home Assistant
1561200651: New client connected from 192.168.1.206 as DVES_5A4EB1 (c1, k10, u'mosquitto').
1561200978: Client DVES_5A4EB1 has exceeded timeout, disconnecting.
1561200978: Socket error on client DVES_5A4EB1, disconnecting.
1561200979: New connection from 192.168.1.206 on port 1883.
[INFO] found mosquitto on Home Assistant
1561200981: New client connected from 192.168.1.206 as DVES_5A4EB1 (c1, k10, u'mosquitto').
1561201227: Client DVES_5A4EB1 has exceeded timeout, disconnecting.
1561201227: Socket error on client DVES_5A4EB1, disconnecting.
1561201228: New connection from 192.168.1.206 on port 1883.
[INFO] found mosquitto on Home Assistant
1561201229: New client connected from 192.168.1.206 as DVES_5A4EB1 (c1, k10, u'mosquitto').
1561201867: Saving in-memory database to /data/mosquitto.db.
1561202094: Client DVES_FA0334 has exceeded timeout, disconnecting.
1561202094: Socket error on client DVES_FA0334, disconnecting.
1561202094: New connection from 192.168.1.205 on port 1883.
[INFO] found mosquitto on Home Assistant
Andando invece a leggere i log System di Hass.io, si verifica questo:
19-06-22 11:49:16 INFO (MainThread) [hassio.auth] Auth request from core_mosquitto for mosquitto
19-06-22 11:49:17 INFO (MainThread) [hassio.auth] Success login from mosquitto
19-06-22 12:02:25 INFO (MainThread) [hassio.auth] Auth request from core_mosquitto for mosquitto
19-06-22 12:02:26 INFO (MainThread) [hassio.auth] Success login from mosquitto
19-06-22 12:14:39 INFO (MainThread) [hassio.auth] Auth request from core_mosquitto for mosquitto
19-06-22 12:14:40 INFO (MainThread) [hassio.auth] Success login from mosquitto
Andando a leggere la console del Sonoff che dista 10 metri dal router secondario, ho notato che circa ogni 2 secondi si verifica questo:
12:49:17 MQT: Connected
12:49:17 MQT: tele/veranda_cucina/LWT = Online (retained)
12:49:17 MQT: cmnd/veranda_cucina/POWER =
12:49:17 UPP: Multicast (re)joined
12:50:18 MQT: tele/veranda_cucina/STATE = {"Time":"2019-06-22T12:50:18","Uptime":"0T03:02:12","Vcc":3.482,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER":"OFF","Wifi":{"AP":1,"SSId":"GrizzlyWiFi2","BSSId":"00:1E:2A:F5:F1:64","Channel":11,"RSSI":44,"LinkCount":4,"Downtime":"0T00:00:14"}}
12:55:18 MQT: tele/veranda_cucina/STATE = {"Time":"2019-06-22T12:55:18","Uptime":"0T03:07:12","Vcc":3.471,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER":"OFF","Wifi":{"AP":1,"SSId":"GrizzlyWiFi2","BSSId":"00:1E:2A:F5:F1:64","Channel":11,"RSSI":48,"LinkCount":4,"Downtime":"0T00:00:14"}}
13:00:18 MQT: tele/veranda_cucina/STATE = {"Time":"2019-06-22T13:00:18","Uptime":"0T03:12:12","Vcc":3.480,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER":"OFF","Wifi":{"AP":1,"SSId":"GrizzlyWiFi2","BSSId":"00:1E:2A:F5:F1:64","Channel":11,"RSSI":56,"LinkCount":4,"Downtime":"0T00:00:14"}}
13:02:00 MQT: tele/veranda_cucina/UPTIME = {"Time":"2019-06-22T13:02:00","Uptime":"0T03:13:54"}
13:05:19 MQT: tele/veranda_cucina/STATE = {"Time":"2019-06-22T13:05:19","Uptime":"0T03:17:13","Vcc":3.486,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER":"OFF","Wifi":{"AP":1,"SSId":"GrizzlyWiFi2","BSSId":"00:1E:2A:F5:F1:64","Channel":11,"RSSI":62,"LinkCount":4,"Downtime":"0T00:00:14"}}
13:10:19 MQT: tele/veranda_cucina/STATE = {"Time":"2019-06-22T13:10:19","Uptime":"0T03:22:13","Vcc":3.484,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER":"OFF","Wifi":{"AP":1,"SSId":"GrizzlyWiFi2","BSSId":"00:1E:2A:F5:F1:64","Channel":11,"RSSI":64,"LinkCount":4,"Downtime":"0T00:00:14"}}
13:14:39 MQT: Attempting connection...
13:14:41 MQT: Connected
13:14:41 MQT: tele/veranda_cucina/LWT = Online (retained)
13:14:41 MQT: cmnd/veranda_cucina/POWER =
13:14:41 UPP: Multicast (re)joined
Andando a leggere la console del Sonoff che dista 5 metri dal router secondario, ho notato che circa ogni 2 secondi si verifica questo:
13:02:26 MQT: Connected
13:02:26 MQT: tele/portone_scale/LWT = Online (retained)
13:02:26 MQT: cmnd/portone_scale/POWER =
13:02:27 UPP: Multicast (re)joined
13:05:46 MQT: tele/portone_scale/STATE = {"Time":"2019-06-22T13:05:46","Uptime":"2T01:47:51","Vcc":3.572,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER":"OFF","Wifi":{"AP":1,"SSId":"GrizzlyWiFi2","BSSId":"00:1E:2A:F5:F1:64","Channel":11,"RSSI":54,"LinkCount":29,"Downtime":"0T00:03:19"}}
13:05:46 MQT: tele/portone_scale/SENSOR = {"Time":"2019-06-22T13:05:46","Switch2":"OFF"}
13:10:47 MQT: tele/portone_scale/STATE = {"Time":"2019-06-22T13:10:47","Uptime":"2T01:52:52","Vcc":3.554,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER":"OFF","Wifi":{"AP":1,"SSId":"GrizzlyWiFi2","BSSId":"00:1E:2A:F5:F1:64","Channel":11,"RSSI":52,"LinkCount":29,"Downtime":"0T00:03:19"}}
13:10:47 MQT: tele/portone_scale/SENSOR = {"Time":"2019-06-22T13:10:47","Switch2":"OFF"}
13:15:48 MQT: tele/portone_scale/STATE = {"Time":"2019-06-22T13:15:48","Uptime":"2T01:57:53","Vcc":3.553,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER":"OFF","Wifi":{"AP":1,"SSId":"GrizzlyWiFi2","BSSId":"00:1E:2A:F5:F1:64","Channel":11,"RSSI":54,"LinkCount":29,"Downtime":"0T00:03:19"}}
13:15:48 MQT: tele/portone_scale/SENSOR = {"Time":"2019-06-22T13:15:48","Switch2":"OFF"}
Come mai? Qual è il problema? Avete idee su come risolverlo.
Grazie mille a chi mi aiuterà.