cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H573I-DK board use MQTT over websocket to connect to Azure IoT Hub

ma75850
Associate

I want to connect my STM32H573I-DK to Azure IoT Hub via MQTT over websocket to avoid firewall complications.

For that I am using STM32CubeExpansion_Cloud_AZURE_H5_V1.1.0 project (https://www.st.com/en/embedded-software/x-cube-azure-h5.html)

I added NXD_MQTT_OVER_WEBSOCKET to the preprocessor and added ../../../../../../../Middlewares/ST/netxduo/addons/websocket path to include paths to activate MQTT over websocket. 

 

I still got connection issues: [ERROR] IoTHub client connect fail: MQTT CONNECT FAIL status: 65541
Disconnected from IoTHub!: error code = 0x00010005
Reconnecting iothub, after backoff

I debugged it to see that the nx_tcp_socket_receive throws an error 56. 

 

Is there any explanation on how to use MQTT over websockets in that specific scenario or does somebody has experience with that? Or somebody who can help me in different way?

2 REPLIES 2
Billy OWEN
ST Employee

Hi @ma75850 

 

This post has been escalated to the ST Online Support Team for additional assistance.  We'll contact you directly.

 

Regards,

Billy


@ma75850 wrote:

I want to connect my STM32H573I-DK to Azure IoT Hub via MQTT over websocket to avoid firewall complications.


Shouldn't MQTT work through firewalls on a plain TCP socket?

 

PS:

Anyhow, see:

https://community.st.com/t5/stm32-mcus-embedded-software/websocket-connection-to-a-public-domain-through-wiznet-5500-and/m-p/710828/highlight/true#M50658

and check out other threads from the 'Related Content' box to the right -->

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.