Jump to content

MQTT client disconnected, keep alive


ray

Recommended Posts

Hi there. Let's see if someone can help me.


I have this scenario:
- Raspberry pi with mosquitto broker.
- Unistream connected to the broker and subscribed to a topic
- Several temperature sensors as clients publishing a topic every 1 second.


Everything works fine but, any idea how to know if a client has disconnected? In the client configuration I have the "keep alive" function set to 10 seconds, however the "Subscription.Subscribed" bit is always at "1".

Link to comment
Share on other sites

Dear ray,
If the "Subscription.Subscribed" bit is at "1" from UniStream POV you are connected. Please check:

  • Set the "Broker.LastWillTopic" & "Broker.LastWillMessage" properties on the Broker linked to your Subscription and validate you are getting the last will message 10s after the disconnection.
    It will help us to know if the 
    UniStream get the disconnection event 
  • What is the value of "Broker.BrokerConnected" on the Broker struct linked to your Subscription 10s after the disconnection? Is it also "1"?
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.