This commit is contained in:
Lateefah Bello 2021-06-18 09:25:04 +01:00
Родитель 7afed015f4 34967c3705
Коммит b2403c2cd8
21 изменённых файлов: 1552 добавлений и 24 удалений

Просмотреть файл

@ -0,0 +1,284 @@
# <div dir="rtl"> مقدمة لإنترنت الأشياء </div>
![A sketchnote overview of this lesson](../../../../sketchnotes/lesson-1.png)
> <div dir="rtl"> خريطة من <a href="https://github.com/nitya">Nitya Narasimhan</a> </div>
> <div dir="rtl"> اضغط على الصورة لتكبيرها </div>
## <div dir="rtl"> اختبار ما قبل المحاضرة </div>
[<div dir="rtl"> اختبار ما قبل المحاضرة </div>](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/1)
## <div dir="rtl"> المقدمة </div>
<div dir="rtl"> يغطي هذا الدرس بعض الموضوعات التمهيدية حول إنترنت الأشياء ، ويساعدك على إعداد أجهزتك. </div>
<div dir="rtl"> سنغطي في هذا الدرس: </div>
<div dir="rtl">
- [ ما هو انترنت الأشياء ](#what-is-the-internet-of-things)
- [الأجهزة المتعلقة بانترنت الأشياء](#iot-devices)
- [قم بإعداد جهازك](#set-up-your-device)
- [تطبيقات انترنت الأشياء](#applications-of-iot)
- [أمثلة على أجهزة إنترنت الأشياء التي قد تكون موجودة حولك](#examples-of-iot-devices-you-may-have-around-you)
</div>
## <div dir="rtl"> ما هو "انترنت الأشياء"؟ </div>
<div dir="rtl"> مصطلح "إنترنت الأشياء" ابتكره
<a href="https://wikipedia.org/wiki/KevinAshton">Kevin Ashton</a>
في عام 1999 ، للإشارة إلى توصيل الإنترنت بالعالم المادي عبر أجهزة الاستشعار. منذ ذلك الحين ، تم استخدام المصطلح لوصف أي جهاز يتفاعل مع العالم المادي من حوله ، إما عن طريق جمع البيانات من أجهزة الاستشعار ، أو توفير تفاعلات في العالم الحقيقي عبر المشغلات (الأجهزة التي تقوم بشيء مثل تشغيل مفتاح أو إضاءة LED ) ، متصلة بشكل عام بأجهزة أخرى أو بالإنترنت. </div>
> <div dir="rtl"> المستشعرات تجمع المعلومات من العالم ، مثل قياس السرعة أو درجة الحرارة أو الموقع. </div>
>
> <div dir="rtl"> المشغلات تحول الإشارات الكهربائية إلى تفاعلات في العالم الحقيقي مثل تشغيل مفتاح أو تشغيل الأضواء أو إصدار أصوات أو إرسال إشارات تحكم إلى أجهزة أخرى ، على سبيل المثال لتشغيل مقبس طاقة. </div>
<div dir="rtl">إن إنترنت الأشياء كمجال تقني هو أكثر من مجرد أجهزة - فهو يشمل الخدمات المستندة إلى السحابة التي يمكنها معالجة بيانات المستشعر ، أو إرسال طلبات إلى المشغلات المتصلة بأجهزة إنترنت الأشياء. ويشمل أيضًا الأجهزة التي لا تحتوي على اتصال بالإنترنت أو لا تحتاج إليه ، وغالبًا ما يشار إليها باسم الأجهزة المتطورة. هذه هي الأجهزة التي يمكنها معالجة بيانات الاستشعار والاستجابة لها بنفسها ، وعادةً ما تستخدم نماذج الذكاء الاصطناعي المدربة في السحابة.</div>
<div dir="rtl">إنترنت الأشياء هو مجال تكنولوجي سريع النمو. تشير التقديرات إلى أنه بحلول نهاية عام 2020 ، تم نشر 30 مليار جهاز إنترنت الأشياء وتوصيلها بالإنترنت. بالنظر إلى المستقبل ، تشير التقديرات إلى أنه بحلول عام 2025 ، ستجمع أجهزة إنترنت الأشياء ما يقرب من 80 زيتابايت من البيانات ، أو 80 تريليون جيجابايت. هذا كثير من البيانات!</div>
![A graph showing active IoT devices over time, with an upward trend from under 5 billion in 2015 to over 30 billion in 2025](../../../../images/connected-iot-devices.svg)
<div dir="rtl">✅ قم بإجراء القليل من البحث: ما مقدار البيانات التي تم إنشاؤها بواسطة أجهزة إنترنت الأشياء المستخدمة بالفعل ، وكم يتم إهدارها؟ لماذا يتم تجاهل الكثير من البيانات؟ </div>
<div dir="rtl">
هذه البيانات هي مفتاح نجاح إنترنت الأشياء. لكي تكون مطورًا ناجحًا لإنترنت الأشياء ، فأنت بحاجة إلى فهم البيانات التي تحتاج إلى جمعها ، وكيفية جمعها ، وكيفية اتخاذ القرارات بناءً عليها ، وكيفية استخدام هذه القرارات للتفاعل مع العالم المادي إذا لزم الأمر.</div>
## <div dir="rtl">الأجهزة المتعلقة بانترنت الأشياء</div>
<div dir="rtl">
يرمز T في إنترنت الأشياء إلى الأشياء - الأجهزة التي تتفاعل مع العالم المادي من حولها إما عن طريق جمع البيانات من أجهزة الاستشعار ، أو توفير تفاعلات واقعية عبر المشغلات.
عادةً ما تكون الأجهزة المخصصة للإنتاج أو الاستخدام التجاري ، مثل أجهزة تتبع اللياقة البدنية للمستهلكين أو أجهزة التحكم في الآلات الصناعية ، مصنوعة خصيصًا. يستخدمون لوحات دوائر مخصصة ، وربما حتى معالجات مخصصة ، مصممة لتلبية احتياجات مهمة معينة ، سواء كانت صغيرة بما يكفي لتناسب معصمك ، أو متينة بما يكفي للعمل في درجات حرارة عالية ، أو ضغط مرتفع ، أو بيئة مصنع عالية الاهتزاز.
بصفتك مطورًا إما يتعلم عن إنترنت الأشياء أو يصنع نموذجًا أوليًا للجهاز ، فستحتاج إلى البدء بمجموعة أدوات التطوير. هذه أجهزة إنترنت الأشياء للأغراض العامة مصممة للمطورين لاستخدامها ، غالبًا مع ميزات لن تراها على جهاز إنتاج ، مثل مجموعة من المسامير الخارجية لتوصيل المستشعرات أو المشغلات بها ، أو الأجهزة لدعم التصحيح ، أو الموارد الإضافية التي سيضيف تكلفة غير ضرورية عند إجراء عملية تصنيع كبيرة.
تنقسم مجموعات المطورين هذه عادةً إلى فئتين - المتحكمات الدقيقة وأجهزة الكمبيوتر أحادية اللوحة. سيتم تقديم هذه هنا ، وسنتناول المزيد من التفاصيل في الدرس التالي.
>💁يمكن أيضًا اعتبار هاتفك جهاز إنترنت الأشياء للأغراض العامة ، مع أجهزة استشعار ومحركات مدمجة ، مع تطبيقات مختلفة تستخدم المستشعرات والمشغلات بطرق مختلفة مع خدمات سحابية مختلفة. يمكنك أيضًا العثور على بعض البرامج التعليمية لإنترنت الأشياء التي تستخدم تطبيق الهاتف كجهاز إنترنت الأشياء.
</div>
</br>
### <div dir="rtl">المتحكم الدقيق</div>
<div dir="rtl">
المتحكم الدقيق (يشار إليه أيضًا باسم MCU ، اختصارًا لوحدة التحكم الدقيقة) هو جهاز كمبيوتر صغير يتكون من:
🧠 واحدة أو أكثر من وحدات المعالجة المركزية (CPUs) - "عقل" المتحكم الدقيق الذي يدير برنامجك
💾 الذاكرة (ذاكرة الوصول العشوائي وذاكرة البرنامج) - حيث يتم تخزين البرنامج والبيانات والمتغيرات الخاصة بك
🔌 اتصالات الإدخال / الإخراج القابلة للبرمجة (I / O) - للتحدث إلى الأجهزة الطرفية الخارجية (الأجهزة المتصلة) مثل المستشعرات والمشغلات
عادةً ما تكون وحدات التحكم الدقيقة أجهزة حوسبة منخفضة التكلفة ، حيث ينخفض ​​متوسط ​​أسعار الأجهزة المستخدمة في الأجهزة المخصصة إلى حوالي 0.50 دولار أمريكي ، وبعض الأجهزة رخيصة مثل 0.03 دولار أمريكي. يمكن أن تبدأ مجموعات المطورين بسعر منخفض يصل إلى 4 دولارات أمريكية ، مع ارتفاع التكاليف كلما أضفت المزيد من الميزات. <a href="https://www.seeedstudio.com/Wio-Terminal-p-4509.html">محطة Wio</a>, مجموعة مطور متحكم من <a href="https://www.seeedstudio.com">Seeed studios</a> تحتوي على أجهزة استشعار ومحركات واي فاي وشاشة تكلف حوالي 30 دولارًا أمريكيًا.
</div>
![A Wio Terminal](../../../../images/wio-terminal.png)
> <div dir="rtl">💁 عند البحث في الإنترنت عن المتحكمات الدقيقة ، احذر من البحث عن المصطلح MCU لأن هذا سيعيد لك الكثير من النتائج ل Marvel السينمائي ، وليس للمتحكمات الدقيقة.</div>
<div dir="rtl">
تم تصميم وحدات التحكم الدقيقة بحيث تتم برمجتها للقيام بعدد محدود من المهام المحددة للغاية ، بدلاً من أن تكون أجهزة كمبيوتر للأغراض العامة مثل أجهزة الكمبيوتر الشخصية أو أجهزة Mac. باستثناء سيناريوهات محددة للغاية ، لا يمكنك توصيل الشاشة ولوحة المفاتيح والماوس واستخدامها في مهام الأغراض العامة.
عادة ما تأتي مجموعات مطوري وحدات التحكم الدقيقة بأجهزة استشعار ومشغلات إضافية على متنها. تحتوي معظم اللوحات على واحد أو أكثر من مصابيح LED التي يمكنك برمجتها ، بالاضافة الى الأجهزة الأخرى مثل المقابس القياسية لإضافة المزيد من أجهزة الاستشعار أو المشغلات باستخدام أنظمة بيئية مختلفة للمصنعين ، أو أجهزة استشعار مدمجة (عادةً ما تكون الأكثر شيوعًا مثل مستشعرات درجة الحرارة). تحتوي بعض وحدات التحكم الدقيقة على اتصال لاسلكي مدمج مثل Bluetooth أو WiFi ، أو تحتوي على وحدات تحكم دقيقة إضافية على اللوحة لإضافة هذا الاتصال.
</div>
> <div dir="rtl">💁 عادة ما يتم برمجة المتحكمات الدقيقة في C / C ++. </div>
### <div dir="rtl"> أجهزة كمبيوتر أحادية اللوحة</div>
<div dir="rtl"> الكمبيوتر أحادي اللوحة هو جهاز حوسبة صغير يحتوي على جميع عناصر الكمبيوتر الكامل الموجودة على لوحة صغيرة واحدة. هذه هي الأجهزة التي لها مواصفات قريبة من سطح المكتب أو الكمبيوتر المحمول أو جهاز Mac ، وتعمل بنظام تشغيل كامل ، ولكنها صغيرة ، وتستخدم طاقة أقل ، وأرخص بكثير.</div>
![A Raspberry Pi 4](../../../../images/raspberry-pi-4.jpg)
***Raspberry Pi 4. Michael Henzler / [Wikimedia Commons](https://commons.wikimedia.org/wiki/Main_Page) / [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)***
<div dir="rtl">
يعد Raspberry Pi أحد أشهر أجهزة الكمبيوتر أحادية اللوحة.
مثل وحدة التحكم الدقيقة ، تحتوي أجهزة الكمبيوتر أحادية اللوحة على وحدة معالجة مركزية وذاكرة ودبابيس إدخال / إخراج ، ولكنها تحتوي على ميزات إضافية مثل شريحة رسومات للسماح لك بتوصيل الشاشات ومخرجات الصوت ومنافذ USB مثل كاميرات الويب أو وحدات التخزين الخارجية. يتم تخزين البرامج على بطاقات SD أو محركات أقراص ثابتة بالاضافة الى نظام التشغيل ، بدلاً من شريحة ذاكرة مدمجة في اللوحة.
</div>
> <div dir="rtl">🎓 يمكنك التفكير في الكمبيوتر أحادي اللوحة كإصدار أصغر وأرخص من الكمبيوتر الشخصي أو جهاز Mac الذي تقرأ عليه ، مع إضافة دبابيس GPIO (إدخال / إخراج للأغراض العامة) للتفاعل مع المستشعرات والمحركات.</div>
<div dir="rtl">أجهزة الكمبيوتر أحادية اللوحة هي أجهزة كمبيوتر كاملة الميزات ، لذا يمكن برمجتها بأي لغة. عادةً ما تتم برمجة أجهزة إنترنت الأشياء بلغة Python.</div>
</br>
### <div dir="rtl"> اختيارات الأجهزة لبقية الدروس</div>
<div dir="rtl">تتضمن جميع الدروس اللاحقة مهام باستخدام جهاز إنترنت الأشياء للتفاعل مع العالم والتواصل مع السحابة. يدعم كل درس 3 خيارات للأجهزة - Arduino (باستخدام Seeed Studios Wio Terminal) ، أو كمبيوتر لوحة واحدة ، إما جهاز (Raspberry Pi 4) ، أو جهاز كمبيوتر افتراضي أحادي اللوحة يعمل على الكمبيوتر الشخصي أو جهاز Mac.</div>
يمكنك أن تقرأ عن الأجهزة اللازمة لإكمال جميع المهام في ملف [hardware guide](../../../../hardware.md)
> <div dir="rtl">💁 لا تحتاج إلى شراء أي جهاز إنترنت الأشياء لإكمال المهام ، يمكنك القيام بكل شيء باستخدام جهاز كمبيوتر افتراضي أحادي اللوحة. </div>
<div dir="rtl">تحديد الأجهزة التي تختارها متروك لك - يعتمد ذلك على ما لديك إما في المنزل أو في مدرستك ، ولغة البرمجة التي تعرفها أو تخطط لتعلمها. سيستخدم كلا النوعين من الأجهزة نفس نظام المستشعر البيئي ، لذلك إذا بدأت في مسار واحد ، يمكنك التغيير إلى الآخر دون الحاجة إلى استبدال معظم المجموعة. سيكون الكمبيوتر الافتراضي أحادي اللوحة مكافئًا للتعلم على Raspberry Pi ، حيث يمكن نقل معظم الشفرة إلى Pi إذا حصلت في النهاية على جهاز ومستشعرات.</div>
</br>
### <div dir="rtl"> مجموعة مطوري Arduino </div>
<div dir="rtl"> إذا كنت مهتمًا بتعلم تطوير وحدة التحكم الدقيقة ، فيمكنك إكمال المهام باستخدام جهاز Arduino. ستحتاج إلى فهم أساسي لبرمجة C / C ++ ، حيث أن الدروس ستعلم فقط الكود ذي صلة بإطار عمل Arduino ، وأجهزة الاستشعار والمشغلات المستخدمة ، والمكتبات التي تتفاعل مع السحابة. </div>
<div dir="rtl"> ستستخدم الواجبات <a href="https://www.seeedstudio.com/Wio-Terminal-p-4509.html">Visual Studio Code</a> مع <a href="https://www.seeedstudio.com/Wio-Terminal-p-4509.html">امتداد PlatformIO لتطوير وحدة التحكم الدقيقة</a>. يمكنك أيضًا استخدام Arduino IDE إذا كنت من ذوي الخبرة في هذه الأداة ، حيث لن يتم توفير الإرشادات.</div>
</br>
### <div dir="rtl"> مجموعة مطوري الكمبيوتر أحادية اللوحة </div>
<div dir="rtl">
إذا كنت مهتمًا بتعلم تطوير إنترنت الأشياء باستخدام أجهزة كمبيوتر أحادية اللوحة ، فيمكنك إكمال المهام باستخدام Raspberry Pi ، أو جهاز افتراضي يعمل على جهاز الكمبيوتر أو جهاز Mac.
ستحتاج إلى فهم أساسي لبرمجة Python ، حيث ستعلم الدروس فقط التعليمات البرمجية ذات الصلة بالمستشعرات والمشغلات المستخدمة والمكتبات التي تتفاعل مع السحابة.
</div>
> <div dir="rtl">💁 إذا كنت تريد تعلم البرمجة في Python ، فراجع سلسلتي الفيديو التاليين:
>
>* [بايثون للمبتدئين](https://channel9.msdn.com/Series/Intro-to-Python-Development?WT.mc_id=academic-17441-jabenn)
> * [ المزيد من بايثون للمبتدئين ](https://channel9.msdn.com/Series/More-Python-for-Beginners?WT.mc_id=academic-7372-jabenn)
</div>
<div dir="rtl">
الواجبات ستستخدم <a href="https://www.seeedstudio.com/Wio-Terminal-p-4509.html">Visual Studio Code</a>
إذا كنت تستخدم Raspberry Pi ، فيمكنك إما تشغيل Pi الخاص بك باستخدام إصدار سطح المكتب الكامل من Raspberry Pi OS ، والقيام بكل الترميز مباشرة على Pi باستخدام <a href="https://code.visualstudio.com/docs/setup/raspberry-pi?WT.mc_id=academic-17441-jabenn">the Raspberry Pi OS version of VS Code</a> ، أو قم بتشغيل Pi من جهاز الكمبيوتر أو جهاز Mac باستخدام VS Code مع <a href="https://code.visualstudio.com/docs/remote/ssh?WT.mc_id=academic-17441-jabenn">Remote SSH extension</a> التي يتيح لك الاتصال بـ Pi الخاص بك وتحرير التعليمات البرمجية وتصحيحها وتشغيلها كما لو كنت تقوم بالتشفير عليها مباشرةً.
إذا كنت تستخدم خيار الجهاز الظاهري ، فستقوم بالتشفير مباشرة على جهاز الكمبيوتر الخاص بك. بدلاً من الوصول إلى المستشعرات والمشغلات ، ستستخدم أداة لمحاكاة هذا الجهاز لتوفير قيم أجهزة الاستشعار التي يمكنك تحديدها ، وإظهار نتائج المشغلات على الشاشة.
</div>
### <div dir="rtl"> قم بإعداد جهازك </div>
<div dir="rtl"> قبل أن تبدأ في برمجة جهاز إنترنت الأشياء الخاص بك ، ستحتاج إلى إجراء قدر صغير من الإعداد. اتبع التعليمات ذات الصلة أدناه بناءً على الجهاز الذي ستستخدمه. </div>
> <div dir="rtl">💁 إذا لم يكن لديك جهاز بعد ، فارجع إلى </div>
>
>[hardware guide](../../../../hardware.md) للمساعدة في تحديد الجهاز الذي ستستخدمه والأجهزة الإضافية التي تحتاج إلى شرائها. لا تحتاج إلى شراء أجهزة ، حيث يمكن تشغيل جميع المشاريع على أجهزة افتراضية.
<div dir="rtl">
تتضمن هذه التعليمات ارتباطات إلى مواقع ويب تابعة لجهات خارجية من منشئي الأجهزة أو الأدوات التي ستستخدمها. هذا للتأكد من أنك تستخدم دائمًا أحدث الإرشادات للأدوات والأجهزة المختلفة.
اعمل من خلال الدليل ذي الصلة لإعداد جهازك وإكمال مشروع "Hello World". ستكون هذه هي الخطوة الأولى في إنشاء ضوء ليلي لإنترنت الأشياء على الدروس الأربعة .
* [ وحدة Arduino - Wio ](../wio-terminal.md)
* [كمبيوتر ذو لوحة واحدة - Raspberry Pi](../pi.md)
* [كمبيوتر ذو لوحة واحدة - جهاز افتراضي](../virtual-device.md)
</div>
### <div dir="rtl"> تطبيقات إنترنت الأشياء </div>
<div dir="rtl">يغطي إنترنت الأشياء مجموعة كبيرة من حالات الاستخدام عبر مجموعات قليلة:
* انترنت الاشياء المستهلك
* إنترنت الأشياء التجاري
* إنترنت الأشياء الصناعي
* انترنت الاشياء البنية التحتية
</div>
<div dir="rtl">✅ قم ببعض البحث: لكل مجال من المجالات الموضحة أدناه ، ابحث عن مثال ملموس واحد لم يرد في النص.</div>
### <div dir="rtl"> انترنت الاشياء المستهلك </div>
<div dir="rtl">
يشير IoT للمستهلكين إلى أجهزة IoT التي سيشتريها المستهلكون ويستخدمونها في المنزل. بعض هذه الأجهزة مفيدة بشكل لا يصدق ، مثل مكبرات الصوت الذكية وأنظمة التدفئة الذكية والمكانس الكهربائية الآلية. البعض الآخر مشكوك فيه في فائدته ، مثل الصنابير التي يتم التحكم فيها بالصوت والتي تعني بعد ذلك أنه لا يمكنك إيقاف تشغيلها لأن التحكم الصوتي لا يمكنه سماع صوت المياه الجارية.
تعمل أجهزة إنترنت الأشياء للمستهلكين على تمكين الأشخاص من تحقيق المزيد في محيطهم ، وخاصة المليار شخص من ذوي الإعاقة. يمكن للمكانس الكهربائية الروبوتية توفير أرضيات نظيفة للأشخاص الذين يعانون من مشاكل في الحركة والذين لا يستطيعون تنظيف أنفسهم ، وتسمح الأفران التي يتم التحكم فيها بالصوت للأشخاص ذوي الرؤية المحدودة أو التحكم في المحرك بتسخين أفرانهم بصوتهم فقط ، ويمكن أن تسمح أجهزة المراقبة الصحية للمرضى بمراقبة الحالات المزمنة بأنفسهم بمزيد من الانتظام والمزيد من التحديثات التفصيلية عن ظروفهم. أصبحت هذه الأجهزة منتشرة في كل مكان حتى أن الأطفال الصغار يستخدمونها كجزء من حياتهم اليومية ، على سبيل المثال الطلاب الذين يقومون بالتعليم الافتراضي أثناء جائحة COVID يضبطون أجهزة ضبط الوقت على الأجهزة المنزلية الذكية لتتبع أعمالهم المدرسية أو أجهزة الإنذار لتذكيرهم باجتماعات الفصل القادمة.
</div>
<div dir="rtl">✅ ما هي أجهزة IoT الاستهلاكية التي لديك أو في منزلك؟ </div>
</br>
### <div dir="rtl">انترنت الأشياء التجاري </div>
<div dir="rtl">
يغطي إنترنت الأشياء التجاري استخدام إنترنت الأشياء في مكان العمل. في مكتب ما ، قد يكون هناك أجهزة استشعار إشغال وكاشفات حركة لإدارة الإضاءة والتدفئة لإبقاء الأضواء والتدفئة فقط عند عدم الحاجة إليها ، مما يقلل التكلفة وانبعاثات الكربون. في المصنع ، يمكن لأجهزة إنترنت الأشياء مراقبة مخاطر السلامة مثل عدم ارتداء العمال للقبعات الصلبة أو الضوضاء التي وصلت إلى مستويات خطيرة. في البيع بالتجزئة ، يمكن لأجهزة إنترنت الأشياء قياس درجة حرارة التخزين البارد ، وتنبيه صاحب المتجر إذا كانت الثلاجة أو الفريزر خارج نطاق درجة الحرارة المطلوبة ، أو يمكنهم مراقبة العناصر الموجودة على الأرفف لتوجيه الموظفين لإعادة تعبئة المنتجات التي تم بيعها. تعتمد صناعة النقل أكثر فأكثر على إنترنت الأشياء لمراقبة مواقع المركبات ، وتتبع الأميال على الطريق لشحن مستخدمي الطريق ، وتتبع ساعات السائق وانقطاع الامتثال ، أو إخطار الموظفين عند اقتراب مركبة من المستودع للاستعداد للتحميل أو التفريغ.
</div>
<div dir="rtl">✅ ما هي أجهزة إنترنت الأشياء التجارية المتوفرة لديك في مدرستك أو مكان عملك؟ </div>
</br>
### <div dir="rtl">انترنت الأشياء الصناعي </div>
<div dir="rtl">
إنترنت الأشياء الصناعي ، أو IIoT ، هو استخدام أجهزة إنترنت الأشياء للتحكم في الآلات وإدارتها على نطاق واسع. يغطي هذا مجموعة واسعة من حالات الاستخدام ، من المصانع إلى الزراعة الرقمية.
تستخدم المصانع أجهزة إنترنت الأشياء بعدة طرق مختلفة. يمكن مراقبة الماكينات بأجهزة استشعار متعددة لتتبع أشياء مثل درجة الحرارة والاهتزاز وسرعة الدوران. يمكن بعد ذلك مراقبة هذه البيانات للسماح للجهاز بالتوقف إذا خرج عن تفاوتات معينة - يعمل على درجة حرارة عالية جدًا ويتم إيقاف تشغيله على سبيل المثال. يمكن أيضًا جمع هذه البيانات وتحليلها بمرور الوقت لإجراء الصيانة التنبؤية ، حيث ستنظر نماذج الذكاء الاصطناعي في البيانات المؤدية إلى الفشل ، وتستخدم ذلك للتنبؤ بحالات الفشل الأخرى قبل حدوثها.
تعتبر الزراعة الرقمية مهمة إذا كان كوكب الأرض يريد إطعام العدد المتزايد من السكان ، خاصة بالنسبة لملياري شخص في 500 مليون أسرة تعيش على <a href="https://wikipedia.org/wiki/Subsistence_agriculture">زراعة الكفاف</a> يمكن أن تتراوح الزراعة الرقمية من عدد قليل من أجهزة الاستشعار بالدولار الواحد ، إلى الأجهزة التجارية الضخمة. يمكن للمزارع أن يبدأ بمراقبة درجات الحرارة واستخدام <a href="https://wikipedia.org/wiki/Growing_degree-day">أيام الدرجات المتزايدة</a> للتنبؤ بموعد جاهزية المحصول للحصاد. يمكنهم ربط مراقبة رطوبة التربة بأنظمة الري الآلية لمنح نباتاتهم القدر المطلوب من المياه ، ولكن ليس أكثر لضمان عدم جفاف محاصيلهم دون إهدار المياه. بل إن المزارعين يأخذون الأمر إلى أبعد من ذلك ويستخدمون الطائرات بدون طيار وبيانات الأقمار الصناعية والذكاء الاصطناعي لمراقبة نمو المحاصيل والأمراض وجودة التربة في مساحات شاسعة من الأراضي الزراعية
</div>
<div dir="rtl">✅ ما هي أجهزة إنترنت الأشياء الأخرى التي يمكن أن تساعد المزارعين؟ </div>
### <div dir="rtl"> انترنت الاشياء البنية التحتية </div>
<div dir="rtl"> يقوم إنترنت الأشياء للبنية التحتية بمراقبة والتحكم في البنية التحتية المحلية والعالمية التي يستخدمها الناس كل يوم. </div>
<div dir="rtl"> <a href="https://wikipedia.org/wiki/Growing_degree-day">المدن الذكية </a> هي مناطق حضرية تستخدم أجهزة إنترنت الأشياء لجمع البيانات حول المدينة واستخدامها لتحسين كيفية إدارة المدينة. عادة ما يتم تشغيل هذه المدن بالتعاون بين الحكومات المحلية والأوساط الأكاديمية والشركات المحلية ، وتتبع وإدارة الأشياء التي تختلف من النقل إلى وقوف السيارات والتلوث. على سبيل المثال ، في كوبنهاغن ، الدنمارك ، يعد تلوث الهواء مهمًا للسكان المحليين ، لذلك يتم قياسه واستخدام البيانات لتوفير معلومات حول أنظف طرق ركوب الدراجات والركض. </div>
<div dir="rtl"> <a href="https://wikipedia.org/wiki/Smart_grid">شبكات الكهرباء الذكية </a> تسمح بتحليلات أفضل للطلب على الطاقة من خلال جمع بيانات الاستخدام على مستوى المنازل الفردية. يمكن أن توجه هذه البيانات القرارات على مستوى الدولة بما في ذلك مكان بناء محطات طاقة جديدة ، وعلى المستوى الشخصي من خلال إعطاء المستخدمين رؤى حول مقدار الطاقة التي يستخدمونها ، وأوقات استخدامها ، وحتى اقتراحات حول كيفية تقليل التكاليف ، مثل لشحن السيارات الكهربائية في الليل. </div>
<div dir="rtl">✅ إذا كان بإمكانك إضافة أجهزة إنترنت الأشياء لقياس أي شيء تعيش فيه ، فماذا سيكون؟</div>
</br>
### <div dir="rtl">أمثلة على أجهزة إنترنت الأشياء التي قد تكون موجودة حولك </div>
<div dir="rtl">
ستندهش من عدد أجهزة إنترنت الأشياء الموجودة حولك. أكتب هذا من المنزل و لدي الأجهزة التالية متصلة بالإنترنت بميزات ذكية مثل التحكم في التطبيق أو التحكم الصوتي أو القدرة على إرسال البيانات إلي عبر هاتفي:
* مكبرات صوت ذكية متعددة
* ثلاجة وغسالة صحون وفرن وميكروويف
* مرقاب كهرباء الألواح الشمسية
* المقابس الذكية
* جرس باب بالفيديو وكاميرات مراقبة
* ترموستات ذكي مع عدة مستشعرات ذكية للغرفة
* فتحت باب المرآب
* أنظمة الترفيه المنزلي وأجهزة التلفزيون ذات التحكم الصوتي
* أضواء
* أجهزة تتبع اللياقة البدنية والصحة
كل هذه الأنواع من الأجهزة لها مستشعرات و / أو مشغلات وتتحدث إلى الإنترنت. يمكنني معرفة ما إذا كان باب الكاراج الخاص بي مفتوحًا من هاتفي ، وأطلب من السماعة الذكية إغلاقها من أجلي. يمكنني حتى ضبطه على مؤقت ، لذلك إذا كان لا يزال مفتوحًا في الليل ، فسيتم إغلاقه تلقائيًا. عندما يرن جرس الباب ، يمكنني أن أرى من هاتفي من يوجد أينما كنت في العالم ، وأتحدث إليهم عبر مكبر صوت وميكروفون مدمجين في جرس الباب. يمكنني مراقبة الجلوكوز في الدم ومعدل ضربات القلب وأنماط النوم ، والبحث عن أنماط في البيانات لتحسين صحتي. يمكنني التحكم في الأضواء الخاصة بي عبر السحابة ، والجلوس في الظلام عندما ينقطع الاتصال بالإنترنت.
</div>
---
## <div dir="rtl">تحدي </div>
<div dir="rtl">ضع قائمة بأكبر عدد ممكن من أجهزة إنترنت الأشياء الموجودة في منزلك أو مدرستك أو مكان عملك - قد يكون هناك أكثر مما تعتقد! </div>
</br>
## <div dir="rtl">مسابقة ما بعد المحاضرة </div>
<div dir="rtl">
<a href="https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/2">مسابقة ما بعد المحاضرة </a> </div>
</br>
## <div dir="rtl">المراجعة والدراسة الذاتية </div>
<div dir="rtl"> اقرأ عن مزايا وإخفاقات مشروعات إنترنت الأشياء للمستهلكين. تحقق من المواقع الإخبارية بحثًا عن مقالات عن الأوقات التي حدث فيها خطأ ، مثل مشكلات الخصوصية أو مشكلات الأجهزة أو المشكلات الناجمة عن نقص الاتصال.
بعض الأمثلة:
* قم بالاطلاع على حساب التويتر لأمثلة جيدة على انترنت الاشياء المستهلك **[Internet of Sh*t](https://twitter.com/internetofshit)** *(profanity warning)*
* [c|net - My Apple Watch saved my life: 5 people share their stories](https://www.cnet.com/news/apple-watch-lifesaving-health-features-read-5-peoples-stories/)
* [c|net - ADT technician pleads guilty to spying on customer camera feeds for years](https://www.cnet.com/news/adt-home-security-technician-pleads-guilty-to-spying-on-customer-camera-feeds-for-years/) *(trigger warning - non-consensual voyeurism)*
### الواجب
[التحقيق في مشروع إنترنت الأشياء](assignment.ar.md)
</div>

Просмотреть файл

@ -0,0 +1,20 @@
<div dir="rtl">
# التحقيق في مشروع إنترنت الأشياء
## تعليمات
هناك العديد من مشاريع إنترنت الأشياء الكبيرة والصغيرة التي يتم طرحها على مستوى العالم ، من المزارع الذكية إلى المدن الذكية ، ومراقبة الرعاية الصحية ، والنقل ، أو استخدام الأماكن العامة.
ابحث في الويب عن تفاصيل المشروع الذي يثير اهتمامك ، ومن الأفضل أن يكون مشروعًا قريبًا من المكان الذي تعيش فيه. اشرح الجوانب الإيجابية والسلبية للمشروع ، مثل الفائدة التي تأتي منه ، وأي مشاكل يسببها وكيف يتم أخذ الخصوصية في الاعتبار.
## الموضوع
| المعايير | نموذجي | كافية | يحتاج إلى تحسين |
| -------- | --------- | -------- | ----------------- |
| اشرح الإيجابيات والسلبيات | قدّم شرحاً واضحاً لأوجه الإيجابيات والسلبيات للمشروع | قدم شرحا مختصرا للجوانب الإيجابية والسلبية | لم يشرح الإيجابيات أو السلبيات |
</div>

Просмотреть файл

@ -0,0 +1,13 @@
# 调查一个物联网IoT项目
## 指示
从智慧农场到智慧城市、医疗保健监测系统、交通或利用公共空间等世界上有非常多IoT项目。
在互联网寻找一个让你感兴趣的IoT项目的细节最好是离你不太远的。解释一下项目的好处与坏处例如它带来的益处、它带来的任何麻烦以及他怎么顾及隐私。
## 评分表
| 条件 | 优秀 | 一般 | 需改进 |
| -------- | --------- | -------- | ----------------- |
| 解释项目的好处与坏处 | 把项目的好处与坏处解释得很清楚 |简要地解释项目的好处与坏处 | 没有解释项目的好处与坏处 |

Просмотреть файл

@ -95,7 +95,7 @@ Program the device.
* Check the *Random* checkbox, and enter a *Min* and *Max* value, then select the **Set** button. Every time the sensor reads a value, it will read a random number between *Min* and *Max*. * Check the *Random* checkbox, and enter a *Min* and *Max* value, then select the **Set** button. Every time the sensor reads a value, it will read a random number between *Min* and *Max*.
The values you set will be output to in the console. Change the *Value* or the *Random* settings to make the value change. The values you set will be output to the console. Change the *Value* or the *Random* settings to make the value change.
```output ```output
(.venv) ➜ GroveTest python3 app.py (.venv) ➜ GroveTest python3 app.py

Просмотреть файл

@ -198,7 +198,7 @@ Configure a Python virtual environment and install the MQTT pip packages.
source ./.venv/bin/activate source ./.venv/bin/activate
``` ```
1. Once the virtual environment has been activated, the default `python` command will run the version of Python that was used to create the virtual environment. Run the following to get this version: 1. Once the virtual environment has been activated, the default `python` command will run the version of Python that was used to create the virtual environment. Run the following to get the version:
```sh ```sh
python --version python --version

Просмотреть файл

@ -46,7 +46,7 @@ Despite the name, serverless does actually use servers. The naming is because yo
As an IoT developer, the serverless model is ideal. You can write a function that is called in response to messages sent from any IoT device that is connected to your cloud-hosted IoT service. Your code will handle all messages sent, but only be running when needed. As an IoT developer, the serverless model is ideal. You can write a function that is called in response to messages sent from any IoT device that is connected to your cloud-hosted IoT service. Your code will handle all messages sent, but only be running when needed.
✅ Look back at the code you wrote as server code listening to messages over MQTT. As is, how might this run in the cloud using serverless? How do you think the code might be changed to support serverless computing? ✅ Look back at the code you wrote as server code listening to messages over MQTT. How might this run in the cloud using serverless? How do you think the code might be changed to support serverless computing?
> 💁 The serverless model is moving to other cloud services in addition to running code. For example, serverless databases are available in the cloud using a serverless pricing model where you pay per request made against the database, such as a query or insert, usually using pricing based on how much work is done to service the request. For example a single select of one row against a primary key will cost less than a complicated operation joining many tables and returning thousands of rows. > 💁 The serverless model is moving to other cloud services in addition to running code. For example, serverless databases are available in the cloud using a serverless pricing model where you pay per request made against the database, such as a query or insert, usually using pricing based on how much work is done to service the request. For example a single select of one row against a primary key will cost less than a complicated operation joining many tables and returning thousands of rows.
@ -213,6 +213,23 @@ The Azure Functions CLI can be used to create a new Functions app.
1. Make sure the Python virtual environment is running in the VS Code terminal. Terminate it and restart it if necessary. 1. Make sure the Python virtual environment is running in the VS Code terminal. Terminate it and restart it if necessary.
1. There may be warnings in the output:
```output
(.venv) ➜ soil-moisture-trigger func start
Found Python version 3.9.1 (python3).
Azure Functions Core Tools
Core Tools Version: 3.0.3442 Commit hash: 6bfab24b2743f8421475d996402c398d2fe4a9e0 (64-bit)
Function Runtime Version: 3.0.15417.0
[2021-06-16T08:18:28.315Z] Cannot create directory for shared memory usage: /dev/shm/AzureFunctions
[2021-06-16T08:18:28.316Z] System.IO.FileSystem: Access to the path '/dev/shm/AzureFunctions' is denied. Operation not permitted.
[2021-06-16T08:18:30.361Z] No job functions found.
```
but don't worry about them as long as the Functions app starts correctly and lists the running functions. As mentioned in this question on the [Docs Q&A](https://docs.microsoft.com/answers/questions/396617/azure-functions-core-tools-error-osx-devshmazurefu.html?WT.mc_id=academic-17441-jabenn) it can be ignored.
## Create an IoT Hub event trigger ## Create an IoT Hub event trigger
The Functions app is the shell of your serverless code. To respond to IoT hub events, you can add an IoT Hub trigger to this app. This trigger needs to connect to the stream of messages that are sent to the IoT Hub and respond to them. To get this stream of messages, your trigger needs to connect to the IoT Hubs *event hub compatible endpoint*. The Functions app is the shell of your serverless code. To respond to IoT hub events, you can add an IoT Hub trigger to this app. This trigger needs to connect to the stream of messages that are sent to the IoT Hub and respond to them. To get this stream of messages, your trigger needs to connect to the IoT Hubs *event hub compatible endpoint*.
@ -370,7 +387,7 @@ To connect to the Registry Manager, you need a connection string.
Replace `<hub_name>` with the name you used for your IoT Hub. Replace `<hub_name>` with the name you used for your IoT Hub.
The connection string is requested for the *ServiceConnect* policy using the `--policy-name service` parameter. When you request a connection string, you can specify what permissions that connection string will allow. The ServiceConnect policy allows yor code to connect and send messages to IoT devices. The connection string is requested for the *ServiceConnect* policy using the `--policy-name service` parameter. When you request a connection string, you can specify what permissions that connection string will allow. The ServiceConnect policy allows your code to connect and send messages to IoT devices.
✅ Do some research: Read up on the different policies in the [IoT Hub permissions documentation](https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security#iot-hub-permissions?WT.mc_id=academic-17441-jabenn) ✅ Do some research: Read up on the different policies in the [IoT Hub permissions documentation](https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security#iot-hub-permissions?WT.mc_id=academic-17441-jabenn)

Просмотреть файл

@ -39,7 +39,7 @@ If your IoT application is not secure, there are a number of risks:
These are real world scenarios, and happen all the time. Some examples were given in earlier lessons, but here are some more: These are real world scenarios, and happen all the time. Some examples were given in earlier lessons, but here are some more:
* In 2018 hackers used an open WiFi access point on a fish tank thermostat to gain access to a casino's network to steal data. [The Hacker News - Casino Gets Hacked Through Its Internet-Connected Fish Tank Thermometer](https://thehackernews.com/2018/04/iot-hacking-thermometer.html) * In 2018, hackers used an open WiFi access point on a fish tank thermostat to gain access to a casino's network to steal data. [The Hacker News - Casino Gets Hacked Through Its Internet-Connected Fish Tank Thermometer](https://thehackernews.com/2018/04/iot-hacking-thermometer.html)
* In 2016, the Mirai Botnet launched a denial of service attack against Dyn, an Internet service provider, taking down large portions of the Internet. This botnet used malware to connect to IoT devices such as DVRs and cameras that used default usernames and passwords, and from there launched the attack. [The Guardian - DDoS attack that disrupted internet was largest of its kind in history, experts say](https://www.theguardian.com/technology/2016/oct/26/ddos-attack-dyn-mirai-botnet) * In 2016, the Mirai Botnet launched a denial of service attack against Dyn, an Internet service provider, taking down large portions of the Internet. This botnet used malware to connect to IoT devices such as DVRs and cameras that used default usernames and passwords, and from there launched the attack. [The Guardian - DDoS attack that disrupted internet was largest of its kind in history, experts say](https://www.theguardian.com/technology/2016/oct/26/ddos-attack-dyn-mirai-botnet)
* Spiral Toys had a database of users of their CloudPets connected toys publicly available over the Internet. [Troy Hunt - Data from connected CloudPets teddy bears leaked and ransomed, exposing kids' voice messages](https://www.troyhunt.com/data-from-connected-cloudpets-teddy-bears-leaked-and-ransomed-exposing-kids-voice-messages/). * Spiral Toys had a database of users of their CloudPets connected toys publicly available over the Internet. [Troy Hunt - Data from connected CloudPets teddy bears leaked and ransomed, exposing kids' voice messages](https://www.troyhunt.com/data-from-connected-cloudpets-teddy-bears-leaked-and-ransomed-exposing-kids-voice-messages/).
* Strava tagged runners that you ran past and showed their routes, allowing strangers to effectively see where you live. [Kim Komndo - Fitness app could lead a stranger right to your home — change this setting](https://www.komando.com/security-privacy/strava-fitness-app-privacy/755349/). * Strava tagged runners that you ran past and showed their routes, allowing strangers to effectively see where you live. [Kim Komndo - Fitness app could lead a stranger right to your home — change this setting](https://www.komando.com/security-privacy/strava-fitness-app-privacy/755349/).
@ -90,7 +90,7 @@ Unfortunately, not everything is secure. Some devices have no security, others a
Encryption comes in two types - symmetric and asymmetric. Encryption comes in two types - symmetric and asymmetric.
**Symmetric** encryption uses the same key to encrypt and decrypt the data. Both the sender and receive need to know the same key. This is the least secure type, as the key needs to be shared somehow. For a sender to send an encrypted message to a recipient, the sender first might have to send the recipient the key. **Symmetric** encryption uses the same key to encrypt and decrypt the data. Both the sender and receiver need to know the same key. This is the least secure type, as the key needs to be shared somehow. For a sender to send an encrypted message to a recipient, the sender first might have to send the recipient the key.
![Symmetric key encryption uses the same key to encrypt and decrypt a message](../../../images/send-message-symmetric-key.png) ![Symmetric key encryption uses the same key to encrypt and decrypt a message](../../../images/send-message-symmetric-key.png)
@ -148,7 +148,7 @@ After the connection, all data sent to the IoT Hub from the device, or to the de
### X.509 certificates ### X.509 certificates
When you are using a 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. 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.
@ -162,7 +162,7 @@ When using X.509 certificates, both the sender and the recipient will have their
![Instead of sharing a public key, you can share a certificate. The user of the certificate can verify that it comes from you by checking with the certificate authority who signed it.](../../../images/send-message-certificate.png) ![Instead of sharing a public key, you can share a certificate. The user of the certificate can verify that it comes from you by checking with the certificate authority who signed it.](../../../images/send-message-certificate.png)
***nstead of sharing a public key, you can share a certificate. The user of the certificate can verify that it comes from you by checking with the certificate authority who signed it. Certificate by alimasykurm from the [Noun Project](https://thenounproject.com)*** ***Instead of sharing a public key, you can share a certificate. The user of the certificate can verify that it comes from you by checking with the certificate authority who signed it. Certificate by alimasykurm from the [Noun Project](https://thenounproject.com)***
One big advantage of using X.509 certificates is that they can be shared between devices. You can create one certificate, upload it to IoT Hub, and use this for all your devices. Each device then just needs to know the private key to decrypt the messages it receives from IoT Hub. One big advantage of using X.509 certificates is that they can be shared between devices. You can create one certificate, upload it to IoT Hub, and use this for all your devices. Each device then just needs to know the private key to decrypt the messages it receives from IoT Hub.
@ -176,7 +176,7 @@ The certificate used by your device to encrypt messages it sends to the IoT Hub
The steps to generate an X.509 certificate are: The steps to generate an X.509 certificate are:
1. Create a public/private key pair. One of the most widely used algorithm to generate a public/private key pair is called [RSA](https://wikipedia.org/wiki/RSA_(cryptosystem)). 1. Create a public/private key pair. One of the most widely used algorithm to generate a public/private key pair is called [Rivest–Shamir–Adleman](https://wikipedia.org/wiki/RSA_(cryptosystem))(RSA).
1. Submit the public key with associated data for signing, either by a CA, or by self-signing 1. Submit the public key with associated data for signing, either by a CA, or by self-signing

Просмотреть файл

@ -48,7 +48,9 @@ The next step is to connect your device to IoT Hub using the X.509 certificates.
This will connect using the X.509 certificate instead of a connection string. This will connect using the X.509 certificate instead of a connection string.
1, RUn your code. Monitor the messages sent to IoT Hub, and send direct method requests as before. You will see the device connecting and sending soil moisture readings, as well as receiving direct method requests. 1. Delete the line with `connection_string` variable.
1. Run your code. Monitor the messages sent to IoT Hub, and send direct method requests as before. You will see the device connecting and sending soil moisture readings, as well as receiving direct method requests.
> 💁 You can find this code in the [code/pi](code/pi) or [code/virtual-device](code/virtual-device) folder. > 💁 You can find this code in the [code/pi](code/pi) or [code/virtual-device](code/virtual-device) folder.

Просмотреть файл

@ -1,7 +1,20 @@
# Retail - using IoT to manage stock levels # 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 ## 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 ## Credits
All the lessons were written with ♥️ by [Jim Bennett](https://GitHub.com/JimBobBennett)

Просмотреть файл

@ -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)

Просмотреть файл

@ -0,0 +1,9 @@
#
## Instructions
## Rubric
| Criteria | Exemplary | Adequate | Needs Improvement |
| -------- | --------- | -------- | ----------------- |
| | | | |

Просмотреть файл

@ -0,0 +1,9 @@
# Dummy File
This file acts as a placeholder for the `translations` folder. <br>
**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!

Просмотреть файл

@ -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)

Просмотреть файл

@ -0,0 +1,9 @@
#
## Instructions
## Rubric
| Criteria | Exemplary | Adequate | Needs Improvement |
| -------- | --------- | -------- | ----------------- |
| | | | |

Просмотреть файл

@ -0,0 +1,9 @@
# Dummy File
This file acts as a placeholder for the `translations` folder. <br>
**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!

Просмотреть файл

@ -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
[Pre-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/33) [Pre-lecture quiz](https://brave-island-0b7c7f50f.azurestaticapps.net/quiz/41)
## Introduction ## Introduction
@ -212,7 +212,7 @@ What do you think the future holds for speech recognition?
## Post-lecture quiz ## 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 ## Review & Self Study

Просмотреть файл

@ -6,7 +6,7 @@ Add a sketchnote if possible/appropriate
## Pre-lecture quiz ## 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 ## 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 1 second timer`
* `set a 4 minute timer` * `set a 4 minute timer`
* `set a four minute six second timer`
* `set a 9 minute 30 second timer` * `set a 9 minute 30 second timer`
* `set a timer for 1 minute and 12 seconds` * `set a timer for 1 minute and 12 seconds`
* `set a timer for 3 minutes` * `set a timer for 3 minutes`
* `set a timer for 3 minutes and 1 second` * `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 30 seconds`
* `set a timer for 1 second` * `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. 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) ![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
[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 ## Review & Self Study

Просмотреть файл

@ -6,17 +6,73 @@ Add a sketchnote if possible/appropriate
## Pre-lecture quiz ## 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 ## 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: 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)
## Thing 1 ## 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:
* [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
[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 ## Review & Self Study

Просмотреть файл

@ -6,7 +6,7 @@ Add a sketchnote if possible/appropriate
## Pre-lecture quiz ## 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 ## Introduction
@ -24,7 +24,7 @@ In this lesson we'll cover:
## Post-lecture quiz ## 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 ## Review & Self Study

Просмотреть файл

@ -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) | | 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) | | 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) | | 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) | | | | 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) | | | | 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) | | 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) | | 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) | | 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) |

Разница между файлами не показана из-за своего большого размера Загрузить разницу