Hi,
I am using Annex 1.44 on Wemos D1 module. I am working on heating controller where data from temperature sensors are sent to MQTT server, then stored to influxdb via NodeRed and visualized in Grafana.
I need to ensure that controller will be controlling heating boiler 24/7 even if WiFi is down or MQTT server would disconnect (for any reason). Note: MQTT and other servers are running on Orange PI.
What I do in the beginning of my script is to connect to WIFI (if connected, then it skips this step) and then I connect to my mqtt server. Connection checks are done afterwards regularly using timer1, every 5 minutes. WIFI.STATUS, MQTT.CONNECTED.
My issue is that if MQTT server is not connected, then MQTT.CONNECTED throws exception and ESP reboots. The same happens with MQTT.STATUS.
I tried:
- connect to MQTT server every time before MQTT.PUBLISH
- MQTT.DISCONNECT and MQTT.SETUP, CONNECT, SUBSCRIBE before MQTT PUBLISH
instantly or later it crashes into reboot. Even typing WLOG MQTT.STATUS into immediate windows reboots the device.
Any help / advice?
MQTT status test
- cicciocb
- Site Admin
- Posts: 2069
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 441 times
- Been thanked: 1363 times
- Contact:
Re: MQTT status test
Hello cicciocb,
Could you please give an update if the MQTT issue has been fixed (specifically on 8266 version)?
Thanks! Jan
Could you please give an update if the MQTT issue has been fixed (specifically on 8266 version)?
Thanks! Jan
- cicciocb
- Site Admin
- Posts: 2069
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 441 times
- Been thanked: 1363 times
- Contact:
Re: MQTT status test
Hi, thanks for a quick response. I asked since I haven't seen this fix mentioned in the change log.
I updated my device with Annex to 1.47 (BTW, it still shows 1.44.2). So far it looks good.
Thank you.
I updated my device with Annex to 1.47 (BTW, it still shows 1.44.2). So far it looks good.
Thank you.
-
- Posts: 2
- Joined: Sat Feb 18, 2023 9:35 am
Re: MQTT status test
Hi, am I the only one who still has problems with ESP8266 crashing at mqtt.connect? It's like this since SW versions above 1.43.
these are the lines:
wlog mqtt.setup ("test.mosquitto.org")
'wlog mqtt.status()
wlog mqtt.connect("", "")
It's crashing either at .status or .connect. setup returns a 1.
no problems whatsoever with ESp32.
Thanks
these are the lines:
wlog mqtt.setup ("test.mosquitto.org")
'wlog mqtt.status()
wlog mqtt.connect("", "")
It's crashing either at .status or .connect. setup returns a 1.
no problems whatsoever with ESp32.
Thanks
- cicciocb
- Site Admin
- Posts: 2069
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 441 times
- Been thanked: 1363 times
- Contact:
Re: MQTT status test
Hi
you are specifying a wrong url (the protocol is missing).
The right syntax is
This is an extract from the help file :
Hi,[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Fri May 10, 2024 7:00 pm Hi, am I the only one who still has problems with ESP8266 crashing at mqtt.connect? It's like this since SW versions above 1.43.
these are the lines:
wlog mqtt.setup ("test.mosquitto.org")
'wlog mqtt.status()
wlog mqtt.connect("", "")
It's crashing either at .status or .connect. setup returns a 1.
no problems whatsoever with ESp32.
Thanks
you are specifying a wrong url (the protocol is missing).
The right syntax is
Code: [Local Link Removed for Guests]
wlog mqtt.setup ("mqtt://test.mosquitto.org")
wlog mqtt.status()
wlog mqtt.connect("", "")
You do not have the required permissions to view the files attached to this post.
-
- Posts: 2
- Joined: Sat Feb 18, 2023 9:35 am
Re: MQTT status test
Ahh thanks, that was a case of "didn't see the forest for the trees".
I was looking for a return value of 1 but should be 0 even when I wrote the correct syntax. And the crashing made me believe something else is wrong.
But the LWT is still not included with ESP8266 right?
I was looking for a return value of 1 but should be 0 even when I wrote the correct syntax. And the crashing made me believe something else is wrong.
But the LWT is still not included with ESP8266 right?
- cicciocb
- Site Admin
- Posts: 2069
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 441 times
- Been thanked: 1363 times
- Contact:
Re: MQTT status test
Yes, the LWT is not included for the ESP8266[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Sat May 11, 2024 8:53 pm Ahh thanks, that was a case of "didn't see the forest for the trees".
I was looking for a return value of 1 but should be 0 even when I wrote the correct syntax. And the crashing made me believe something else is wrong.
But the LWT is still not included with ESP8266 right?