Developer Portal Community

    Showing results for 
    Search instead for 
    Did you mean: 

    SentDataOverMQTT in Workbench 3.6.1 - how to connect to public broker?

    Established Member

    SentDataOverMQTT in Workbench 3.6.1 - how to connect to public broker?

    I'm using workbench 3.6.1.

    I want to send my data to a public broker so Im connected thru WiFi successfuly but Im failing to connect to a broker.

    I'm using SentDataOverMQTT with below setting but it is failing to connect


    #define APP_MQTT_BROKER_HOST_PORT UINT16_C(1883)

    Can you help? how to connect to a public broker with UserId  & Password? can you share a sample to follow? 

     I want to connect with userid/password by adding this to struct MQTT_Connect_T, .....Is this sufficient?

    static MQTT_Connect_T MqttConnectInfo =
    .ClientId = APP_MQTT_CLIENT_ID,
    .UserNameId = APP_MQTT_USER_NAME,
    .PasswordId = APP_MQTT_PASSWORD,
    .CleanSession = true,
    .KeepAliveInterval = 100,
    };/**< MQTT connect parameters *

    Documentation is outdated and can't be followed.



    2 REPLIES 2
    Long-established Member

    Re: SentDataOverMQTT in Workbench 3.6.1 - how to connect to public broker?

    Hi Nicolas,

    With the workbench template application it is possible to connect to public Mqtt Broker.

    - Your WiFi network need to have internet connection.

    I used my mobile wifi hotspot and taken screenshot for your reference. See attachment MqttPublicBroker.jpg.


    - In attachment XDK device is connected with HiveMQ broker, publish and subscribe are happening.

    - From another websocket mqtt client I published test message to XDK device and it received the message.

    - By using this public broker unable to see published sensor data, because it has not supported. It seems paid version supports which we have not used.

    - We used mosquitto test servers installed locally and verified using mosquitto_sub.exe.

    The template application SendDataOverMqtt has secure mqtt connection (mqtts in port 8883) feature. But it uses certificates.

    For user name and password implementation refer MQTT_ConnectToBroker API, implement like clientID, also refer Serval_Mqtt.h.

    Thank You 🙂

    Established Member

    Re: SentDataOverMQTT in Workbench 3.6.1 - how to connect to public broker?

    Thanks for your feedback. Great!