What am I doing wrong?

Total Rust newbie here and am trying to branch out from the Rust book. I am trying to publish a message to my MQTT server and am follow the example at:


I've copied this exactly and just changed the string "localhost" to my MQTT server's IP but every time I run it I get:

Unable to connect: Paho(-1)

Any ideas on what I'm doing wrong? I don't know what it is about Rust but it seems that none of the example I find work. It's like there is something else that is needed that everyone but me knows. (Sorry, just venting...)

Any thoughts on this are appreciated. Oh, and yet, the MQTT server is accessible and running. I can publish to it from Python or the MQTT Explorer at the same URL I'm using in the Rust app:



One thing I would try is using Wireshark to see the differences between the python and rust clients?

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.