How to monitor/check if MQTT client is connected well? – ICS – Internet Component Suite
I’m trying to find out, what is the best method to find out, if the MQTT client is currently connected to a Server.
After analysing of Ping /vs/ KeepAlive I’ve realised they are the “same”, so there was no need to create a Timer for myself to regularly call Ping.
I also know by now, that checking if (MQ_CL.Online = True) is not good, because it is getting false only after a full disconnect.
So my question is:
– What is the best method to find out, if the server is responsive = online currently?
(Did not went offline since the last 1500ms)
Problems I’ve faced so far:
– OnMON did not gets triggered on Ping responce
– nor MQTT server
>> because “Ping” is an inner mechanism, invisible to the user.
– Also I do not understand concept in the code of the relation of “KeepAliveCount := KeepAlive * 10”
The server is running mostly the same PC, or max via LAN. (ping < 500ms)
Delphi7, 32bit; Windows 7+; ICS v9.5 2025-09-19; MQTT v3.1.1; MQTT server: Node-RED Aedes
Read more here: Source link
