check if the mqqt server is present
Moderators: grovkillen, Stuntteam, TD-er
check if the mqqt server is present
Hello
I would like to equip my ESP 32 with a safety function.
I am using a WT32-eth01 with LAN and if this is not present then wifi.
Now I want to check if the mqqt server is present. If the server is not reachable because of a malfunction or newnetwork problems, all gpios which control relays, have to go into a defined position to prevent damage.
GPIO,4,1
GPIO,5,1
GPIO,14,1
GPIO,15,1
Can I make a ping request or a secure request to the MQTT server and initiate the shutdown process if this is not answered?
I am running ESP_Easy_mega_20230930_normal_ESP32_4M316k_ETH.
trying a ping I am getting
Command unknown: ping 10.10.10.10 // IP from MQTT it responds on pin from PC
I would like to equip my ESP 32 with a safety function.
I am using a WT32-eth01 with LAN and if this is not present then wifi.
Now I want to check if the mqqt server is present. If the server is not reachable because of a malfunction or newnetwork problems, all gpios which control relays, have to go into a defined position to prevent damage.
GPIO,4,1
GPIO,5,1
GPIO,14,1
GPIO,15,1
Can I make a ping request or a secure request to the MQTT server and initiate the shutdown process if this is not answered?
I am running ESP_Easy_mega_20230930_normal_ESP32_4M316k_ETH.
trying a ping I am getting
Command unknown: ping 10.10.10.10 // IP from MQTT it responds on pin from PC
Re: check if the mqqt server is present
For this purpose there are the MQTT#Connected and MQTT#Disconnected events.
When receiving the mqtt#disconnected event you can start any precautious measures needed, and revert them once the server is connected again.
When receiving the mqtt#disconnected event you can start any precautious measures needed, and revert them once the server is connected again.
/Ton (PayPal.me)
Re: check if the mqqt server is present
thank you
that sounds like the right way to go
how can i query this in a rule?
can I simply do this with:
On MQTT#Disconnected Do
GPIO,4,1
GPIO,5,1
GPIO,14,1
GPIO,15,1
Endon
I have just found the answer to this question myself in the help section.
But I do not check the differentes between MQTTimport#Disconnected and MQTT#Disconnected
that sounds like the right way to go
how can i query this in a rule?
can I simply do this with:
On MQTT#Disconnected Do
GPIO,4,1
GPIO,5,1
GPIO,14,1
GPIO,15,1
Endon
I have just found the answer to this question myself in the help section.
But I do not check the differentes between MQTTimport#Disconnected and MQTT#Disconnected
Re: check if the mqqt server is present
MQTTImport#Disconnected has to do with the MQTT Import plugin P037, and is, sort of, independent from the MQTT#Disconnected event. (IMHO) you can ignore the MQTTImport events for this.
/Ton (PayPal.me)
Re: check if the mqqt server is present
mqtt#disconnected as also MQTT import uses the MQTT broker settings of the first enabled MQTT controller.
Re: check if the mqqt server is present
there is also system variable %ismqtt%
Re: check if the mqqt server is present
Well, when would you check that variable? You'd have to add some repeating event to check that, so responding to the original event seems more natural and appropriate.
/Ton (PayPal.me)
Re: check if the mqqt server is present
I just wanted to add if events are not enough that related to this topic there is also system variable available....
Who is online
Users browsing this forum: Ahrefs [Bot] and 0 guests