MQTT - session present flag

Since MQTT 3.1.1 the CONNACK message contains “Session Present flag” (more info here).

Is it supported by MQTT client implementation on M66?

Application note describe that connection command response is:

+QMTCONN: <tcpconnectID>,<result>[,<ret_code>]

I guess is not supported right now?

Hello,

M66 supports this flag. It’s added in MQTT 3.1.1. So you can configure MQTT version to 3.1.1.
e.g.: AT+QMTCFG=“version”,<version_number>
image

Happy new year,

I tried to set 3.1.1 version:

AT+QMTCFG="VERSION",0,1

OK
AT+QMTCFG="VERSION",0

+QMTCFG: 1

OK

Then I sent QMTCONN:

AT+QMTCONN=0,"device:1234"

OK

+QMTCONN: 0,0,0

In response I don’t see a session present flag value. Server send it when client is allowed to connect. It stores information about session on server side. If flag is true then client doesn’t need to subscribe, because server remember it from previous connection. Client should receive enqueued messages from server with QoS 1+.

Hello,

I see. We missed the “clean session” flag in CONNECT packet. It’s can be configued and default value is 1 which server will discard previous session and start a new one. Please try to set this value to 0 and test again.
AT+QMTCFG=“session”,0 //Check current value
AT+QMTCFG=“session”,0,0 //Set this value to 0.

Best Regards,

Additional, session flag won’t be presented in URC message +QMTCONN. You could try to publish a topic your subscribed in previous session.

image

Best Regards,