

- #Mqtt docker tutorial install#
- #Mqtt docker tutorial update#
- #Mqtt docker tutorial software#
- #Mqtt docker tutorial code#
#define TOPIC "devices/" DEVICEID "/messages/events/" #define USERNAME IOTHUBNAME "./" DEVICEID "/?api-version=&model-id=dtmi:com:example:Thermostat 1"

#define USERNAME IOTHUBNAME "./" DEVICEID "/?api-version=" You pass the model ID as querystring parameter in the USERNAME and change the api-version to : // computed Host Username and Topic In this sample, you add a model ID to the MQTT connection packet. If a device sends a model ID when it connects, it becomes an IoT Plug and Play device. IoT Plug and Play device must follow a set of simple conventions. Make the device an IoT Plug and Play device In Azure IoT explorer, you can see that the device isn't an IoT Plug and Play device: Run the application (Ctrl+F5), after couple of seconds you see output that looks like:
#Mqtt docker tutorial code#
Verify the code is working correctly, by starting Azure IoT explorer, start listening the telemetry. Use the part of the connection string from SharedAccessSignature sr= through to the end.
#Mqtt docker tutorial update#
Update the connection information definitions with the device details you made a note of previously. In the TelemetryMQTTWin32 project, open the MQTT_Mosquitto.cpp source file. In Solution Explorer, right-click on the TelemetryMQTTWin32 project and select Set as Startup Project. To view the sample code in Visual Studio, open the MQTTWin32.sln solution file in the IoTMQTTSample\src\Windows folder. Update the code with details of your IoT hub and device before you build and run it. Migrate the sample to IoT Plug and Play Review the non-IoT Plug and Play sample code Use the following command to download and build the Eclipse Mosquitto library. You need an elevated command prompt when you run vcpkg integrate install: cd vcpkg

Use the following commands to prepare the vcpkg environment. Use the following command to clone the Vcpkg repository to a suitable location on your local machine: git clone Use the vcpkg tool to download and build the Eclipse Mosquitto library. Use the following command to clone the sample repository to a suitable location on your local machine: git clone

#Mqtt docker tutorial install#
#Mqtt docker tutorial software#
To complete this tutorial on Windows, install the following software on your local Windows environment:
