This application shows you how to connect your Wio Terminal from Seeed to Azure IoT Hub. It is built on top of the Azure SDK for Embedded C, a small footprint, easy-to-port library for communicating with Azure services.
As the Wio Terminal is one of PlatformIO's (many!) supported platforms, the application is conveniently made available as a PlatformIO project. This means that you don't have to worry about installing the multiple Arduino libraries the Wio Terminal requires for Wi-Fi & TLS, and you don't need to manually install any other third-party library either! All dependencies are automatically fetched from Github by the PlatformIO Library Manager.
The following table summarizes supported device attestation/authentication methods :
Service | Enrollment | Authentication | Support status |
---|---|---|---|
Azure IoT Hub | - | Symmetric Key | Need recompile |
Azure IoT Hub | - | X.509 Self-Signed | Not Supported |
Azure IoT Hub | - | X.509 CA-Signed | Not Supported |
Azure IoT DPS | Group | Symmetric Key | Supported |
Azure IoT DPS | Group | CA Certificate | Not Supported |
Azure IoT DPS | Group | Intermediate Certificate | Not Supported |
Azure IoT DPS | Individual | Symmetric Key | Supported |
Azure IoT DPS | Individual | X.509 | Not Supported |
Azure IoT DPS | Individual | TPM | Not Supported |
Please follow instruction at Wio Terminal's network overview page to update the firmware.
You must use the version of Wi-Fi firmware specified in Azure IoT Firmware. See the release page.
If you use provisioning service, skip this section.
include/config.h
in text editor.#define USE_CLI
.If you DON'T use provisioning service, skip this section.
include/config.h
in text editor.#define USE_CLI
.#define USE_DPS
.Use the PlatformIO IDE (VS Code extension) or the PlatformIO command-line interface to deploy the application to your Wio Terminal.
Once running, the application will connect to IoT Hub and:
ringBuzzer
command that, when triggered from the Cloud will... ring the buzzer! The duration is provided as a command parameter.You can use the Azure IoT Explorer to test that your Wio Terminal is properly connected to Azure IoT Hub, i.e that it is regularly sending telemetry data, and responding to commands.
To check that telemetry data is correctly sent, you will want to subscribe to the telemetry feed of your device. Since this code leverages IoT Plug and Play, Azure IoT Explorer will provide you with extra information regarding the data model for your acceleration sensor data (e.g the unit of measurement being "g") if you enable the "Show modeled events" option.
In order to send the ringBuzzer
command, head over to the "Commands" section of the IoT Plug and Play default component of your device, enter a duration, and send the command.
Note: As of today, the Azure SDK for Embedded C is still being actively developed, therefore, it hasn't been officially released as an Arduino or PlatformIO library. To make it easier for you to get started, the Azure IoT client libraries have been included in the lib/azure-sdk-for-c
folder. You can synchronize them with the latest version from the Embedded C SDK github repository by running the lib/download_aziot_embedded_c_lib.sh
script.
You can read more on the Azure IoT client library here, but in a nutshell, here's what had to be done to get the Wio Terminal connected:
mbedtls_md_hmac_starts
) and perform base64 encoding (ex. mbedtls_base64_encode
).PubSubClient
MQTT library from Nick O'Leary.ringBuzzer
command to actual embedded code that rings the buzzer.👤 Benjamin Cabé
👤 Seeed K.K.
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a ⭐️ if this project helped you!
Copyright © 2020 Benjamin Cabé.
Copyright © 2020 Seeed K.K.
This project is MIT licensed.
This README was generated with ❤️ by readme-md-generator