CLEAN_SESSION Not work

I have problems when I connect to my mqtt broker, it looks like it doesn't do a CLEAN_SESSION.. according to server logs.. I see when I connect to test clients ( pc ) with CLEAN_SESSION then it clearly appears in the log. This creates a lot of problems e.g. the client id is not registered by mqtt broker.. etc..


conntions from nrf7002 is not clean=1 and not completed normally

Here log from my 7002 

connection.log:2025-02-23T05:52:07.044Z Connection tcpiop.1 CWLNA1117 I: Create mqtt connection: ConnectionID=599 ClientID="_85.166.49.173_dS9ZdNyj" Endpoint="mqtt-ssl-ldap" UserID="demo24" CommonName="" Durable=0.

connection.log:2025-02-23T05:52:07.247Z Connection tcpiop.1 CWLNA2202 W: A message consumer could not be created due to an authorization failure: ConnectionID=599 ClientID="_85.166.49.173_dS9ZdNyj" Protocol="mqtt4-tcp" Endpoint="mqtt-ssl-ldap" UserID="demo24".


this log from working test client ( pc mosquitto ) 

-connection.log:2025-02-23T20:12:14.118Z Connection tcpiop.1 CWLNA1117 I: Create mqtt connection: ConnectionID=3199 ClientID="41675380" Endpoint="mqtt-ssl-ldap" UserID="rb3" CommonName="" Durable=0.
-connection.log:2025-02-23T20:12:14.164Z Connection tcpiop.1 CWLNA1111 N: Closing TCP connection: ConnectionID=3199 MonitorID=3199 ClientID="41675380" Protocol=mqtt4-tcp Endpoint="mqtt-ssl-ldap" From=[85.166.49.173]:59917 UserID="rb3" Uptime=0 RC=0 Clean=1 Reason="The connection has completed normally." ReadBytes=818 ReadMsg=1 WriteBytes=2,141 WriteMsg=0 LostMsg=0 WarnMsg=0.

# MQTT
CONFIG_MQTT_LIB=y
CONFIG_MQTT_CLEAN_SESSION=y
CONFIG_MQTT_LOG_LEVEL_DBG=y

Is this a known problem? Is there any way to get a receipt that it is sending with a clean session? Does anyone have any suggestions?

Parents
  • This is how it should look:

    2025-02-25T20:44:47.925Z Connection   tcpiop.1   CWLNA1117 I: Create mqtt connection: ConnectionID=149 ClientID="fota2025" Endpoint="mqtt-ssl-ldap" UserID="rb3" CommonName="" Durable=1.
    2025-02-25T20:44:47.962Z Connection   tcpiop.1   CWLNA1111 N: Closing TCP connection: ConnectionID=149 MonitorID=149 ClientID="fota2025" Protocol=mqtt4-tcp Endpoint="mqtt-ssl-ldap" From=[85.166.49.173]:60783 UserID="rb3" Uptime=0 RC=0 Clean=1 Reason="The connection has completed normally." ReadBytes=804 ReadMsg=1 WriteBytes=2,141 WriteMsg=0 LostMsg=0 WarnMsg=0.
    This is what it looks like from my code SDK ( 7002)
    2025-02-25T19:41:22.277Z Connection   tcpiop.1   CWLNA1117 I: Create mqtt connection: ConnectionID=3 ClientID="_85.166.49.173_pNRYdSlW" Endpoint="mqtt-ssl-ldap" UserID="demo24" CommonName="" Durable=0.
    2025-02-25T19:41:22.480Z Connection   tcpiop.1   CWLNA2202 W: A message consumer could not be created due to an authorization failure: ConnectionID=3 ClientID="_85.166.49.173_pNRYdSlW" Protocol="mqtt4-tcp" Endpoint="mqtt-ssl-ldap" UserID="demo24" here is missing ->>>Uptime=0 RC=0 Clean=1 Reason="The connection has completed normally." ReadBytes=804 ReadMsg=1 WriteBytes=2,141 WriteMsg=0 LostMsg=0 WarnMsg=0.


    Even though CONFIG_MQTT_CLEAN_SESSION=y was turned on in the code it shows Durable=0, next line stop after "userid" part. 

Reply
  • This is how it should look:

    2025-02-25T20:44:47.925Z Connection   tcpiop.1   CWLNA1117 I: Create mqtt connection: ConnectionID=149 ClientID="fota2025" Endpoint="mqtt-ssl-ldap" UserID="rb3" CommonName="" Durable=1.
    2025-02-25T20:44:47.962Z Connection   tcpiop.1   CWLNA1111 N: Closing TCP connection: ConnectionID=149 MonitorID=149 ClientID="fota2025" Protocol=mqtt4-tcp Endpoint="mqtt-ssl-ldap" From=[85.166.49.173]:60783 UserID="rb3" Uptime=0 RC=0 Clean=1 Reason="The connection has completed normally." ReadBytes=804 ReadMsg=1 WriteBytes=2,141 WriteMsg=0 LostMsg=0 WarnMsg=0.
    This is what it looks like from my code SDK ( 7002)
    2025-02-25T19:41:22.277Z Connection   tcpiop.1   CWLNA1117 I: Create mqtt connection: ConnectionID=3 ClientID="_85.166.49.173_pNRYdSlW" Endpoint="mqtt-ssl-ldap" UserID="demo24" CommonName="" Durable=0.
    2025-02-25T19:41:22.480Z Connection   tcpiop.1   CWLNA2202 W: A message consumer could not be created due to an authorization failure: ConnectionID=3 ClientID="_85.166.49.173_pNRYdSlW" Protocol="mqtt4-tcp" Endpoint="mqtt-ssl-ldap" UserID="demo24" here is missing ->>>Uptime=0 RC=0 Clean=1 Reason="The connection has completed normally." ReadBytes=804 ReadMsg=1 WriteBytes=2,141 WriteMsg=0 LostMsg=0 WarnMsg=0.


    Even though CONFIG_MQTT_CLEAN_SESSION=y was turned on in the code it shows Durable=0, next line stop after "userid" part. 

Children
No Data
Related