Simple tutorial to connect the B-U585I-IOT20A Development kit to Azure IoT Hub.
Introduction:
In this article, we connect the B-U5U5I-IOT20A discovery board to Azure IoT Hub. IoT Hub is a cloud-hosted application that allows you to communicate with your IoT devices, understand their state and keep them up to date.
The B-U5U5I-IOT20A discovery board is a IoT development board composed of a low power microcontroller, a Wi-Fi Radio, and sensors such as temperature and humidity, a magnetometer, accelerometer, gyroscope, pressure, Time-of-Flight, and gesture-detection.
RequirementsGeneral requirements:
- An active Azure subscription (click here to create one)
- X-CUBE-AZURE downloaded and extracted do your C:/ Drive
Hardware requirements:
- B-U5U5I-IOT20A discovery board
- Type-A to male Type-B Micro-USB cable
- 2.4GHz Wi-Fi Router (No Captive Portal)
- Windows PC
Software requirements (Installed via Quick Setup Script):
- STM32CubeProgrammer
- X-CUBE-AZURE
- Python with Pip
- Azure CLI
- Edge or Chrome
ProcedureConfigure PowerShell:
- Open PowerShell
- Set execution policy
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
|
- Enter ‘y’ to accept the execution policy changes
Install the dependencies:
-
cd C:\STM32CubeExpansion_Cloud_AZURE_V2.2.0\Projects\B-U585I-IOT02A\Applications\TFM_Azure_IoT\AzureScripts\STM32U5_AZURE_QuickSetup
|
Navigate to the directory containing setup material
-
Rename-Item .\STM32U5_AZURE_QuickSetup.ps1.txt .\STM32U5_AZURE_QuickSetup.ps1
|
Rename Quick Setup script
- Run the setup script. The following command programmatically installs all the required software.
.\STM32U5_AZURE_QuickSetup.ps1
|
Run The Quick Connect:The Quick Connect script programmatically configures both the cloud and the discovery kit. After a successful execution of the script, the device will be provisioned with Azure IoT hub and communicating telemetry data to the cloud. \
-
cd C:\STM32CubeExpansion_Cloud_AZURE_V2.2.0\Projects\B-U585I-IOT02A\Applications\TFM_Azure_IoT\AzureScripts
|
Navigate into correct working directory:
- Run the script with -i argument:
Python .\STM32U5_AZ_IotHub_QC.py -i
|
- Enter your Configuration Credentials:
- Login to your Azure Account:
- Monitor Script execution
Next StepsTo view data in a customizable Web interface, follow this tutorial.