cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 MCU to MQTT server using( ESP8266)

Vivek Rajamanickam
Associate II

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

3 REPLIES 3
Andrew Neil
Chief II

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

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.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..

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!!

https://www.avrfreaks.net/comment/2139451#comment-2139451