diff --git a/2-farm/lessons/6-keep-your-plant-secure/README.md b/2-farm/lessons/6-keep-your-plant-secure/README.md index b642a26..fa3cc29 100644 --- a/2-farm/lessons/6-keep-your-plant-secure/README.md +++ b/2-farm/lessons/6-keep-your-plant-secure/README.md @@ -148,7 +148,7 @@ After the connection, all data sent to the IoT Hub from the device, or to the de ### X.509 certificates -When you are using an asymmetric encryption with a public/private key pair, you need to provide your public key to anyone who wants to send you data. The problem is, how can the recipient of your key be sure it's actually your public key, not someone else pretending to be you? Instead of providing a key, you can instead provide your public key inside a certificate that has been verified by a trusted third party, called an X.509 certificate. +When you are using asymmetric encryption with a public/private key pair, you need to provide your public key to anyone who wants to send you data. The problem is, how can the recipient of your key be sure it's actually your public key, not someone else pretending to be you? Instead of providing a key, you can instead provide your public key inside a certificate that has been verified by a trusted third party, called an X.509 certificate. X.509 certificates are digital documents that contain the public key part of the public/private key pair. They are usually issued by one of a number of trusted organizations called [Certification authorities](https://wikipedia.org/wiki/Certificate_authority) (CAs), and digitally signed by the CA to indicate the key is valid and comes from you. You trust the certificate and that the public key is from who the certificate says it is from, because you trust the CA, similar to how you would trust a passport or driving license because you trust the country issuing it. Certificates cost money, so you can also 'self-sign', that is create a certificate yourself that is signed by you, for testing purposes. diff --git a/5-retail/README.md b/5-retail/README.md index 0471ed3..c5a2e4c 100644 --- a/5-retail/README.md +++ b/5-retail/README.md @@ -1,7 +1,20 @@ # Retail - using IoT to manage stock levels +The last stage for feed before it reaches consumers is retail - the markets, greengrocers, supermarkets and stores that sell produce to consumers. These stores want to ensure they have produce out on shelves for consumers to see and buy. + +One of the most manual, time consuming tasks in food stores, especially in large supermarkets, is making sure the shelves are stocked. Checking individual shelves to ensure any gaps are filled with produce from store rooms. + +IoT can help with this, using AI models running on IoT devices to count stock, using machine learning models that don't just classify images, but can detect individual objects and count them. + +In these 2 lessons you'll learn how to train image-based AI models to count stock, and run these models on IoT devices. + +> 💁 These lessons will use some cloud resources. If you don't complete all the lessons in this project, make sure you [Clean up your project](../clean-up.md). + ## Topics +1. [Train a stock detector](./lessons/1-train-stock-detector/README.md) +1. [Check stock from an IoT device](./lessons/2-check-stock-device/README.md) ## Credits +All the lessons were written with ♥️ by [Jim Bennett](https://GitHub.com/JimBobBennett) diff --git a/5-retail/lessons/1-train-stock-detector/README.md b/5-retail/lessons/1-train-stock-detector/README.md new file mode 100644 index 0000000..303930f --- /dev/null +++ b/5-retail/lessons/1-train-stock-detector/README.md @@ -0,0 +1,33 @@ +# Train a stock detector + +Add a sketchnote if possible/appropriate + +![Embed a video here if available](video-url) + +## Pre-lecture quiz + +[Pre-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/37) + +## Introduction + +In this lesson you will learn about + +In this lesson we'll cover: + +* [Thing 1](#thing-1) + +## Thing 1 + +--- + +## 🚀 Challenge + +## Post-lecture quiz + +[Post-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/38) + +## Review & Self Study + +## Assignment + +[](assignment.md) diff --git a/5-retail/lessons/1-train-stock-detector/assignment.md b/5-retail/lessons/1-train-stock-detector/assignment.md new file mode 100644 index 0000000..da157d5 --- /dev/null +++ b/5-retail/lessons/1-train-stock-detector/assignment.md @@ -0,0 +1,9 @@ +# + +## Instructions + +## Rubric + +| Criteria | Exemplary | Adequate | Needs Improvement | +| -------- | --------- | -------- | ----------------- | +| | | | | diff --git a/5-retail/lessons/1-train-stock-detector/translations/.dummy.md b/5-retail/lessons/1-train-stock-detector/translations/.dummy.md new file mode 100644 index 0000000..6e7db24 --- /dev/null +++ b/5-retail/lessons/1-train-stock-detector/translations/.dummy.md @@ -0,0 +1,9 @@ +# Dummy File + +This file acts as a placeholder for the `translations` folder.
+**Please remove this file after adding the first translation** + +For the instructions, follow the directives in the [translations guide](https://github.com/microsoft/IoT-For-Beginners/blob/main/TRANSLATIONS.md) . + +## THANK YOU +We truly appreciate your efforts! diff --git a/5-retail/lessons/2-check-stock-device/README.md b/5-retail/lessons/2-check-stock-device/README.md new file mode 100644 index 0000000..304b563 --- /dev/null +++ b/5-retail/lessons/2-check-stock-device/README.md @@ -0,0 +1,33 @@ +# Check stock from an IoT device + +Add a sketchnote if possible/appropriate + +![Embed a video here if available](video-url) + +## Pre-lecture quiz + +[Pre-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/39) + +## Introduction + +In this lesson you will learn about + +In this lesson we'll cover: + +* [Thing 1](#thing-1) + +## Thing 1 + +--- + +## 🚀 Challenge + +## Post-lecture quiz + +[Post-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/40) + +## Review & Self Study + +## Assignment + +[](assignment.md) diff --git a/5-retail/lessons/2-check-stock-device/assignment.md b/5-retail/lessons/2-check-stock-device/assignment.md new file mode 100644 index 0000000..da157d5 --- /dev/null +++ b/5-retail/lessons/2-check-stock-device/assignment.md @@ -0,0 +1,9 @@ +# + +## Instructions + +## Rubric + +| Criteria | Exemplary | Adequate | Needs Improvement | +| -------- | --------- | -------- | ----------------- | +| | | | | diff --git a/5-retail/lessons/2-check-stock-device/translations/.dummy.md b/5-retail/lessons/2-check-stock-device/translations/.dummy.md new file mode 100644 index 0000000..6e7db24 --- /dev/null +++ b/5-retail/lessons/2-check-stock-device/translations/.dummy.md @@ -0,0 +1,9 @@ +# Dummy File + +This file acts as a placeholder for the `translations` folder.
+**Please remove this file after adding the first translation** + +For the instructions, follow the directives in the [translations guide](https://github.com/microsoft/IoT-For-Beginners/blob/main/TRANSLATIONS.md) . + +## THANK YOU +We truly appreciate your efforts! diff --git a/6-consumer/lessons/1-speech-recognition/README.md b/6-consumer/lessons/1-speech-recognition/README.md index 3269493..0a34dba 100644 --- a/6-consumer/lessons/1-speech-recognition/README.md +++ b/6-consumer/lessons/1-speech-recognition/README.md @@ -8,7 +8,7 @@ This video gives an overview of the Azure speech service, a topic that will be c ## Pre-lecture quiz -[Pre-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/33) +[Pre-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/41) ## Introduction @@ -212,7 +212,7 @@ What do you think the future holds for speech recognition? ## Post-lecture quiz -[Post-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/34) +[Post-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/42) ## Review & Self Study diff --git a/6-consumer/lessons/2-language-understanding/README.md b/6-consumer/lessons/2-language-understanding/README.md index aeec645..811bd1d 100644 --- a/6-consumer/lessons/2-language-understanding/README.md +++ b/6-consumer/lessons/2-language-understanding/README.md @@ -6,7 +6,7 @@ Add a sketchnote if possible/appropriate ## Pre-lecture quiz -[Pre-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/33) +[Pre-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/43) ## Introduction @@ -155,14 +155,18 @@ You can find instructions for using the LUIS portal in the [Quickstart: Build yo * `set a 1 second timer` * `set a 4 minute timer` + * `set a four minute six second timer` * `set a 9 minute 30 second timer` * `set a timer for 1 minute and 12 seconds` * `set a timer for 3 minutes` * `set a timer for 3 minutes and 1 second` - * `set a timer for 1 minute1 and 1 second` + * `set a timer for three minutes and one second` + * `set a timer for 1 minute and 1 second` * `set a timer for 30 seconds` * `set a timer for 1 second` + Mix up numbers as words and numerics so the model learns to handle both. + 1. As you enter each example, LUIS will start detecting entities, and will underline and label any it finds. ![The examples with the numbers and time units underlined by LUIS](../../../images/luis-intent-examples.png) @@ -419,7 +423,7 @@ There are many ways to request the same thing, such as setting a timer. Think of ## Post-lecture quiz -[Post-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/34) +[Post-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/44) ## Review & Self Study diff --git a/6-consumer/lessons/3-spoken-feedback/README.md b/6-consumer/lessons/3-spoken-feedback/README.md index 4de5fc2..aac7471 100644 --- a/6-consumer/lessons/3-spoken-feedback/README.md +++ b/6-consumer/lessons/3-spoken-feedback/README.md @@ -6,17 +6,73 @@ Add a sketchnote if possible/appropriate ## Pre-lecture quiz -[Pre-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/33) +[Pre-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/45) ## Introduction -In this lesson you will learn about +Smart assistants are not one-way communication devices. You speak to them, and they respond: + +"Alexa, set a 3 minute timer" + +"Ok, your timer is set for 3 minutes" + +In the last 2 lessons you learned how to take speech and create text, then extract a set timer request from that text. In this lesson you will learn how to set the timer on the IoT device, responding to the user with spoken words confirming their timer, and alerting them when their timer is finished. In this lesson we'll cover: -* [Thing 1](#thing-1) +* [Text to speech](#text-to-speech) +* [Set the timer](#set-the-timer) +* [Convert text to speech](#convert-text-to-speech) + +## Text to speech + +## Set the timer + +The timer can be set by sending a command from the serverless code, instructing the IoT device to set the timer. This command will contain the time in seconds till the timer needs to go off. + +### Task - set the timer using a command + +1. In your serverless code, add code to send a direct method request to your IoT device + + > ⚠️ You can refer to [the instructions for sending direct method requests in lesson 5 of the farm project if needed](../../../2-farm/lessons/5-migrate-application-to-the-cloud/README.md#send-direct-method-requests-from-serverless-code). + + You will need to set up the connection string for the IoT Hub with the service policy (*NOT* the device) in your `local.settings.json` file and add the `azure-iot-hub` pip package to your `requirements.txt` file. The device ID can be extracted from the event. + +1. The direct method you send needs to be called `set-timer`, and will need to send the length of the timer as a JSON property called `time`. Use the following code to build the `CloudToDeviceMethod` using the `total_time` calculated from the data extracted by LUIS: + + ```python + payload = { + 'time': total_time + } + direct_method = CloudToDeviceMethod(method_name='set-timer', payload=json.dumps(payload)) + ``` + +> 💁 You can find this code in the [code-command/functions](code-command/functions) folder. + +### Task - respond to the command on the IoT device + +1. On your IoT device, respond to the command. + + > ⚠️ You can refer to [the instructions for handling direct method requests from IoT devices in lesson 4 of the farm project if needed](../../../2-farm/lessons/4-migrate-your-plant-to-the-cloud#task---connect-your-iot-device-to-the-cloud). + +1. Work through the relevant guide to set a timer for the required time: + +* [Arduino - Wio Terminal](wio-terminal-set-timer.md) +* [Single-board computer - Raspberry Pi/Virtual IoT device](single-board-computer-set-timer.md) + +> 💁 You can find this code in the [code-command/wio-terminal](code-command/wio-terminal), [code-command/virtual-device](code-command/virtual-device), or [code-command/pi](code-command/pi) folder. + +## Convert text to speech + +The same speech service you used to convert speech to text can be used to convert text back into speech, and this can be played through a microphone on your IoT device. + +### Task - convert text to speech + +Work through the relevant guide to convert text to speech using your IoT device: -## Thing 1 +* [Arduino - Wio Terminal](wio-terminal-text-to-speech.md) +* [Single-board computer - Raspberry Pi](pi-text-to-speech.md) +* [Single-board computer - Virtual device](virtual-device-text-to-speech.md) --- @@ -24,7 +80,7 @@ In this lesson we'll cover: ## Post-lecture quiz -[Post-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/34) +[Post-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/46) ## Review & Self Study diff --git a/6-consumer/lessons/4-multiple-language-support/README.md b/6-consumer/lessons/4-multiple-language-support/README.md index 719a303..d92c80d 100644 --- a/6-consumer/lessons/4-multiple-language-support/README.md +++ b/6-consumer/lessons/4-multiple-language-support/README.md @@ -6,7 +6,7 @@ Add a sketchnote if possible/appropriate ## Pre-lecture quiz -[Pre-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/33) +[Pre-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/47) ## Introduction @@ -24,7 +24,7 @@ In this lesson we'll cover: ## Post-lecture quiz -[Post-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/34) +[Post-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/48) ## Review & Self Study diff --git a/README.md b/README.md index c901e77..9eddc06 100644 --- a/README.md +++ b/README.md @@ -83,8 +83,8 @@ We have two choices of IoT hardware to use for the projects depending on persona | 16 | [Manufacturing](./4-manufacturing) | Check fruit quality from an IoT device | Learn about using your fruit quality detector from an IoT device | [Check fruit quality from an IoT device](./4-manufacturing/lessons/2-check-fruit-from-device/README.md) | | 17 | [Manufacturing](./4-manufacturing) | Run your fruit detector on the edge | Learn about running your fruit detector on an IoT device on the edge | [Run your fruit detector on the edge](./4-manufacturing/lessons/3-run-fruit-detector-edge/README.md) | | 18 | [Manufacturing](./4-manufacturing) | Trigger fruit quality detection from a sensor | Learn about triggering fruit quality detection from a sensor | [Trigger fruit quality detection from a sensor](./4-manufacturing/lessons/4-trigger-fruit-detector/README.md) | -| 19 | [Retail](./5-retail) | | | -| 20 | [Retail](./5-retail) | | | +| 19 | [Retail](./5-retail) | Train a stock detector | Learn how to use object detection to train a stock detector to count stock in a shop | [Train a stock detector](./5-retail/lessons/1-train-stock-detector/README.md) | +| 20 | [Retail](./5-retail) | Check stock from an IoT device | Learn how to check stock from an IoT device using an object detection model | [Check stock from an IoT device](./5-retail/lessons/2-check-stock-device/README.md) | | 21 | [Consumer](./6-consumer) | Recognize speech with an IoT device | Learn how to recognize speech from an IoT device to build a smart timer | [Recognize speech with an IoT device](./6-consumer/lessons/1-speech-recognition/README.md) | | 22 | [Consumer](./6-consumer) | Understand language | Learn how to understand sentences spoken to an IoT device | [Understand language](./6-consumer/lessons/2-language-understanding/README.md) | | 23 | [Consumer](./6-consumer) | Set a timer and provide spoken feedback | Learn how to set a timer on an IoT device and give spoken feedback on when the timer is set and when it finishes | [Set a timer and provide spoken feedback](./6-consumer/lessons/3-spoken-feedback/README.md) |