The SAM-IoT Wx v2 Development board based on the SAM D21 microcontroller (MCU) is a small and easily expandable demonstration and development platform for Wi-Fi-based IoT Node applications. This specific development board can be provisioned for Azure IoT Core; The application demonstrates MQTT data transfer of onboard light and temperature sensor data to Microsoft Azure IoT core.
The board is referred to as SAM-IoT WZ v2 Development Board when provisioned for Microsoft Azure cloud IoT.
This project has been verified to work with the following versions of software tools:
Refer Project Manifest present in harmony-manifest-success.yml under the project folder firmware/src/config/samd21_wz_iot_v2
Because Microchip regularly update tools, occasionally issue(s) could be discovered while using the newer versions of the tools. If the project doesn’t seem to work and version incompatibility is suspected, It is recommended to double-check and use the same versions that the project was tested with. To download original version of MPLAB Harmony v3 packages, refer to document How to Use the MPLAB Harmony v3 Project Manifest Feature
In order to run the Azure demo an Azure account is required. This document describes the steps required to obtain and configure an Azure account for the demo.
Azure provides computing services for a fee. Some are offered for free on a trial or small-scale basis. By signing up for your own Azure account, you are establishing an account to gain access to a wide range of computing services.
Create Azure account Go to Azure Portal and follow instructions to create your own Azure account. If you already have an azure account, enter the credentials and log in.
Click Create a resource in the azure portal. If prompted for Create a Free account, Start Free account by clicking on Start Free. Once the account creation is complete, it starts over with above step. Select Create a resource again and continue with next steps.
Click Internet of Things and from that select IoT Hub
The new window prompts to select the subscription, Resource Group, Region and IoT Hub Name.
Click Review + create after entering all the details.
It will take you to the Review + create Tab, click Create to create an IoT Hub
It will start the IoT hub deployment process and it will take a while to create the IoT hub.
Click Go to resource and it will take you to the IoT Hub overview page.
Note down only your IoT Hub Hostname(exclude .azure-devices.net) and Subscription ID as highlighted below. The Hostname should be same as one created in Step 4.4
If this is the first time you are building/running this version of the demo, you must complete this step before proceeding further. Otherwise, you may skip this step.
Install TPDSv2(Trust Platform Design Suite version 2)
Launch Trust Platform Design Suite v2 from windows search bar, a
window launches as shown below
Select “Trust Platform Design Suite” in webviews
and Click on Usecases
In Select Security Solution, Under Use
Cases select Azure IoT Authentication
Scroll Down and in Available solution by provisioning
flow select Azure IoT Authentication under
TrustFLEX
A Usecase gets launched. click on Azure Connect-IoT
Auth-TFLEX from the Usescases
Azure Cloud Connect – IoT Authentication page launches as shown below
Scroll down and select EV62V87A Development board.
Connect SAM-IoT Wx v2 Development Board to PC running Trust Platform Design Suite
Ensure MPLAB X Path is set in File -> Preference under System Settings in TPDS. This helps to program the provisioner kit firmware to the SAM-IoT Wx v2 Development Board
Scroll down to transaction diagram
Click on Icon 1 and wait till a green right mark appears.
Click on Icon 2, This step takes you to Azure
Login page.Choose you Azure account and Login. After this you can see
the meesage Authentication completed. You can close this window
now in the browser.
Enter your subscription ID in the dialog box.
Enter the resource group in the dialog box(created in step 2 of create your own Azure account).If the entered resource group does not exists a new one is automatically created.
Enter your presviously created Azure IOT hub name .A new hub name is created when the entered hub name doesnt exists.This may take a few minutes.
The device is successfully registered into azure account after step 2
Proceed with step 3 and 4 to complete the usecase
If the SAM-IoT Wx v2 development board is glowing RED LED (Indicates ATWINC1510 Wi-Fi controller module firmware is not up to date), follow the below steps to upgrade the ATWINC1510 firmware. Otherwise(if it glows GREEN ), you may skip this step.
Click on C Source Folder in TPDS transcation diagram
In windows explorer, Applcation folder gets open
Click on utilities folder
Click on winc_provisioner.bat, It automatically downloads the ATWINC1510 firmware package and runs the necessary commands using the command prompt.
Select the communication (COM) port identified for “SAM-IoT Wx v2” development board from the drop down list and click OK
Wait till verify passed message comes up, as shown below, and then click on enter to close the command prompt; if it fails, reconnect the board and try again.
The following sections describes the steps to run the application.
Connect the SAM-IoT WZ v2 Development board to the host PC’s USB port to power-up the board.
Alternatively, the board can be powered using a Li-Po battery. The board must be connected through a USB port to perform a firmware upgrade or Wi-Fi configuration.
Once connected to a PC, a mass storage drive icon by the name CURIOSITY will appear.
Drag and Drop the hex file present in the samiot2_azure_cloud_core* folder or use MPLAB X IDE to Program. Check section Firmware upgrade and Wi-Fi configuration process** below for more detail
Configure the Wi-Fi Credentials using Wi-Fi configuration through CLI method explained Below
Click on MPLAB X Project. A project opens in MPLAB X IDE. Build and program the firmware
Download the latest version of the hex file from the hex folder.
Drag & Drop the downloaded .hex file onto the CURIOSITY drive.
This will automatically program the microcontroller with the provided .hex file. There is no need to open the MPLAB X IDE to program the .hex file.
Open a terminal application on the host PC for the virtual COM port of the connected SAM-IoT WA v2 Development board, with 9600-8-None-1 settings.
Just enter the below command to set the Wi-Fi
credentials.
wifi < SSID >,< PASSWORD >,< SECURITY TYPE >
example :
wifi microchip,microchip@123,2
Note : No need of repeating this step every time while running the demo, Device remembers last used WiFi credentials and tries to connect to it. If WiFi credentials changes, this step should be performed.
If the Wi-Fi network is active, then the SAM-IoT WZ v2 Development board establishes connectivity with the Wi-Fi network, sets the Blue LED, securely connects to the Azure IoT cloud, and sets the Green LED.
After a successful connection, the SAM-IoT WZ v2 Development board pushes the real-time light and temperature sensors data to the Azure IoT cloud page and toggles the Yellow LED. If not, Red LED glows, indicating ERROR.
Download and install Device Explorer application
Run Device Explorer from windows search bar
From the Azure Portal: click on your IoT Hub > Shared access polices > iothubowner > connection string-primary key > Copy to clipboard
Paste copied connection string-primary key to IoT Hub Connection String tab on device explorer.
Then click on Update
Click on Data Tab and press Monitor button
The real-time light and temperature sensors data from the Azure IoT cloud is fetched and displayed as shown below