2018-10-25 04:43 AM
I am trying to connect my microcontroller STM32F429IGT to CloudMQTT using ESP8266 wifi module. Our wifi module has successfully connected to the router when I tried to connect to MQTT server using AT Command it is not getting connected. It is showing error instead.
I have attached my AT code which I used to connect my MCU
2018-10-25 06:18 AM
Before involving the STM32 (or any other microcontroller) have you established how to do this manually - issuing commands on a terminal?
And before involving the embedded WiFi, have you been through the CloudMQTT documentation and 'Getting Started' process: https://www.cloudmqtt.com/docs.html
2018-10-25 08:43 AM
Your code just ploughs along with out any respect for the messages and responses to the AT commands.
When dealing with AT Modems, you can't just pick arbitrary delays, you have to check for OK, and if ERROR or other messages come back you might need to retry, or wait querying status about whether a link or connection is viable before proceeding.
>> It is showing error instead.
What error, where? You don't even show an interaction log with the part to know where to even start debugging the issue.
2018-10-25 08:53 AM
As @Community member says, you can't just rely on "blind" delays!
That's like driving down the street blindfold and just relying on time delays to turn the wheel!!