Basically all you need can be found here. Tested and it worked with mosquitto

here is working sample to send message:

var client = new MqttFactory().CreateMqttClient();
var options = new MqttClientOptionsBuilder()
.WithTcpServer("", 1883)
.WithCredentials("bud", "%spencer%")

 System.Threading.CancellationToken cancellationToken;
        await client.ConnectAsync(options, cancellationToken);

        var message = new MqttApplicationMessageBuilder()
        await client.PublishAsync(message, cancellationToken);    

Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *