MQTT Disconnects ESP8266
Moderators: grovkillen, Stuntteam, TD-er
MQTT Disconnects ESP8266
Hi all,
i use ESP8266 with actual Software.
From time to time i get a event MQTT#Disconnect (every 1-2 hours). I am using PIDOME MQTT.
Broker is runnung under Raspberry Buster. mosquitto version 2.0.11
The log on my MQTT Broker says:
1651661432: Client Wohnzimmer_LCD_5 has exceeded timeout, disconnecting.
1651661432: New connection from 192.168.1.24:63600 on port 1883.
1651661432: New client connected from 192.168.1.24:63600 as Wohnzimmer_LCD_5 (p2, c0, k10).
Any hints for me ?
ESP8266 have a rssi of -57db
regards Klaus
i use ESP8266 with actual Software.
From time to time i get a event MQTT#Disconnect (every 1-2 hours). I am using PIDOME MQTT.
Broker is runnung under Raspberry Buster. mosquitto version 2.0.11
The log on my MQTT Broker says:
1651661432: Client Wohnzimmer_LCD_5 has exceeded timeout, disconnecting.
1651661432: New connection from 192.168.1.24:63600 on port 1883.
1651661432: New client connected from 192.168.1.24:63600 as Wohnzimmer_LCD_5 (p2, c0, k10).
Any hints for me ?
ESP8266 have a rssi of -57db
regards Klaus
Re: MQTT Disconnects ESP8266
What do you have configured as timeout on the controller settings for your PiDome MQTT controller?
Is the MQTT broker on the local network?
Is the MQTT broker on the local network?
Re: MQTT Disconnects ESP8266
Client Timeout is set to 1000 ms. (is this the PingReq timeout ?)
Broker is in the same subnet via repeater ..
EDIT:
Periodical send Gratuitous ARP is on
Force WiFi B/G is also on
Send With Max TX Power yes
Force WiFi No Sleep: yes
Broker is in the same subnet via repeater ..
EDIT:
Periodical send Gratuitous ARP is on
Force WiFi B/G is also on
Send With Max TX Power yes
Force WiFi No Sleep: yes
Re: MQTT Disconnects ESP8266
Can you take a look at the timing stats?
N.B. the timing stats must be included in the build, for 1M builds or "testing" builds it isn't. You also need to enable it on the Tools-Advanced page to actually collect the timing stats.
N.B. the timing stats must be included in the build, for 1M builds or "testing" builds it isn't. You also need to enable it on the Tools-Advanced page to actually collect the timing stats.
Re: MQTT Disconnects ESP8266
OK, i have activated the timing stats. Which value do you need ?
Re: MQTT Disconnects ESP8266
Well any that 'jumps out'.
Better show the entire page as it is hard to tell up front which value matters.
N.B. the timing stats are reset on every reload of the page.
Best to reload the page once and then leave it running for a while. Preferrably at least 2 - 3 "disconnects".
Do not load pages inbetween as serving web pages may also handle while other actions are processed, which may cause high values in the stats where they are not related to the actual action.
Another thing you can test, to see if it makes a difference, is sending a continuous ping from just any host in the network to the ESP and see if the unit remains connected to the broker for a longer time.
Also check the sysinfo page to see if the ESP may have been reconnecting to WiFi.
Better show the entire page as it is hard to tell up front which value matters.
N.B. the timing stats are reset on every reload of the page.
Best to reload the page once and then leave it running for a while. Preferrably at least 2 - 3 "disconnects".
Do not load pages inbetween as serving web pages may also handle while other actions are processed, which may cause high values in the stats where they are not related to the actual action.
Another thing you can test, to see if it makes a difference, is sending a continuous ping from just any host in the network to the ESP and see if the unit remains connected to the broker for a longer time.
Also check the sysinfo page to see if the ESP may have been reconnecting to WiFi.
Re: MQTT Disconnects ESP8266
IMHO, i see only:
rulesProcessing() 264 0.46 10.54 80.530 226.881 3609.560
Here are my rules:
rules1.txt
rules2.txt
Next, i will try the ping the ESP permanent, and i will try to connect the ESP to different Access Point.
regards Klaus
rulesProcessing() 264 0.46 10.54 80.530 226.881 3609.560
Here are my rules:
rules1.txt
Code: Select all
on System#Boot do
timerSet,1,1 // Init Display after 1 Seconds
lcdcmd,off
pwm,5,200
Let 1,200
notify 1
endon
on Rules#Timer=1 do // Wait until MQTT is connected
lcdcmd,on // Start if message MQQT connect apears
lcd,1,1,Waiting...
lcd,2,1,Waiting...
endon
on MQTT#Connected do // Start Display wrap around
timerSet,2,3
endon
on MQTT#Disconnected do // Reset Display when ESP are disconnected ..
timerSet,2,0
timerSet,3,0
timerSet,4,0
timerSet,5,0
timerSet,6,0
notify 1
lcd,1,1,'MQTT disconnect!'
lcd,2,1,'be cool .. '
endon
on Rules#Timer=2 do
lcd,1,1,'Wind [MQTT_IMPORT1#ws] km/h x'
lcd,2,1,'%sysweekday_s% %sysday%-%sysmonth%-%sysyear% x'
timerSet,3,3
endon
on Rules#Timer=3 do
lcd,1,1,'Out T:[MQTT_IMPORT1#out_temp] H:[MQTT_IMPORT1#out_hum] x'
lcd,2,1,'In T:[T&H#in_temp] H:[T&H#in_hum] x'
timerSet,4,3
endon
on Rules#Timer=4 do
lcd,1,1,'Rain [MQTT_IMPORT1#Raintoday] l/qm x '
lcd,2,1,'CO2 [CO2#CO2] ppm x'
timerSet,5,3
endon
on Rules#Timer=5 do
lcd,1,1,'APS-A [MQTT_IMPORT2#Pressure] hPA x'
lcd,2,1,'Time %systime% x'
timerSet,6,3
endon
on Rules#Timer=6 do
if [MQTT_IMPORT2#Tendency] > 0
lcd,1,1,'APS-T +[MQTT_IMPORT2#Tendency] (3h) x'
else
lcd,1,1,'APS-T [MQTT_IMPORT2#Tendency] (3h) x'
endif
lcd,2,1,'SR %sunrise% SS %sunset% '
timerSet,2,3
endon
//
// CO2 Steuerung:
//
on CO2#co2 do
if [CO2#co2] > 2000
tone,4,2100,6000
endif
if [CO2#co2] > 1000 and [CO2#co2] < 2000
tone,4,2100,3000
endif
endon
Code: Select all
on LDR#Light do
If [LDR#Light] >550 and [LDR#Light] <650 and [VAR#1] != 20
pwm,5,20,3000
Let 1,20
endif
If [LDR#Light] >650 and [LDR#Light] <750 and [VAR#1] != 40
pwm,5,40,3000
Let 1,40
endif
If [LDR#Light] >750 and [LDR#Light] <900 and [VAR#1] != 50
pwm,5,50,3000
Let 1,50
endif
If [LDR#Light] >900 and [LDR#Light] <1010 and [VAR#1] != 100
pwm,5,100,3000
Let 1,100
endif
If [LDR#Light] >=1010 and [VAR#1] != 800
pwm,5,800,3000
Let 1,800
endif
If [LDR#Light] <=550 and [VAR#1] != 10
pwm,5,10,3000
Let 1,10
endif
endon
//on Clock#Time=All,**:00 do //**:** ==> jede Minute **:00 ==> jede Stunde
// tone,4,2100,500
//endon
regards Klaus
- Attachments
-
- Screenshot 2022-05-05 at 20-12-46 Wohnzimmer_LCD.png (302.79 KiB) Viewed 6442 times
Re: MQTT Disconnects ESP8266
That build is 4 months old, in the latest build 20220427 the rules processing has been performance-improved, that might help you here.
Is this disconnect-behavior new, or have you seen this since the December 24 install, or even before that? (the rules look quite 'mature', so I expect that this setup has been running for a longer time already )
Is this disconnect-behavior new, or have you seen this since the December 24 install, or even before that? (the rules look quite 'mature', so I expect that this setup has been running for a longer time already )
/Ton (PayPal.me)
Re: MQTT Disconnects ESP8266
I am not sure, but as far as i remember the disconnect-behavior is very old.
The difference is, that i connected a buzzer to the ESP8266 this week, and since that time, i noticed the "problem".
I will give i try with the build 20220427 ...
The difference is, that i connected a buzzer to the ESP8266 this week, and since that time, i noticed the "problem".
I will give i try with the build 20220427 ...
Re: MQTT Disconnects ESP8266
The tone command may be rather blocking for quite a while.
Can you test with the tone command commented-out to see if that makes the MQTT connection more stable.
Another "dirty" work-around is to call publish something to the MQTT broker right before calling the tone command.
Can you test with the tone command commented-out to see if that makes the MQTT connection more stable.
Another "dirty" work-around is to call publish something to the MQTT broker right before calling the tone command.
Re: MQTT Disconnects ESP8266
The latest build 20220427 fixed my Problem. Right now 24 hours no disconnects.
Thank you all very much for your support !!
best ragrards
Klaus
Thank you all very much for your support !!
best ragrards
Klaus
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 0 guests