espressif / esp-aws-iot

AWS IoT SDK for ESP32 based chipsets
Apache License 2.0
257 stars 154 forks source link

MQTT demo mutual authentication - mqtt connect broken session (brokerSessionPresent) return true (CA-219) #120

Open YogeshG30 opened 2 years ago

YogeshG30 commented 2 years ago

Dear All,

We are referring MQTT demo mutual authentication from C SDK Beta and Master link below. https://github.com/espressif/esp-aws-iot/tree/release/beta https://github.com/espressif/esp-aws-iot

As per functionality createCleanSession = true after Power ON. From second connection it always remain false returnStatus = establishMqttSession( pMqttContext, createCleanSession, &brokerSessionPresent );

brokerSessionPresent we are expecting false in case PUBACK received for sent packet. But we observed, for first 2 connection brokerSessionPresent received as False. For later connection it returned as True. We confirmed PUBACK received for all sent packet.

Since brokerSessionPresent received as True, handlePublishResend used to get initiated.

What is the reason for which brokerSessionPresent received as True for third onwards establishMqttSession connection, even PUBACK received for earlier transfer?