How does Mosquitto determine the online and offline status of devices by using its built-in topics?
Was there no specific topic for determining the client's online/offline status in Mosquitto 2.0.22? I looked up some information which stated that $SYS/broker/client/[clientid]/connected can indeed be used to determine whether the connection is online or offline. However, when I actually tried to use it, it didn't work as expected. Could you please tell me what steps I need to take to use Mosquitto properly? thank you
@objectboy2016 I'm afraid that information is wrong, there is no built in mechanism in the broker for doing this. It's fairly straightforward to have your clients do this themselves though - set a will message to publish a retained 0 to a topic, then on connect publish a retained 1 to that same topic.