Home
%3CLINGO-SUB%20id%3D%22lingo-sub-1069589%22%20slang%3D%22en-US%22%3ECreate%26nbsp%3Ba%26nbsp%3BSecure%26nbsp%3BAzure%26nbsp%3BSphere%26nbsp%3BApp%26nbsp%3Busing%26nbsp%3Bthe%26nbsp%3BGrove%26nbsp%3BShield%26nbsp%3BSensor%26nbsp%3BKit%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1069589%22%20slang%3D%22en-US%22%3E%3CH1%20id%3D%22create-a-secure-azure-sphere-app-using-the-grove-shield-sensor-kit%22%20id%3D%22toc-hId-357670153%22%20id%3D%22toc-hId-357670153%22%3ECreate%20a%20Secure%20Azure%20Sphere%20App%20using%20the%20Grove%20Shield%20Sensor%20Kit%3C%2FH1%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F162117iE4CA2CA57770AAFD%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22clipboard_image_0.png%22%20title%3D%22clipboard_image_0.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CTABLE%3E%0A%3CTHEAD%3E%0A%3CTR%3E%0A%3CTH%20align%3D%22left%22%3EAuthor%3C%2FTH%3E%0A%3CTH%20align%3D%22left%22%3E%3CA%20href%3D%22https%3A%2F%2Fdeveloper.microsoft.com%2Fen-us%2Fadvocates%2Fdave-glover%3FWT.mc_id%3Dtech-communities-blog-dglover%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EDave%20Glover%3C%2FA%3E%2C%20Microsoft%20Cloud%20Developer%20Advocate%3C%2FTH%3E%0A%3C%2FTR%3E%0A%3C%2FTHEAD%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20align%3D%22left%22%3ETarget%20Platform%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3ESeeed%20Studio%20Azure%20Sphere%20MT3620%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20align%3D%22left%22%3EDeveloper%20Platform%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3EWindows%2010%20or%20Ubuntu%2018.04%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20align%3D%22left%22%3EAzure%20SDK%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3EAzure%20Sphere%20SDK%2019.11%20or%20better%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20align%3D%22left%22%3EDeveloper%20Tools%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3E%3CA%20href%3D%22https%3A%2F%2Fvisualstudio.microsoft.com%2Fvs%2F%3FWT.mc_id%3Dtech-communities-blog-dglover%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EVisual%20Studio%20(The%20free%20Community%20Edition%20or%20better)%3C%2FA%3E%20or%20%3CA%20href%3D%22https%3A%2F%2Fcode.visualstudio.com%3FWT.mc_id%3Dtech-communities-blog-dglover%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EVisual%20Studio%20Code%20(Free%20OSS)%3C%2FA%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20align%3D%22left%22%3EHardware%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3E%3CA%20href%3D%22https%3A%2F%2Fwww.seeedstudio.com%2FMT3620-Grove-Shield.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESeeed%20Studio%20Grove%20Shield%3C%2FA%3E%2C%20and%20the%20%3CA%20href%3D%22https%3A%2F%2Fwww.seeedstudio.com%2FGrove-Temperature-Humidity-Sensor-SHT31.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EGrove%20Temperature%20and%20Humidity%20Sensor%20(SHT31)%3C%2FA%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20align%3D%22left%22%3ELanguage%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3EC%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20align%3D%22left%22%3ESource%20Code%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fgloveboxes%2FCreate-a-Secure-Azure-Sphere-App-using-the-Grove-Shield-Sensor-Kit%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fgloveboxes%2FCreate-a-Secure-Azure-Sphere-App-using-the-Grove-Shield-Sensor-Kit%3C%2FA%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20align%3D%22left%22%3EDate%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3EAs%20of%20December%2C%202019%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CH2%20id%3D%22toc-hId-1048231627%22%20id%3D%22toc-hId-1048231627%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22what-is-azure-sphere%22%20id%3D%22toc-hId--759222836%22%20id%3D%22toc-hId--759222836%22%3EWhat%20is%20Azure%20Sphere%3C%2FH2%3E%0A%3CP%3EAzure%20Sphere%20is%20a%20secured%2C%20high-level%20application%20platform%20with%20built-in%20communication%20and%20security%20features%20for%20internet-connected%20devices.%3C%2FP%3E%0A%3CP%3EIt%20comprises%20a%20secured%2C%20connected%2C%20crossover%20microcontroller%20unit%20(MCU)%2C%20a%20custom%20high-level%20Linux-based%20operating%20system%20(OS)%2C%20and%20a%20cloud-based%20security%20service%20that%20provides%20continuous%2C%20renewable%20security.%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1728289997%22%20id%3D%22toc-hId-1728289997%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22hardware-required%22%20id%3D%22toc-hId--79164466%22%20id%3D%22toc-hId--79164466%22%3EHardware%20Required%3C%2FH2%3E%0A%3CP%3EThis%20tutorial%20requires%20the%20%3CA%20href%3D%22https%3A%2F%2Fwww.seeedstudio.com%2FAzure-Sphere-MT3620-Development-Kit-US-Version-p-3052.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESeeed%20Studio%20Azure%20Sphere%3C%2FA%3E%2C%20the%20%3CA%20href%3D%22https%3A%2F%2Fwww.seeedstudio.com%2FMT3620-Grove-Shield.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3ESeeed%20Studio%20Grove%20Shield%3C%2FA%3E%2C%20and%20the%20%3CA%20href%3D%22https%3A%2F%2Fwww.seeedstudio.com%2FGrove-Temperature-Humidity-Sensor-SHT31.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EGrove%20Temperature%20and%20Humidity%20Sensor%20(SHT31)%3C%2FA%3E.%20These%20parts%20are%20available%20from%20many%20online%20stores%20including%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Fwww.seeedstudio.com%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%22%3ESeeed%20Studio%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3EBe%20sure%20to%20plug%20the%20Grove%20Temperature%20Sensor%20into%20one%20of%20the%20I2C%20connectors%20on%20the%20Grove%20Shield.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22set-up-your-development-environment%22%20id%3D%22toc-hId--1886618929%22%20id%3D%22toc-hId--1886618929%22%3ESet%20up%20your%20Development%20Environment%3C%2FH2%3E%0A%3CP%3EThis%20tutorial%20assumes%20Windows%2010%20and%20%3CA%20href%3D%22https%3A%2F%2Fvisualstudio.microsoft.com%2Fvs%2F%3FWT.mc_id%3Dtech-communities-blog-dglover%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EVisual%20Studio%20(The%20free%20Community%20Edition%20or%20better)%3C%2FA%3E.%20For%20now%2C%20Azure%20Sphere%20templates%20are%20only%20available%20for%20Visual%20Studio.%20However%2C%20you%20can%20clone%20and%20open%20this%20solution%20on%20Windows%20and%20Ubuntu%2018.04%20with%20%3CA%20href%3D%22https%3A%2F%2Fcode.visualstudio.com%2F%3FWT.mc_id%3Dtech-communities-blog-dglover%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EVisual%20Studio%20Code%3C%2FA%3E.%3C%2FP%3E%0A%3CPRE%3E%3CCODE%3Egit%20clone%20https%3A%2F%2Fgithub.com%2Fgloveboxes%2FCreate-a-Secure-Azure-Sphere-App-using-the-Grove-Shield-Sensor-Kit.git%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EFollow%20the%20Azure%20Sphere%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-au%2Fazure-sphere%2Finstall%2Foverview%3FWT.mc_id%3Dtech-communities-blog-dglover%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EOverview%20of%20set%20up%20procedures%3C%2FA%3E%20guide.%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-600893904%22%20id%3D%22toc-hId-600893904%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22azure-sphere-sdk%22%20id%3D%22toc-hId--1206560559%22%20id%3D%22toc-hId--1206560559%22%3EAzure%20Sphere%20SDK%3C%2FH2%3E%0A%3CP%3EThis%20tutorial%20assumes%20you%20are%20using%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure-sphere%2Fresources%2Frelease-notes-1911%3FWT.mc_id%3Dtech-communities-blog-dglover%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Sphere%20SDK%2019.11%3C%2FA%3E%20or%20better%20which%20uses%20the%20CMake%20Build%20System.%3C%2FP%3E%0A%3CP%3EThis%20tutorial%20uses%20a%20fork%20of%20the%20Seeed%20Studio%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FSeeed-Studio%2FMT3620_Grove_Shield%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EGrove%20Shield%20Library%3C%2FA%3E%20that%20has%20been%20updated%20to%20support%20Azure%20Sphere%20SDK%2019.11.%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1280952274%22%20id%3D%22toc-hId-1280952274%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22clone-the-mt3620-grove-shield-library%22%20id%3D%22toc-hId--526502189%22%20id%3D%22toc-hId--526502189%22%3EClone%20the%20MT3620%20Grove%20Shield%20Library%3C%2FH2%3E%0A%3COL%3E%0A%3CLI%3ECreate%20a%20folder%20where%20you%20plan%20to%20build%20your%20Azure%20Sphere%20applications.%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EClone%20the%20MT3620%20Grove%20Shield%20Library.%3C%2FP%3E%0A%3CP%3EOpen%20a%20command%20window%20and%20change%20to%20the%20directory%20where%20you%20plan%20to%20build%20your%20Azure%20Sphere%20applications.%3C%2FP%3E%0A%3CPRE%3E%3CCODE%3Egit%20clone%20https%3A%2F%2Fgithub.com%2Fgloveboxes%2FMT3620_Grove_Shield.git%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CH2%20id%3D%22toc-hId--660186913%22%20id%3D%22toc-hId--660186913%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22create-a-new-visual-studio-azure-sphere-project%22%20id%3D%22toc-hId-1827325920%22%20id%3D%22toc-hId-1827325920%22%3ECreate%20a%20new%20Visual%20Studio%20Azure%20Sphere%20Project%3C%2FH2%3E%0A%3CP%3EStart%20Visual%20Studio%20and%20create%20a%20new%20project%20in%20the%20same%20directory%20you%20cloned%20the%20MT3620%20Grove%20Shield%20Library.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt%20is%20important%20to%20create%20the%20Visual%20Studio%20Project%20in%20the%20same%20folder%20you%20cloned%20the%20MT3620%20Grove%20Shield%20as%20there%20are%20relative%20links%20to%20this%20library%20in%20the%20application%20you%20will%20create.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%3Eazure-sphere%0A%20%20%20%20%7C-%20MT3620_Grove_Shield%0A%20%20%20%20%7C-%20YourAzureSphereApplication%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Fraw.githubusercontent.com%2Fgloveboxes%2FCreate-a-Secure-Azure-Sphere-App-using-the-Grove-Shield-Sensor-Kit%2Fmaster%2Fresources%2Fvs-create-new-project.png%22%20border%3D%220%22%20alt%3D%22%22%20%2F%3E%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-148954176%22%20id%3D%22toc-hId-148954176%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22select-azure-sphere-project-template%22%20id%3D%22toc-hId--1658500287%22%20id%3D%22toc-hId--1658500287%22%3ESelect%20Azure%20Sphere%20Project%20Template%3C%2FH3%3E%0A%3CP%3EType%20%3CSTRONG%3Esphere%3C%2FSTRONG%3E%20in%20the%20search%20box%20and%20select%20the%20Azure%20Sphere%20Blink%20template.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Fraw.githubusercontent.com%2Fgloveboxes%2FCreate-a-Secure-Azure-Sphere-App-using-the-Grove-Shield-Sensor-Kit%2Fmaster%2Fresources%2Fvs-select-azure-sphere-blink.png%22%20border%3D%220%22%20alt%3D%22%22%20%2F%3E%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-829012546%22%20id%3D%22toc-hId-829012546%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22configure-new-azure-sphere-project%22%20id%3D%22toc-hId--978441917%22%20id%3D%22toc-hId--978441917%22%3EConfigure%20new%20Azure%20Sphere%20Project%3C%2FH3%3E%0A%3CP%3EName%20the%20project%20and%20set%20the%20save%20location.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Fraw.githubusercontent.com%2Fgloveboxes%2FCreate-a-Secure-Azure-Sphere-App-using-the-Grove-Shield-Sensor-Kit%2Fmaster%2Fresources%2Fvs-configure-new-project.png%22%20border%3D%220%22%20alt%3D%22%22%20%2F%3E%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1509070916%22%20id%3D%22toc-hId-1509070916%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22open-the-cmakeliststxt-file%22%20id%3D%22toc-hId--298383547%22%20id%3D%22toc-hId--298383547%22%3EOpen%20the%20CMakeLists.txt%20file%3C%2FH3%3E%0A%3CP%3ECMakelists.txt%20defines%20the%20build%20process%2C%20the%20files%20and%20locations%20of%20libraries%20and%20more.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Fraw.githubusercontent.com%2Fgloveboxes%2FCreate-a-Secure-Azure-Sphere-App-using-the-Grove-Shield-Sensor-Kit%2Fmaster%2Fresources%2Fvs-open-cmakelists.png%22%20border%3D%220%22%20alt%3D%22%22%20%2F%3E%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--2105838010%22%20id%3D%22toc-hId--2105838010%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22add-a-reference-to-mt3620_grove_shield_library%22%20id%3D%22toc-hId-381674823%22%20id%3D%22toc-hId-381674823%22%3EAdd%20a%20Reference%20to%20MT3620%3CEM%3EGrove%3C%2FEM%3EShield_Library%3C%2FH3%3E%0A%3CP%3ETwo%20items%20need%20to%20be%20added%3A%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EThe%20source%20location%20on%20the%20MT3620%20Grove%20Shield%20library.%20Note%2C%20this%20is%20the%20relative%20path%20to%20the%20Grove%20Shield%20library.%3C%2FLI%3E%0A%3CLI%3EAdd%20MT3620%3CEM%3EGrove%3C%2FEM%3EShield%3CEM%3ELibrary%20to%20the%20target%3C%2FEM%3Elink_libraries%20definition.%20This%20is%20equivalent%20to%20adding%20a%20reference.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Fraw.githubusercontent.com%2Fgloveboxes%2FCreate-a-Secure-Azure-Sphere-App-using-the-Grove-Shield-Sensor-Kit%2Fmaster%2Fresources%2Fvs-configure-cmakelists.png%22%20border%3D%220%22%20alt%3D%22%22%20%2F%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22set-the-application-capabilities%22%20id%3D%22toc-hId--856700418%22%20id%3D%22toc-hId--856700418%22%3ESet%20the%20Application%20Capabilities%3C%2FH2%3E%0A%3CP%3EThe%20application%20manifest%20defines%20what%20resources%20will%20be%20available%20to%20the%20application.%20Define%20the%20minimum%20set%20of%20privileges%20required%20by%20the%20application.%20This%20is%20core%20to%20Azure%20Sphere%20security%20and%20is%20also%20known%20as%20the%20%3CA%20href%3D%22https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FPrinciple_of_least_privilege%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EPrinciple%20of%20least%20privilege%3C%2FA%3E.%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EReview%20the%20%3CA%20href%3D%22%23grove-shield-sensor-capabilities-quick-reference%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EGrove%20Shield%20Sensor%20Capabilities%20Quick%20Reference%3C%2FA%3E%20to%20understand%20what%20capabilities%20are%20required%20for%20each%20sensor%20in%20the%20library.%3C%2FLI%3E%0A%3CLI%3EOpen%20%3CSTRONG%3Eapp_manifest.json%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3CLI%3EAdd%20Uart%20%3CSTRONG%3EISU0%3C%2FSTRONG%3E%0A%3CUL%3E%0A%3CLI%3ENote%2C%20access%20to%20the%20I2C%20SHT31%20temperature%2Fhumidity%20sensor%20via%20the%20Grove%20Shield%20was%20built%20before%20Azure%20Sphere%20supported%20I2C.%20Hence%20calls%20to%20the%20sensor%20are%20proxied%20via%20the%20Uart.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3ENote%2C%20GPIO%209%20is%20used%20to%20control%20an%20onboard%20LED.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CPRE%3E%3CCODE%3E%7B%0A%20%20%22SchemaVersion%22%3A%201%2C%0A%20%20%22Name%22%3A%20%22AzureSphereBlink1%22%2C%0A%20%20%22ComponentId%22%3A%20%22a3ca0929-5f46-42b0-91ba-d5de1222da86%22%2C%0A%20%20%22EntryPoint%22%3A%20%22%2Fbin%2Fapp%22%2C%0A%20%20%22CmdArgs%22%3A%20%5B%5D%2C%0A%20%20%22Capabilities%22%3A%20%7B%0A%20%20%20%20%22Gpio%22%3A%20%5B%209%20%5D%2C%0A%20%20%20%20%22Uart%22%3A%20%5B%20%22ISU0%22%20%5D%2C%0A%20%20%20%20%22AllowedApplicationConnections%22%3A%20%5B%5D%0A%20%20%7D%2C%0A%20%20%22ApplicationType%22%3A%20%22Default%22%0A%7D%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CH3%20id%3D%22toc-hId-1759895134%22%20id%3D%22toc-hId-1759895134%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22update-the-code%22%20id%3D%22toc-hId--47559329%22%20id%3D%22toc-hId--47559329%22%3EUpdate%20the%20Code%3C%2FH3%3E%0A%3CP%3EThe%20following%20code%20includes%20the%20Grove%20Sensor%20headers%2C%20opens%20the%20Grove%20Sensor%2C%20and%20the%20loops%20reading%20the%20temperature%20and%20humidity%20and%20writes%20this%20information%20to%20the%20debugger%20logger.%3C%2FP%3E%0A%3CP%3EReplace%20all%20the%20existing%20code%20in%20the%20%3CSTRONG%3Emain.c%3C%2FSTRONG%3E%20file%20with%20the%20following%3A%3C%2FP%3E%0A%3CPRE%3E%3CCODE%3E%23include%20%3CSIGNAL.H%3E%0A%23include%20%3CSTDBOOL.H%3E%0A%23include%20%3CSTDLIB.H%3E%0A%23include%20%3CSTRING.H%3E%0A%23include%20%3CTIME.H%3E%0A%23include%20%3CERRNO.H%3E%0A%0A%23include%20%3CAPPLIBS%3E%0A%23include%20%3CAPPLIBS%3E%0A%0A%2F%2F%20Grove%20Temperature%20and%20Humidity%20Sensor%0A%23include%20%22..%2FMT3620_Grove_Shield%2FMT3620_Grove_Shield_Library%2FGrove.h%22%0A%23include%20%22..%2FMT3620_Grove_Shield%2FMT3620_Grove_Shield_Library%2FSensors%2FGroveTempHumiSHT31.h%22%0A%0Astatic%20volatile%20sig_atomic_t%20terminationRequested%20%3D%20false%3B%0A%0Astatic%20void%20TerminationHandler(int%20signalNumber)%0A%7B%0A%20%20%20%20%2F%2F%20Don't%20use%20Log_Debug%20here%2C%20as%20it%20is%20not%20guaranteed%20to%20be%20async%20signal%20safe%0A%20%20%20%20terminationRequested%20%3D%20true%3B%0A%7D%0A%0Aint%20main(int%20argc%2C%20char*%20argv%5B%5D)%0A%7B%0A%20%20%20%20Log_Debug(%22Application%20starting%5Cn%22)%3B%0A%0A%20%20%20%20%2F%2F%20Register%20a%20SIGTERM%20handler%20for%20termination%20requests%0A%20%20%20%20struct%20sigaction%20action%3B%0A%20%20%20%20memset(%26amp%3Baction%2C%200%2C%20sizeof(struct%20sigaction))%3B%0A%20%20%20%20action.sa_handler%20%3D%20TerminationHandler%3B%0A%20%20%20%20sigaction(SIGTERM%2C%20%26amp%3Baction%2C%20NULL)%3B%0A%0A%20%20%20%20%2F%2F%20Change%20this%20GPIO%20number%20and%20the%20number%20in%20app_manifest.json%20if%20required%20by%20your%20hardware.%0A%20%20%20%20int%20fd%20%3D%20GPIO_OpenAsOutput(9%2C%20GPIO_OutputMode_PushPull%2C%20GPIO_Value_High)%3B%0A%20%20%20%20if%20(fd%20%26lt%3B%200)%20%7B%0A%20%20%20%20%20%20%20%20Log_Debug(%0A%20%20%20%20%20%20%20%20%20%20%20%20%22Error%20opening%20GPIO%3A%20%25s%20(%25d).%20Check%20that%20app_manifest.json%20includes%20the%20GPIO%20used.%5Cn%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20strerror(errno)%2C%20errno)%3B%0A%20%20%20%20%20%20%20%20return%20-1%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20%2F%2F%20Initialize%20Grove%20Shield%20and%20Grove%20Temperature%20and%20Humidity%20Sensor%0A%20%20%20%20int%20i2cFd%3B%0A%20%20%20%20GroveShield_Initialize(%26amp%3Bi2cFd%2C%20115200)%3B%0A%20%20%20%20void*%20sht31%20%3D%20GroveTempHumiSHT31_Open(i2cFd)%3B%0A%0A%20%20%20%20const%20struct%20timespec%20sleepTime%20%3D%20%7B%201%2C%200%20%7D%3B%0A%20%20%20%20while%20(!terminationRequested)%20%7B%0A%0A%20%20%20%20%20%20%20%20GroveTempHumiSHT31_Read(sht31)%3B%0A%20%20%20%20%20%20%20%20float%20temp%20%3D%20GroveTempHumiSHT31_GetTemperature(sht31)%3B%0A%20%20%20%20%20%20%20%20float%20humi%20%3D%20GroveTempHumiSHT31_GetHumidity(sht31)%3B%0A%20%20%20%20%20%20%20%20Log_Debug(%22Temperature%3A%20%25.1fC%5Cn%22%2C%20temp)%3B%0A%20%20%20%20%20%20%20%20Log_Debug(%22Humidity%3A%20%25.1f%5C%25c%5Cn%22%2C%20humi%2C%200x25)%3B%0A%0A%20%20%20%20%20%20%20%20GPIO_SetValue(fd%2C%20GPIO_Value_Low)%3B%0A%20%20%20%20%20%20%20%20nanosleep(%26amp%3BsleepTime%2C%20NULL)%3B%0A%0A%20%20%20%20%20%20%20%20GPIO_SetValue(fd%2C%20GPIO_Value_High)%3B%0A%20%20%20%20%20%20%20%20nanosleep(%26amp%3BsleepTime%2C%20NULL)%3B%0A%20%20%20%20%7D%0A%7D%0A%3C%2FAPPLIBS%3E%3C%2FAPPLIBS%3E%3C%2FERRNO.H%3E%3C%2FTIME.H%3E%3C%2FSTRING.H%3E%3C%2FSTDLIB.H%3E%3C%2FSTDBOOL.H%3E%3C%2FSIGNAL.H%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CH2%20id%3D%22toc-hId--1984096511%22%20id%3D%22toc-hId--1984096511%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22deploy-the-application-to-the-azure-sphere%22%20id%3D%22toc-hId-503416322%22%20id%3D%22toc-hId-503416322%22%3EDeploy%20the%20Application%20to%20the%20Azure%20Sphere%3C%2FH2%3E%0A%3COL%3E%0A%3CLI%3EConnect%20the%20Azure%20Sphere%20to%20your%20computer%20via%20USB%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EEnsure%20you%20have%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-au%2Fazure-sphere%2Finstall%2Fclaim-device%3FWT.mc_id%3Dtech-communities-blog-dglover%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eclaimed%3C%2FA%3E%2C%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-au%2Fazure-sphere%2Finstall%2Fconfigure-wifi%3FWT.mc_id%3Dtech-communities-blog-dglover%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Econnected%3C%2FA%3E%2C%20and%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-au%2Fazure-sphere%2Finstall%2Fqs-blink-application%3FWT.mc_id%3Dtech-communities-blog-dglover%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Edeveloper%20enabled%3C%2FA%3E%20your%20Azure%20Sphere.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ESelect%20%3CSTRONG%3EGDB%20Debugger%20(HLCore)%3C%2FSTRONG%3E%20from%20the%20%3CSTRONG%3ESelect%20Startup%3C%2FSTRONG%3E%20dropdown.%20%3CIMG%20src%3D%22https%3A%2F%2Fraw.githubusercontent.com%2Fgloveboxes%2FCreate-a-Secure-Azure-Sphere-App-using-the-Grove-Shield-Sensor-Kit%2Fmaster%2Fresources%2Fvs-start-application.png%22%20border%3D%220%22%20alt%3D%22%22%20%2F%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3EFrom%20Visual%20Studio%2C%20press%20%3CSTRONG%3EF5%3C%2FSTRONG%3E%20to%20build%2C%20deploy%2C%20start%2C%20and%20attached%20the%20remote%20debugger%20to%20the%20Azure%20Sphere.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CH3%20id%3D%22toc-hId--1174955422%22%20id%3D%22toc-hId--1174955422%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22view-the-debugger-output%22%20id%3D%22toc-hId-1312557411%22%20id%3D%22toc-hId-1312557411%22%3EView%20the%20Debugger%20Output%3C%2FH3%3E%0A%3CP%3EOpen%20the%20%3CEM%3EOutput%3C%2FEM%3E%20window%20to%20view%20the%20output%20from%20%3CSTRONG%3ELog%3CEM%3EDebug%3C%2FEM%3E%3C%2FSTRONG%3E%20statements%20in%20_main.c.%3C%2FP%3E%0A%3CP%3EYou%20can%20do%20this%20by%20using%20the%20Visual%20Studio%20%3CSTRONG%3ECtrl%2BAlt%2BO%3C%2FSTRONG%3E%20keyboard%20shortcut%20or%20click%20the%20%3CSTRONG%3EOutput%3C%2FSTRONG%3E%20tab%20found%20along%20the%20bottom%2Fright%20of%20Visual%20Studio.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Fraw.githubusercontent.com%2Fgloveboxes%2FCreate-a-Secure-Azure-Sphere-App-using-the-Grove-Shield-Sensor-Kit%2Fmaster%2Fresources%2Fvs-view-output.png%22%20border%3D%220%22%20alt%3D%22Visual%20Studio%20View%20Output%22%20%2F%3E%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--494897052%22%20id%3D%22toc-hId--494897052%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22set-a-debug-breakpoint%22%20id%3D%22toc-hId-1992615781%22%20id%3D%22toc-hId-1992615781%22%3ESet%20a%20Debug%20Breakpoint%3C%2FH3%3E%0A%3CP%3ESet%20a%20debugger%20breakpoint%20by%20clicking%20in%20the%20margin%20to%20the%20left%20of%20the%20line%20of%20code%20you%20want%20the%20debugger%20to%20stop%20at.%3C%2FP%3E%0A%3CP%3EIn%20the%20%3CSTRONG%3Emain.c%3C%2FSTRONG%3E%20file%20set%20a%20breakpoint%20in%20the%20margin%20of%20the%20line%20that%20reads%20the%20Grove%20temperature%20and%20pressure%20sensor%20%3CSTRONG%3EGroveTempHumiSHT31_Read(sht31)%3B%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Fraw.githubusercontent.com%2Fgloveboxes%2FCreate-a-Secure-Azure-Sphere-App-using-the-Grove-Shield-Sensor-Kit%2Fmaster%2Fresources%2Fvs-set-breakpoint.png%22%20border%3D%220%22%20alt%3D%22%22%20%2F%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22stop-the-debugger%22%20id%3D%22toc-hId-185161318%22%20id%3D%22toc-hId-185161318%22%3EStop%20the%20Debugger%3C%2FH3%3E%0A%3CP%3E%3CSTRONG%3EStop%3C%2FSTRONG%3E%20the%20debugger%20by%20using%20the%20Visual%20Studio%20%3CSTRONG%3EShift%2BF5%3C%2FSTRONG%3E%20keyboard%20shortcut%20or%20click%20the%20%3CSTRONG%3EStop%20Debugging%3C%2FSTRONG%3E%20icon.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Fraw.githubusercontent.com%2Fgloveboxes%2FCreate-a-Secure-Azure-Sphere-App-using-the-Grove-Shield-Sensor-Kit%2Fmaster%2Fresources%2Fvs-stop-debugger.png%22%20border%3D%220%22%20alt%3D%22%22%20%2F%3E%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1053213923%22%20id%3D%22toc-hId--1053213923%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22azure-sphere-application-cloud-deployment%22%20id%3D%22toc-hId-1434298910%22%20id%3D%22toc-hId-1434298910%22%3EAzure%20Sphere%20Application%20Cloud%20Deployment%3C%2FH2%3E%0A%3CP%3ENow%20you%20have%20learnt%20how%20to%20%22Side%20Load%22%20an%20application%20onto%20Azure%20Sphere%20it%20is%20time%20to%20learn%20about%20the%20%3CA%3EDeployment%20Basics%3C%2FA%3E%20to%20%3CEM%3ECloud%20Deploy%3C%2FEM%3E%20an%20application.%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--373155553%22%20id%3D%22toc-hId--373155553%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22finished-fertig-finito-terminado%22%20id%3D%22toc-hId-2114357280%22%20id%3D%22toc-hId-2114357280%22%3EFinished%20%E5%AE%8C%E4%BA%86%20fertig%20finito%20%E0%A4%96%E0%A4%BC%E0%A4%A4%E0%A5%8D%E0%A4%AE%20%E0%A4%B9%E0%A5%8B%E0%A4%A8%E0%A4%BE%20terminado%3C%2FH2%3E%0A%3CP%3ECongratulations%2C%20you%20created%20a%20secure%20Internet%20of%20Things%20Azure%20Sphere%20application.%3C%2FP%3E%0A%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Fraw.githubusercontent.com%2Fgloveboxes%2FCreate-a-Secure-Azure-Sphere-App-using-the-Grove-Shield-Sensor-Kit%2Fmaster%2Fresources%2Ffinished.jpg%22%20border%3D%220%22%20alt%3D%22%22%20%2F%3E%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-306902817%22%20id%3D%22toc-hId-306902817%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22appendix%22%20id%3D%22toc-hId--1500551646%22%20id%3D%22toc-hId--1500551646%22%3EAppendix%3C%2FH2%3E%0A%3CH3%20id%3D%22toc-hId-1116043906%22%20id%3D%22toc-hId-1116043906%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22grove-shield-sensor-capabilities-quick-reference%22%20id%3D%22toc-hId--691410557%22%20id%3D%22toc-hId--691410557%22%3EGrove%20Shield%20Sensor%20Capabilities%20Quick%20Reference%3C%2FH3%3E%0A%3CTABLE%3E%0A%3CTHEAD%3E%0A%3CTR%3E%0A%3CTH%20align%3D%22left%22%3ESensors%3C%2FTH%3E%0A%3CTH%20align%3D%22left%22%3ESocket%3C%2FTH%3E%0A%3CTH%20align%3D%22left%22%3ECapabilities%3C%2FTH%3E%0A%3C%2FTR%3E%0A%3C%2FTHEAD%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20align%3D%22left%22%3EGrove%20Light%20Sensor%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3EAnalog%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3E%22Gpio%22%3A%20%5B%2057%2C%2058%20%5D%2C%20%22Uart%22%3A%20%5B%20%22ISU0%22%5D%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20align%3D%22left%22%3EGrove%20Rotary%20Sensor%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3EAnalog%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3E%22Gpio%22%3A%20%5B%2057%2C%2058%20%5D%2C%20%22Uart%22%3A%20%5B%20%22ISU0%22%5D%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20align%3D%22left%22%3EGrove%204%20Digit%20Display%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3EGPIO0%20or%20GPIO4%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3E%22Gpio%22%3A%20%5B%200%2C%201%20%5D%20or%20%22Gpio%22%3A%20%5B%204%2C%205%20%5D%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20align%3D%22left%22%3EGrove%20LED%20Button%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3EGPIO0%20or%20GPIO4%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3E%22Gpio%22%3A%20%5B%200%2C%201%20%5D%20or%20%22Gpio%22%3A%20%5B%204%2C%205%20%5D%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20align%3D%22left%22%3EGrove%20Oled%20Display%2096x96%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3EI2C%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3E%22Uart%22%3A%20%5B%20%22ISU0%22%5D%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20align%3D%22left%22%3EGrove%20Temperature%20Humidity%20SHT31%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3EI2C%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3E%22Uart%22%3A%20%5B%20%22ISU0%22%5D%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20align%3D%22left%22%3EGrove%20UART3%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3EUART3%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3E%22Uart%22%3A%20%5B%20%22ISU3%22%5D%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20align%3D%22left%22%3ELED%201%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3ERed%20%3CBR%20%2F%3EGreen%20%3CBR%20%2F%3EBlue%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3E%22Gpio%22%3A%20%5B%208%20%5D%20%3CBR%20%2F%3E%22Gpio%22%3A%20%5B%209%20%5D%20%3CBR%20%2F%3E%22Gpio%22%3A%20%5B%2010%20%5D%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20align%3D%22left%22%3ELED%202%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3ERed%20%3CBR%20%2F%3EGreen%20%3CBR%20%2F%3EBlue%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3E%22Gpio%22%3A%20%5B%2015%20%5D%20%3CBR%20%2F%3E%22Gpio%22%3A%20%5B%2016%20%5D%20%3CBR%20%2F%3E%22Gpio%22%3A%20%5B%2017%20%5D%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20align%3D%22left%22%3ELED%203%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3ERed%20%3CBR%20%2F%3EGreen%20%3CBR%20%2F%3EBlue%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3E%22Gpio%22%3A%20%5B%2018%20%5D%20%3CBR%20%2F%3E%22Gpio%22%3A%20%5B%2019%20%5D%20%3CBR%20%2F%3E%22Gpio%22%3A%20%5B%2020%20%5D%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20align%3D%22left%22%3ELED%204%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3ERed%20%3CBR%20%2F%3EGreen%20%3CBR%20%2F%3EBlue%3C%2FTD%3E%0A%3CTD%20align%3D%22left%22%3E%22Gpio%22%3A%20%5B%2021%20%5D%20%3CBR%20%2F%3E%22Gpio%22%3A%20%5B%2022%20%5D%20%3CBR%20%2F%3E%22Gpio%22%3A%20%5B%2023%20%5D%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3EFor%20more%20pin%20definitions%20see%20the%20%3CSTRONG%3Emt3620%3CEM%3Erdb.h%3C%2FEM%3E%3C%2FSTRONG%3E%20in%20the%20MT3620Grove%3CEM%3EShield%2FMT3620%3C%2FEM%3EGrove%3CEM%3EShield%3C%2FEM%3ELibrary%20folder.%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1796102276%22%20id%3D%22toc-hId-1796102276%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22azure-sphere-grove-kit%22%20id%3D%22toc-hId--11352187%22%20id%3D%22toc-hId--11352187%22%3EAzure%20Sphere%20Grove%20Kit%3C%2FH3%3E%0A%3CTABLE%3E%0A%3CTHEAD%3E%0A%3CTR%3E%0A%3CTH%3EAzure%20Sphere%3C%2FTH%3E%0A%3CTH%3EImage%3C%2FTH%3E%0A%3C%2FTR%3E%0A%3C%2FTHEAD%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%3E%3CA%20href%3D%22https%3A%2F%2Fwww.seeedstudio.com%2FAzure-Sphere-MT3620-Development-Kit-US-Version-p-3052.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Sphere%20MT3620%20Development%20Kit%3C%2FA%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%3E%3CA%20href%3D%22https%3A%2F%2Fwww.seeedstudio.com%2FGrove-Starter-Kit-for-Azure-Sphere-MT3620-Development-Kit.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Sphere%20MT3620%20Development%20Kit%20Shield%3C%2FA%3E.%20%3CBR%20%2F%3ENote%2C%20you%20can%20also%20purchase%20the%20parts%20separately.%3C%2FTD%3E%0A%3CTD%3E%3CIMG%20src%3D%22https%3A%2F%2Fraw.githubusercontent.com%2Fgloveboxes%2FCreate-a-Secure-Azure-Sphere-App-using-the-Grove-Shield-Sensor-Kit%2Fmaster%2Fresources%2Fseeed-studio-grove-shield-and-sensors.jpg%22%20border%3D%220%22%20alt%3D%22%22%20%2F%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CH3%20id%3D%22toc-hId--1120644709%22%20id%3D%22toc-hId--1120644709%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22azure-sphere-mt3620-developer-board-pinmap%22%20id%3D%22toc-hId-1366868124%22%20id%3D%22toc-hId-1366868124%22%3EAzure%20Sphere%20MT3620%20Developer%20Board%20Pinmap%3C%2FH3%3E%0A%3CP%3EThe%20full%20Azure%20Sphere%20MT3620%20Board%20Pinmap%20can%20be%20found%20on%20the%20%3CA%20href%3D%22https%3A%2F%2Fwww.seeedstudio.com%2FAzure-Sphere-MT3620-Development-Kit-US-Version-p-3052.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Sphere%20MT3620%20Development%20Kit%3C%2FA%3E%20page.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Fraw.githubusercontent.com%2Fgloveboxes%2FCreate-a-Secure-Azure-Sphere-App-using-the-Grove-Shield-Sensor-Kit%2Fmaster%2Fresources%2Fmt3620-dev-board-pinmap.png%22%20border%3D%220%22%20alt%3D%22%22%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1069589%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20tutorial%20is%20a%20step%20by%20step%20guide%20to%20building%20your%20first%20Azure%20Sphere%20application%20using%20the%20Seeed%20Studio%20Grove%20Shield%20and%20Grove%20Sensors%20targeting%20Azure%20Sphere%20SDK%2019.11%20or%20better.%3C%2FP%3E%3C%2FLINGO-TEASER%3E
Microsoft

Create a Secure Azure Sphere App using the Grove Shield Sensor Kit

 

clipboard_image_0.png

 

Author Dave Glover, Microsoft Cloud Developer Advocate
Target Platform Seeed Studio Azure Sphere MT3620
Developer Platform Windows 10 or Ubuntu 18.04
Azure SDK Azure Sphere SDK 19.11 or better
Developer Tools Visual Studio (The free Community Edition or better) or Visual Studio Code (Free OSS)
Hardware Seeed Studio Grove Shield, and the Grove Temperature and Humidity Sensor (SHT31)
Language C
Source Code https://github.com/gloveboxes/Create-a-Secure-Azure-Sphere-App-using-the-Grove-Shield-Sensor-Kit
Date As of December, 2019

 

What is Azure Sphere

Azure Sphere is a secured, high-level application platform with built-in communication and security features for internet-connected devices.

It comprises a secured, connected, crossover microcontroller unit (MCU), a custom high-level Linux-based operating system (OS), and a cloud-based security service that provides continuous, renewable security.

 

Hardware Required

This tutorial requires the Seeed Studio Azure Sphere, the Seeed Studio Grove Shield, and the Grove Temperature and Humidity Sensor (SHT31). These parts are available from many online stores including Seeed Studio.

Be sure to plug the Grove Temperature Sensor into one of the I2C connectors on the Grove Shield.

 

Set up your Development Environment

This tutorial assumes Windows 10 and Visual Studio (The free Community Edition or better). For now, Azure Sphere templates are only available for Visual Studio. However, you can clone and open this solution on Windows and Ubuntu 18.04 with Visual Studio Code.

git clone https://github.com/gloveboxes/Create-a-Secure-Azure-Sphere-App-using-the-Grove-Shield-Sensor-Kit.git

Follow the Azure Sphere Overview of set up procedures guide.

 

Azure Sphere SDK

This tutorial assumes you are using the Azure Sphere SDK 19.11 or better which uses the CMake Build System.

This tutorial uses a fork of the Seeed Studio Grove Shield Library that has been updated to support Azure Sphere SDK 19.11.

 

Clone the MT3620 Grove Shield Library

  1. Create a folder where you plan to build your Azure Sphere applications.
  2. Clone the MT3620 Grove Shield Library.

    Open a command window and change to the directory where you plan to build your Azure Sphere applications.

    git clone https://github.com/gloveboxes/MT3620_Grove_Shield.git
    

 

Create a new Visual Studio Azure Sphere Project

Start Visual Studio and create a new project in the same directory you cloned the MT3620 Grove Shield Library.

 

It is important to create the Visual Studio Project in the same folder you cloned the MT3620 Grove Shield as there are relative links to this library in the application you will create.

 

azure-sphere
    |- MT3620_Grove_Shield
    |- YourAzureSphereApplication

 

Select Azure Sphere Project Template

Type sphere in the search box and select the Azure Sphere Blink template.

 

 

Configure new Azure Sphere Project

Name the project and set the save location.

 

 

Open the CMakeLists.txt file

CMakelists.txt defines the build process, the files and locations of libraries and more.

 

 

Add a Reference to MT3620GroveShield_Library

Two items need to be added:

  1. The source location on the MT3620 Grove Shield library. Note, this is the relative path to the Grove Shield library.
  2. Add MT3620GroveShieldLibrary to the targetlink_libraries definition. This is equivalent to adding a reference.

 

 

Set the Application Capabilities

The application manifest defines what resources will be available to the application. Define the minimum set of privileges required by the application. This is core to Azure Sphere security and is also known as the Principle of least privilege.

  1. Review the Grove Shield Sensor Capabilities Quick Reference to understand what capabilities are required for each sensor in the library.
  2. Open app_manifest.json
  3. Add Uart ISU0
    • Note, access to the I2C SHT31 temperature/humidity sensor via the Grove Shield was built before Azure Sphere supported I2C. Hence calls to the sensor are proxied via the Uart.
  4. Note, GPIO 9 is used to control an onboard LED.
{
  "SchemaVersion": 1,
  "Name": "AzureSphereBlink1",
  "ComponentId": "a3ca0929-5f46-42b0-91ba-d5de1222da86",
  "EntryPoint": "/bin/app",
  "CmdArgs": [],
  "Capabilities": {
    "Gpio": [ 9 ],
    "Uart": [ "ISU0" ],
    "AllowedApplicationConnections": []
  },
  "ApplicationType": "Default"
}

 

Update the Code

The following code includes the Grove Sensor headers, opens the Grove Sensor, and the loops reading the temperature and humidity and writes this information to the debugger logger.

Replace all the existing code in the main.c file with the following:

#include <signal.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <errno.h>

#include <applibs/log.h>
#include <applibs/gpio.h>

// Grove Temperature and Humidity Sensor
#include "../MT3620_Grove_Shield/MT3620_Grove_Shield_Library/Grove.h"
#include "../MT3620_Grove_Shield/MT3620_Grove_Shield_Library/Sensors/GroveTempHumiSHT31.h"

static volatile sig_atomic_t terminationRequested = false;

static void TerminationHandler(int signalNumber)
{
    // Don't use Log_Debug here, as it is not guaranteed to be async signal safe
    terminationRequested = true;
}

int main(int argc, char* argv[])
{
    Log_Debug("Application starting\n");

    // Register a SIGTERM handler for termination requests
    struct sigaction action;
    memset(&action, 0, sizeof(struct sigaction));
    action.sa_handler = TerminationHandler;
    sigaction(SIGTERM, &action, NULL);

    // Change this GPIO number and the number in app_manifest.json if required by your hardware.
    int fd = GPIO_OpenAsOutput(9, GPIO_OutputMode_PushPull, GPIO_Value_High);
    if (fd < 0) {
        Log_Debug(
            "Error opening GPIO: %s (%d). Check that app_manifest.json includes the GPIO used.\n",
            strerror(errno), errno);
        return -1;
    }

    // Initialize Grove Shield and Grove Temperature and Humidity Sensor
    int i2cFd;
    GroveShield_Initialize(&i2cFd, 115200);
    void* sht31 = GroveTempHumiSHT31_Open(i2cFd);

    const struct timespec sleepTime = { 1, 0 };
    while (!terminationRequested) {

        GroveTempHumiSHT31_Read(sht31);
        float temp = GroveTempHumiSHT31_GetTemperature(sht31);
        float humi = GroveTempHumiSHT31_GetHumidity(sht31);
        Log_Debug("Temperature: %.1fC\n", temp);
        Log_Debug("Humidity: %.1f\%c\n", humi, 0x25);

        GPIO_SetValue(fd, GPIO_Value_Low);
        nanosleep(&sleepTime, NULL);

        GPIO_SetValue(fd, GPIO_Value_High);
        nanosleep(&sleepTime, NULL);
    }
}

 

Deploy the Application to the Azure Sphere

  1. Connect the Azure Sphere to your computer via USB
  2. Ensure you have claimed, connected, and developer enabled your Azure Sphere.

  3. Select GDB Debugger (HLCore) from the Select Startup dropdown.

  4. From Visual Studio, press F5 to build, deploy, start, and attached the remote debugger to the Azure Sphere.

 

View the Debugger Output

Open the Output window to view the output from LogDebug statements in _main.c.

You can do this by using the Visual Studio Ctrl+Alt+O keyboard shortcut or click the Output tab found along the bottom/right of Visual Studio.

 

Visual Studio View Output

 

Set a Debug Breakpoint

Set a debugger breakpoint by clicking in the margin to the left of the line of code you want the debugger to stop at.

In the main.c file set a breakpoint in the margin of the line that reads the Grove temperature and pressure sensor GroveTempHumiSHT31_Read(sht31);.

 

 

Stop the Debugger

Stop the debugger by using the Visual Studio Shift+F5 keyboard shortcut or click the Stop Debugging icon.

 

 

Azure Sphere Application Cloud Deployment

Now you have learnt how to "Side Load" an application onto Azure Sphere it is time to learn about the Deployment Basics to Cloud Deploy an application.

 

Finished 完了 fertig finito ख़त्म होना terminado

Congratulations, you created a secure Internet of Things Azure Sphere application.

 

Appendix

 

Grove Shield Sensor Capabilities Quick Reference

Sensors Socket Capabilities
Grove Light Sensor Analog "Gpio": [ 57, 58 ], "Uart": [ "ISU0"]
Grove Rotary Sensor Analog "Gpio": [ 57, 58 ], "Uart": [ "ISU0"]
Grove 4 Digit Display GPIO0 or GPIO4 "Gpio": [ 0, 1 ] or "Gpio": [ 4, 5 ]
Grove LED Button GPIO0 or GPIO4 "Gpio": [ 0, 1 ] or "Gpio": [ 4, 5 ]
Grove Oled Display 96x96 I2C "Uart": [ "ISU0"]
Grove Temperature Humidity SHT31 I2C "Uart": [ "ISU0"]
Grove UART3 UART3 "Uart": [ "ISU3"]
LED 1 Red
Green
Blue
"Gpio": [ 8 ]
"Gpio": [ 9 ]
"Gpio": [ 10 ]
LED 2 Red
Green
Blue
"Gpio": [ 15 ]
"Gpio": [ 16 ]
"Gpio": [ 17 ]
LED 3 Red
Green
Blue
"Gpio": [ 18 ]
"Gpio": [ 19 ]
"Gpio": [ 20 ]
LED 4 Red
Green
Blue
"Gpio": [ 21 ]
"Gpio": [ 22 ]
"Gpio": [ 23 ]

For more pin definitions see the mt3620rdb.h in the MT3620GroveShield/MT3620GroveShieldLibrary folder.

 

Azure Sphere Grove Kit

Azure Sphere Image
Azure Sphere MT3620 Development Kit
Azure Sphere MT3620 Development Kit Shield.
Note, you can also purchase the parts separately.

 

Azure Sphere MT3620 Developer Board Pinmap

The full Azure Sphere MT3620 Board Pinmap can be found on the Azure Sphere MT3620 Development Kit page.