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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...