page_type | languages | products | name | description | |||
---|---|---|---|---|---|---|---|
sample |
|
|
IoT MQTT Samples |
Using MQTT with Azure IoTHub without SDK |
This set of samples will demonstrate how to connect and send messages to an Azure IoT Hub without using the Azure IoT SDKs.
Read the Communicate with your IoT Hub using the MQTT protocol for detailed instructions on connecting your device to IoT Hub using MQTT without an SDK.
Azure provides a set of SDKs across multiple languages for connecting device to IoT Hub and DPS. The advantages of using an Azure IoT Device SDK over building a custom connection layer are outlined below:
Custom connection layer | Azure IoT Device SDKs | |
---|---|---|
Support | Need to support and document your solution | Access to Microsoft support (GitHub, Microsoft Q&A, Microsoft technical documentation, Customer Support teams) |
New Features | Need to manually add new Azure features | Can immediately take advantage of new features added |
Investment | Invest hundreds of hours of embedded development to design, build, test, and maintain a custom version | Can take advantage of free, open-source tools. The only cost associated with the SDKs is the learning curve. |
For more information, refer to the Overview of Azure IoT Device SDKs.
This repository contains the following samples:
Note Azure IoT services are moving to a new CA root, see here for details.
The following root certificates are provided in the repository root:
Certificate | Path | Description |
---|---|---|
Baltimore CyberTrust Root | BaltimoreCyberTrustRoot.crt.pem | Current Root CA set to expire in 2025 |
DigiCert Global Root G2 | DigiCertGlobalRootG2.crt.pem | Future Root CA which will become active in Feb 2023 |
To be able to run these samples the following general prerequisites are needed:
- Clone this repository
- Install the Azure CLI
- Provision an IoT Hub in your Azure subscription
- Register a device within your IoT Hub
- Generate a SAS token for the device using the Azure CLI
Note By default the SAS Token is valid for 60 minutes. Use the --du parameter to increase if needed.
Additional prerequisites may be required by each individual sample.
For details on contributing to this repository, see the contributing guide.
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets Microsoft's definition of a security vulnerability, please report it to the Microsoft Security Response Center.