2024-10-23 7:34 PM - edited 2025-03-13 7:57 PM
2024-10-24 1:13 AM
@QuangIoT wrote:I'm facing an issue connecting STM32 to the MQTT broker
What MQTT broker?
How are you trying to connect: Ethernet? WiFi? Other?
Are you sure that the basic IP connection is working?
Are you sure that your login/connection credentials & settings are correct?
@QuangIoT wrote:the mqttstatus only reaches MQTT_CONNECT and then returns to MQTT_START instead of progressing to MQTT_RUNNING.
Sounds like the connection is failing
2024-10-24 1:30 AM - edited 2025-03-13 7:57 PM
I'm using HiveMQ with Ethernet.
I'm certain it's working because I can ping that IP address.
When I log the status, it shows the connection state, but it doesn't reach the running state to send/receive data.
2024-10-24 1:45 AM
@QuangIoT wrote:I'm using HiveMQ with Ethernet.
So have you resolved this question yet: https://community.st.com/t5/stm32-mcus-embedded-software/send-a-message-to-hivemq/td-p/733865 ?
@QuangIoT wrote:I'm certain it's working because I can ping that IP address.
So that's the basic IP connection.
Successful ping is certainly necessary - but may not be sufficient.
@QuangIoT wrote:When I log the status, it shows the connection state, but it doesn't reach the running state
So look at what's necessary to get from 'connected' to 'running', and see where that's failing.
Is the connection dropping?
2024-10-24 1:51 AM
I have solved the previous issue, but with this one, I still don't know why it can't reach the running state. I also haven't found a solution for this problem yet.
2024-10-24 2:14 AM - edited 2024-10-24 2:40 AM
@QuangIoT wrote:I have solved the previous issue, .
Then please mark the solution in that thread:
https://community.st.com/t5/community-guidelines/help-others-to-solve-their-issues/ta-p/575256
@QuangIoT wrote:I still don't know why it can't reach the running state.
Again, look at what's necessary to get from 'connected' to 'running', and see where that's failing.
Is the connection dropping?
Have you used Wireshark or similar to see what's happening on the Ethernet?
https://www.google.com/search?q=Wireshark+mqtt+debugging
Can you enable extra logging at the client?
Are there logs available at the Broker end?