The demo application includes a set of tools in
../apps/azure_cloud/tools folder. It enables easy creation
of certificate infrastructure and individual device certificates with very
minimal user inputs.
Note:
On Windows Operating
Systems, make sure the GitBash is installed to
run these tools.
Right click and open the
Git Bash in the tools folder
Run the
create_initial_setup.sh as illustrated in the following
figure. It will request the user to provide the domain suffix and common
name for Root CA.
Up on successful
execution of above command, following three new folders will be
created
Device Certificate
Run the create_device_certificate.sh to create
individual device certificate. It requests the user to provide
Subordinate/Intermediate CA folder name and a unique device id (Common
Name).
Note:
Note down the information of device ID or common name for
later use in Azure configuration.
In order to modify the default subject identifier
information, open the
create_device_certificate.sh and update
the following macros.
On successful execution of device certificate, a new folder is created
inside the ../tools/devcerts folder as illustrated in
following figure
Note: Note down the information of
certificate and key file names (by default device ID or common name)
for use later in the Azure TLS configuration
Use the PC companion mode
of the setup and program the .pem and * .key* files (highlighted/marked
below) using file_upload tools. For more details on file_upload tools,
refer to the 7.1 Certificate and Key Utility
Creating a Microsoft Azure Account and Azure IoT Central Application
Select the application
and navigate to Permision>Device connection groups
Note down the information
of ID scope and click + New as illustrated above to create an
enrollment group
Provide a name for the
enrollment group and select Attestation Type as Certificates
(X.509)
Save the enrollment group
and click on Primary>Manage primary to manage the
Primary certificate and select the subordinate CA certificate
generated in the Step 1 (Create a Root of Trust Chain for RNWF Devices)
subca.crt certificate inside the
subca folder.
Mount the AVR128DB48 Curiosity Nano host
board and the RNWF02 Add On Board on
Curiosity Nano base board at respective headers. For more details about
the boards placement in the Curiosity Nano base, see Figure 6-1.
Connect the debugger USB port on the AVR128DB48 Curiosity Nano board to computer using a micro USB
cable
Open the project and launch MCC with Melody Content Manager Tool
Configure Home-AP credentials for STA mode, using the Wi-Fi settings
configuration. For more details about the Wi-Fi settings configuration,
See Figure 3-14.
Update the Azure Cloud configuration with following details. For more
details about the Azure Cloud configuration, See Figure 3-21
ID Scope noted in
Step 3.g (Creating a Microsoft Azure Account and Azure IoT Central
Application, see Figure 6-49), update this scope ID in Azure Cloud configuration as
illustrated below
Unique Device ID
(Common Name) noted in Step 2.a (Device Certificate, see Figure 6-41), update this Unique Device ID
in Azure Cloud configuration as illustrated below
Device
Certificate and Key file names noted in Step 2.c
(Device Certificate, see Figure 6-43), update this in Azure Cloud
configuration as illustrated below
Generate the code as illustrated below
Build and program the code to the hardware using MPLAB X IDE
Open the Terminal
application (for example: Tera Term or PuTTY) on the PC
Connect to the host board
COM port and configure the serial settings as follows:
Baud:
115200
Data: 8
Bits
Parity:
None
Stop: 1
Bit
Flow
Control: None
Press the SW0 (Soft Reset) button on the host board, see Figure 6-1.
As the board boots up, application will list available certificates and
keys on RNWF02 board. The board will
connect to Home-AP configured. After this, the demo will attempt to
connect to Azure IoT Hub (using link configured) and starts sending the
telemetry
After the successful connection to Azure IoT Central, the device gets
listed in the Azure Central
Applicaiton> Devices view.
Click on the device name to view the device About, Overview, Commands,
Raw data tabs as follows
The Overview tab shows
the default Telemetry graph, the Overview can be modified by adding
other parameters through the Device
Templates>(Model)>Views>Overview
New views can be added
through the Device Templates>(Model)>Views
Example add a
Properties View tab and all the properties, now through the
Properties view one can change the LED status on the board
and Telemetry Reporting Rate. Make sure to Save the new
values.
The Commands view can be used to trigger a device Reset at a given time
in the ISO format (Example PT5S for 5 seconds) or to send messages
(echoed from device) to the device.
The SW0 press from the device will be notified to the Azure Cloud in the
Raw data view
The online versions of the documents are provided as a courtesy. Verify all content and data in the device’s PDF documentation found on the device product page.