Topic: PIC32 MQTT state machine stuck upon router power cycle
I have a question regarding MQTT with PIC32 Harmony v1.08.
My APP state machine connects very well to MQTT broker.
The problem arises when we run a test that network shuts down (router is powered off and then back on again).
Most of the time the APP state machine recovers, but sometimes not.
The sequence being executed is:
1. TCPIP stack Initialization
2. polls on the state that has rc = MqttClientNet_Init(); until rc == MQTT_CODE_SUCCESS and then moves on to the next state.
3. polls on the state that has MqttClient_Init(); until rc == MQTT_CODE_SUCCESS and then moves on to the next state.
4. polls on the state that has MqttClient_NetConnect().
When the system fails, MqttClient_NetConnect() returns rc == MQTT_CODE_CONTINUE forever and never gets MQTT_CODE_SUCCESS.
Is there any race here between physical network connection and attempt to connect to broker?
I need some help. If pieces of code are required i can upload them.