.NET nanoframework demonstration as a client for Azure EventGrid support for MQTT
this Visual Studio project demonstrates how to connect to the EventGrid cloud MQTT broker for:
- Connect
- Send data to a topic
- Receive data on a topic
If everything is set up correctly, you get a flow like:
You need three certificates:
- The public TLS certificated for the connection to the broker based on DigiCert Global Root G3
- Private client certificate
- Public client certificate
This new EventGrid namespace feature is now demonstrated too (you need to update your m2mqtt library if needed).
Notice the willRetain flag is set to false. That feature is not supported yet by the EventGrid namespace.
If the device connection is interrupted (eg. power is down) a message like this is shown:
A demonstration of how to set up the MQTT Broker in Event Grid is seen here
This post from Roman Kiss helped me with the client credentials.