[M467 | M487] Connect to Azure IoT using Connection String on NuMaker board and Mbed OS

Post Reply
morgandu
Posts: 45
Joined: 28 Apr 2017, 22:47

22 Mar 2024, 14:02

[For further inquiries, please e-mail to shchen2@nuvoton.com]
[Visit https://www.nuvoton.com/iot_startup for more IoT solutions]


We have ported an example of connecting NuMaker development boards to Azure IoT services using Mbed OS. The example can be found at https://github.com/OpenNuvoton/NuMaker- ... PS-example.

This example utilizes Azure DPS (Device Provisioning Service) authentication for device deployment. While it is possible to obtain various parameters following the Azure documentation step by step, it can be somewhat cumbersome. Azure IoT also offers another method using a connection string. By configuring a connection string, it is also possible to connect to Azure IoT.

The example mentioned above defaults to using DPS but also supports the connection string method with a slight modification as outlined below.

Simply modify the mbed_app.json file:
  • Change the value of use_dps to null.
  • Remove two macros: "USE_PROV_MODULE" and "HSM_AUTH_TYPE_CUSTOM"
  • Place your Connection String to value of iothub_connection_string

Code: Select all

"use_dps": {
    "help": "Enable connecting with IoT Hub via DPS",
    "options": [null, true],
    "value": null,
    "macro_name": "USE_PROV_MODULE_FULL"
},

"macros": [
],

"iothub_connection_string": {
    "help": "Device connection string for IoT Hub authentication (NO DPS)",
    "value": "\"Place your obtained IOTHUB_CONNECTION_STRING here\""
}
If you are not familiar with the Mbed Studio development environment, please refer to the forum article (viewtopic.php?f=33&t=11139) for a basic understanding after trying the operation once.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 90 guests