Closed szymonnnm closed 5 years ago
Okay, I think I've solved it - it turned out that I had to set the Duration
field in the CONNECT
message to the same duration I'm using in DISCONNECT
.
I misunderstood the MQTT-SN specification and thought that this field indicates the time of non-sleep connection i.e. between CONNECT
and DISCONNECT
so I kept it low.
Hello,
I've been playing recently with the MQTT-SN and so far the Gateway has been working wonderfully - I was able to correctly do a connect/publish/subscribe/disconnect cycle (like in
MQTTSNPacket/samples/pub0sub1.c
example) but now I've stumbled upon some behavior that I don't understand. The problem began when I tried to implement a sleepy device. The principle of operation I'm trying to use is simple:duration
field set to60
,PINGREQ
packet and parse received data,The problem is that the Gateway's response on my
PINGREQ
packets is alwaysDISCONNECT
because it doesn't recognize the client. I don't understand why it's hapenning. I'm attaching the logs from the gateway below. You can see there that:CONNECT
message and in thePINGREQ
message.DISCONNECT
message is in fact60
DISCONNECT
andPINGREQ
messages is30
- it's less than the sleep duration so the Gateway should still "remember" the client, am I right?EDIT: I noticed that the version of the Gateway I was using was
1.0.1
(I am usingRaspPIoT Border Router Demo
from Nordic Semiconductors) so I've updated it to the newest version. Unfortunately, with1.3.1
the problem still remains. I've edited the logs to those from1.3.1
since they look nicer.