I am using MQTT with Azure IoT over a cellular modem using PPP. Overall it is working pretty well. Occasionally I get errors and MQTT dies when I try to check the signal strength of the cellular connection periodically.
To check the signal strength I do the following:
networkController.Suspend(); //send +++ to modem to enter command mode //wait for 'OK' from modem //get signal strength and connection status // issue "ATO\r\n" to re-enable PPP //Wait for CONNECTED from the modem networkController.Resume()
During that time I suspend sending any new traffic over MQTT or network.
However, I still think the MQTT library is attempting to send traffic while the modem is in command mode causing socket errors.
Before I dig into the MQTT library to come up with some way to suspend traffic while doing the signal check does anyone have any other suggestions or ways to solve this?