Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Paho » MQTT-SN Gateway: sleeping client not working
MQTT-SN Gateway: sleeping client not working [message #1794839] Fri, 07 September 2018 12:48 Go to next message
Dario Cillerai is currently offline Dario CilleraiFriend
Messages: 5
Registered: January 2018
Junior Member
Hello,

I'm developing a client with Paho MQTT-SN interfaced with the related Gateway.

Everything is OK, but I can't get sleeping client feature working as described in section 6.14 of specifications (see figure 5):

"MQTT For Sensor Networks (MQTT-SN) Protocol Specification Version 1.2".

I send a DISCONNECT with sleep duration = 600 and I get a DISCONNECT from Gateway as expected.
Then, the client goes to sleep.
While the client is sleeping, a message to the client is then published by our server.
When the client wakes up, it sends a PINGREQ to the Gateway (see figure 5 of specifications) but a new DISCONNECT is received from the Gateway instead of the published messages.
Has someone experience on this feature? any advice?

Many thanks
Re: MQTT-SN Gateway: sleeping client not working [message #1794849 is a reply to message #1794839] Fri, 07 September 2018 16:15 Go to previous messageGo to next message
Dario Cillerai is currently offline Dario CilleraiFriend
Messages: 5
Registered: January 2018
Junior Member
It seems that, after DISCONNECT has been received, the Gateway deletes the client after a timeout (probably 20 seconds), even if duration is 600 seconds.

If PINGREQ is sent by the Client 7 seconds after DISCONNECT, the published message is correctly received by the client in AWAKE state.

Re: MQTT-SN Gateway: sleeping client not working [message #1794922 is a reply to message #1794849] Tue, 11 September 2018 07:36 Go to previous messageGo to next message
Dario Cillerai is currently offline Dario CilleraiFriend
Messages: 5
Registered: January 2018
Junior Member
Using network log, I've seen that it is the Broker that disconnects and prints the message:

"Client has exceeded timeout"

Client is sleeping and can't keep the connection ON with the Broker.
The Gateway should keep the connection with the Broker and buffer the messages for the Client.

What is the expected (and right) behaviour of Broker and Gateway when client is sleeping?

Re: MQTT-SN Gateway: sleeping client not working [message #1835527 is a reply to message #1794922] Sat, 05 December 2020 21:45 Go to previous message
Daniel Barallat  is currently offline Daniel Barallat Friend
Messages: 1
Registered: December 2020
Junior Member
I am in a same situation:
- My clients connects successfully
- My clients disconnects with a 330 secs timeout (duration field of DISCONNECT message)
- After 300 secs my client sends a PING REQ but gateway rejects the message as "unknown client"

See gateway log:
20201205 171204.120   PINGREQ           <---  866425030116448                     11 16 38 36 36 34 32 35 30 33 30 31 31 36 34 34 38
20201205 171204.120   PINGREQ           ===>  866425030116448                     C0 00
20201205 171204.186   PINGRESP          <===  866425030116448                     D0 00
20201205 171204.187   PINGRESP          --->  866425030116448                     02 17
20201205 171211.440   DISCONNECT        <---  866425030116448                     04 18 01 4A
20201205 171211.441   DISCONNECT        --->  866425030116448                     02 18

20201205 171711.018   PINGREQ           <---  Unknown Client !                    11 16 38 36 36 34 32 35 30 33 30 31 31 36 34 34 38
Error: MQTTSNGWClientRecvTask  Client(77.208.247.191:62335) is not connecting. message has been discarded.


Ping Req happens just 300 seconds after disconnect so we are within the timeout period. I don't understand why the gateway is refusing to accept the ping request.
Previous Topic: paho.mqtt-sn.embedded-c
Next Topic:Websockets with basic auth Paho C Client
Goto Forum:
  


Current Time: Thu Apr 25 08:04:35 GMT 2024

Powered by FUDForum. Page generated in 0.03539 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top