In this post, we're going to have a look on how to work with MQTT and Csharp. Creating a Broker and a Client that sends data to it.
But first...
...
For further actions, you may consider blocking this person and/or reporting abuse
Great example and got me going quick and simple. Needs updating to the latest version of mqtt, but a fantastic start.
This is a clear and simple guide for getting started with MQTTnet, Thanks.
I am looking at using it for sending Telemetry to an Azure IoT Hub. The only chenages I have made thus far are:
IOT_CONFIG_IOTHUB_FQDN is of the form HUB_NAME.azure-devices.net
It "works" OK but doesn't report connect/non connection, but doesn't fail.
Does report non connection if incorrect Hub FQDN is used.
I understand I have to create a secure connection using the SAS key or connection string.
Any ideas of how to proceed? I can manually get the SAS key so can skip that code.
Thx in advance.
Nb: Can attempt to send messages. They do get queued.
Have improved my code. Got to work out Authentication:
thanks
Thanks for this code example! 👍
In github code, you have
ApplicationMessageReceivedHandler
which is probably never called in this sample. (not working for me localy)Nice article, Could you please give tutorial or article on enabling TLS on MQTT communication? also explain more on port 8883. It helps
Thanks.
Hi: Is there anyway to poll the Topic and payload instead of using event?
or the broker will send the message periodically ?
How to connect Client to Broker remotely on two different devices?
According to the documentation there are multiple protocol communication you can use, such as websocket, socket and even http.
Check out the documentation for more details