cancel
Showing results for 
Search instead for 
Did you mean: 

MQTT : mqtt_client_connect() don't set user and password !

tarzan2
Associate III

Hello,

After loosing days trying to implement paho mqtt with lwip and freeRTOS on a nucleo-F207ZG, I restarted from scratch and try do implement it in bare-metal mode.

After a few hour of debug, using wireshark and mosquitto on a PC :

- Connecting to the broker as anonymous works

- Connecting to the broker with user/pwd fails.

Wireshark shows that there is no user/pwd on the CONNECT packet and the associated flags are reset.

The official mqtt_client_connect() looks quite strange : it does not take care of the eventual user/pwd provided in argument (mqtt_connect_client_info_t *client_info)

Flags are set to MQTT_CONNECT_FLAG_CLEAN_SESSION, and user/pwd are never used by this function.

 

Is the provided MQTT file is just a demo file with limited functionalities ?

Thank you

Regards

 

1 REPLY 1
MStackDev_376
Associate II

Hello tarzan2,

I've experienced issues with the Paho client's implementation before, as well.

As an alternative that you can try to solve this problem, I put up a simple solution that can be used as a head start (since you mentioned you lost so much time debugging, it should save you a lot of time).

It's a bare-metal application running a simple MQTT client. You can test this and then build upon it to achieve your objectives. It is based on the Mongoose networking library (which includes support for MQTT and can be used as an alternative to the Paho MQTT implementation) and it should work straight out-of-the-box for the F207 board.

Hope this helps you and let me know if you encounter any issues.
https://github.com/mongoose-examples/st-f207-baremetal-mqtt-client

Regards