{"id":19944276,"url":"https://github.com/lazauk/azuresphere-mt3620","last_synced_at":"2026-07-28T04:31:12.067Z","repository":{"id":147958179,"uuid":"224520000","full_name":"LazaUK/AzureSphere-MT3620","owner":"LazaUK","description":"Demo of secure \"Voting Machine\", powered by Azure Sphere..","archived":false,"fork":false,"pushed_at":"2019-11-30T16:03:32.000Z","size":3893,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T13:42:03.367Z","etag":null,"topics":["iot","security"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LazaUK.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-27T21:29:32.000Z","updated_at":"2024-01-12T09:59:12.000Z","dependencies_parsed_at":"2023-05-28T02:45:28.771Z","dependency_job_id":null,"html_url":"https://github.com/LazaUK/AzureSphere-MT3620","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LazaUK/AzureSphere-MT3620","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LazaUK%2FAzureSphere-MT3620","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LazaUK%2FAzureSphere-MT3620/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LazaUK%2FAzureSphere-MT3620/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LazaUK%2FAzureSphere-MT3620/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LazaUK","download_url":"https://codeload.github.com/LazaUK/AzureSphere-MT3620/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LazaUK%2FAzureSphere-MT3620/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005462,"owners_count":26083899,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["iot","security"],"created_at":"2024-11-13T00:19:45.560Z","updated_at":"2025-10-10T22:11:20.695Z","avatar_url":"https://github.com/LazaUK.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Secure voting machine - powered by Azure Sphere\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"/images/Overview_AvNetSK.jpg\"\u003e\n\u003c/p\u003e\n\n## Infrastructure Setup:\n1. In Azure portal, create and link to each other Azure IoT Hub and Azure IoT Hub Device Provisioning Service (DPS) resources, using the following [Quick Setup guide](https://docs.microsoft.com/en-us/azure/iot-dps/quick-setup-auto-provision).\n![Screenshot 1.1](/images/Infra_1.png)\n\u003e **Note**: To use Device Twin capability, IoT Hub should be on the Standard pricing tier.\n2. In Azure Sphere Developer Command Prompt, download CA certificate from Azure Sphere tenant using the following command:\n```\nazsphere tenant download-CA-certificate --output CAcertificate.cer\n```\nYou should see confirmation that the CA certificate has been saved.\n![Screenshot 1.2](/images/Infra_2.png)\n3. In Azure portal, upload certificate to Azure IoT DPS -\u003e Certificates. After upload it will show new entry with an “Unverified” status.\n![Screenshot 1.3](/images/Infra_3.png)\n4. Then open certificate record and click “Generate Verification Code” button.\n![Screenshot 1.4](/images/Infra_4.png)\n5. In Azure Sphere Developer Command Prompt, download validation certificate signed with the DPS verification code from Step 4 above using the following command:\n```\nazsphere tenant download-validation-certificate --output ValidationCertification.cer --verificationcode \u003cDPS_VERIFICATION_CODE\u003e\n```\nYou should see confirmation that the validation certificate has been saved.\n![Screenshot 1.5](/images/Infra_5.png)\n6. In Azure portal, upload validation certificate into “Verification Certificate” field of the record window from Step 4 and click “Verify” button. After validation, Azure will change the status of your certificate to “Verified”.\n![Screenshot 1.6](/images/Infra_6.png)\n7. Switch to Azure IoT DPS -\u003e Manage Enrolments menu and add new enrolment group with the primary certificate that we verified in Step 6 above.\n![Screenshot 1.7](/images/Infra_7.png)\n \n## Data flow configuration:\n1. In Azure Sphere Developer Command Prompt, execute the following command to get Azure Sphere tenant’s ID:\n```\nazsphere tenant show-selected\n```\n2. In Azure portal, switch to Azure IoT DPS -\u003e Overview and copy DPS ID Scope value.\n3. From Azure IoT DPS -\u003e Linked IoT Hubs copy the full name of the linked IoT Hub.\n4. Download content of this Git repo.\n5. In Visual Studio, click File -\u003e Open -\u003e CMake, navigate to the repo’s Software -\u003e VotingApp and then open app_manifest.json file.\n![Screenshot 2.5](/images/Soft_5.png)\n6. Update placeholders highlighted in the screenshot below with the values of your Azure Sphere tenant’s ID, DPS ID Scope and IoT Hub names collected in Steps 1, 2 and 3 above.\n![Screenshot 2.6](/images/Soft_6.png)\n7. Select CMakeLists.txt file and then click Build -\u003e Rebuild Current Document (CMakeLists.txt). Verify that an image package is being generated as shown below.\n![Screenshot 2.7](/images/Soft_7.png)\n8. In the toolbar, choose “GDB Debugger (HLCore)” as the target.\n![Screenshot 2.8](/images/Soft_8.png)\n9. In Azure Sphere Developer Command Prompt, enable application development capability on Azure Sphere device:\n```\nazsphere device enable-development\n```\n10. Back in Visual Studio, click Debug -\u003e Start (or press F5) to deploy Voting Machine app to the device. If successful, Visual Studio will execute Voting Machine app on Azure Sphere device. In Output window, choose “Device Output” option. If you will press any of 2 buttons, you should see the message updates in the debug window.\n![Screenshot 2.10](/images/Soft_10.png)\n\n## Analytics configuration:\n1. In Azure, create new Stream Analytics job and add IoT Hub as its stream input\n![Screenshot 3.1](/images/Analytics_1.png)\n2. Add PowerBI as the output for Stream Analytics job and click Authorize.\n![Screenshot 3.2](/images/Analytics_2.png)\n3. Provide relevant output alias name, so that you can use it in the Stream Analytics query.\n![Screenshot 3.3](/images/Analytics_3.png)\n4. Alternatively, you can setup Azure storage account or a database as an output for Azure Stream Analytics job.\n![Screenshot 3.4](/images/Analytics_4.png)\n5. Last part is to create your dashboard in PowerBI. You may configure it directly at https://powerbi.microsoft.com/en-us/ or use richer functionality with the PowerBI desktop client. This is an example of my PowerBI dashboard, which combines historical data from the database with the live stream from the Azure Sphere device.\n![Screenshot 3.5](/images/Analytics_5.png)\n\n## High-Level Design:\nThe following diagram shows the main components utilised in this project.\n![Screenshot 4.1](/images/AzSphere_Schematics.png)\n\n## Working model - YouTube video:\nYou can find short demo of the working solution here on [YouTube](https://youtu.be/QZcHa6_i7bo)\n\n## Credits:\nThis solution is based on the original sample code from Microsoft Azure Sphere team, published [here](https://github.com/Azure/azure-sphere-samples)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flazauk%2Fazuresphere-mt3620","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flazauk%2Fazuresphere-mt3620","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flazauk%2Fazuresphere-mt3620/lists"}