diff --git a/1-getting-started/lessons/1-introduction-to-iot/README.md b/1-getting-started/lessons/1-introduction-to-iot/README.md index 6be0701f..d601b69f 100644 --- a/1-getting-started/lessons/1-introduction-to-iot/README.md +++ b/1-getting-started/lessons/1-introduction-to-iot/README.md @@ -28,7 +28,7 @@ The term 'Internet of Things' was coined by [Kevin Ashton](https://wikipedia.org > > **Actuators** convert electrical signals into real-world interactions such as triggering a switch, turning on lights, making sounds, or sending control signals to other hardware, for example to turn on a power socket. -IoT as a technology area is more than just devices - it includes cloud based services that can process the sensor data, or send requests to actuators connected to IoT devices. It also includes devices that don't have connectivity, often referred to as edge devices, that can process and respond to sensor data themselves, usually using AI models trained in the cloud. +IoT as a technology area is more than just devices - it includes cloud based services that can process the sensor data, or send requests to actuators connected to IoT devices. It also includes devices that don't have or don't need Internet connectivity, often referred to as edge devices. These are devices that can process and respond to sensor data themselves, usually using AI models trained in the cloud. IoT is a fast growing technology field. It is estimated that by the end of 2020, 30 billion IoT devices were deployed and connected to the Internet. Looking to the future, it is estimated that by 2025, IoT devices will be gathering almost 80 zettabytes of data, or 80 trillion gigabytes. That's a lot of data! @@ -86,7 +86,7 @@ Like a microcontroller, single-board computers have a CPU, memory and input/outp > 🎓 You can think of a single-board computer as a smaller, cheaper version of the PC or Mac you are reading this on, with the addition of GPIO (general-purpose input/output) pins to interact with sensors and actuators. -SIngle-board computers are fully-featured computers, so can be programmed in any language. IoT devices are typically programmed in Python. +Single-board computers are fully-featured computers, so can be programmed in any language. IoT devices are typically programmed in Python. ### Hardware choices for the rest of the lessons diff --git a/1-getting-started/lessons/1-introduction-to-iot/virtual-device.md b/1-getting-started/lessons/1-introduction-to-iot/virtual-device.md index dc49f29e..bc37888d 100644 --- a/1-getting-started/lessons/1-introduction-to-iot/virtual-device.md +++ b/1-getting-started/lessons/1-introduction-to-iot/virtual-device.md @@ -119,6 +119,7 @@ Create a Python application to print `"Hello World"` to the console. ```sh code . ``` + > 💁 If your terminal returns `command not found` on macOS it means VS Code has not been added to PATH, you can [add VS Code to PATH](https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line) and run the command afterwards. VS Code is installed to PATH by default on Windows and Linux. 1. When VS Code launches, it will activate the Python virtual environment. You will see this in the bottom status bar: diff --git a/1-getting-started/lessons/3-sensors-and-actuators/README.md b/1-getting-started/lessons/3-sensors-and-actuators/README.md index 55887a23..436d5ebd 100644 --- a/1-getting-started/lessons/3-sensors-and-actuators/README.md +++ b/1-getting-started/lessons/3-sensors-and-actuators/README.md @@ -112,7 +112,7 @@ Actuators are the opposite of sensors - they convert an electrical signal from y Some common actuators include: * LED - these emit light when turned on -* Speaker - these emil sound based on the signal sent to them, from a basic buzzer to an audio speaker that can play music +* Speaker - these emit sound based on the signal sent to them, from a basic buzzer to an audio speaker that can play music * Stepper motor - these convert a signal into a defined amount of rotation, such as turning a dial 90° * Relay - these are switches that can be turned on or off by an electrical signal. They allow a small voltage from an IoT device to turn on larger voltages. * Screens - these are more complex actuators and show information on a multi-segment display. Screens vary from simple LED displays to high-resolution video monitors. diff --git a/1-getting-started/lessons/3-sensors-and-actuators/wio-terminal-actuator.md b/1-getting-started/lessons/3-sensors-and-actuators/wio-terminal-actuator.md index e99b8aab..d4dfd1db 100644 --- a/1-getting-started/lessons/3-sensors-and-actuators/wio-terminal-actuator.md +++ b/1-getting-started/lessons/3-sensors-and-actuators/wio-terminal-actuator.md @@ -34,7 +34,7 @@ Connect the LED. One of the legs of the LED is the positive pin, the other is the negative pin. The LED is not perfectly round, and is slightly flatter on one side. The side that is slightly flatter is the negative pin. When you connect the LED to the module, make sure the pin by the rounded side is connected to the socket marked **+** on the outside of the module, and the flatter side is connected to the socket closer to the middle of the module. -1. The LED module has a spin button that allows you to control the brightness. Turn this all the way up to start with byt rotating it anti-clockwise as far as it will go using a small Phillips head screwdriver. +1. The LED module has a spin button that allows you to control the brightness. Turn this all the way up to start with by rotating it anti-clockwise as far as it will go using a small Phillips head screwdriver. 1. Insert one end of a Grove cable into the socket on the LED module. It will only go in one way round. diff --git a/1-getting-started/lessons/4-connect-internet/README.md b/1-getting-started/lessons/4-connect-internet/README.md index e5e61322..80d9e811 100644 --- a/1-getting-started/lessons/4-connect-internet/README.md +++ b/1-getting-started/lessons/4-connect-internet/README.md @@ -86,7 +86,7 @@ Messages can be sent with a quality of service (QoS), which determines the guara ✅ What situations might require an assured delivery message over a fire and forget message? -Although the name is Message Queueing, it doesn't actually support message queues. This means that if a client is disconnected, then reconnects it won't receive messages sent during the disconnect except for those messages that it had already started to process using the QoS process. Messages can have a retained flag set on them. If this is set, the MQTT broker will store the last message sent on a topic with this flag, and send this to any clients who later subscribe to the topic. This way the clients will always get the latest message. +Although the name is Message Queueing, it doesn't actually support message queues. This means that if a client disconnects, then reconnects it won't receive messages sent during the disconnection except for those messages that it had already started to process using the QoS process. Messages can have a retained flag set on them. If this is set, the MQTT broker will store the last message sent on a topic with this flag, and send this to any clients who later subscribe to the topic. This way the clients will always get the latest message. MQTT also supports a keep alive function that checks to see if the connection is still alive during long gaps between messages. @@ -102,19 +102,19 @@ The word telemetry is derived from Greek roots meaning to measure remotely. Tele > 💁 One of the earliest telemetry devices was invented in France in 1874 and sent real-time weather and snow depths from Mont Blanc to Paris. It used physical wires as wireless technologies were not available at the time. -Lets look back at the example of the smart thermostat from Lesson 1. +Let's look back at the example of the smart thermostat from Lesson 1. ![An Internet connected thermostat using multiple room sensors](../../../images/telemetry.png) ***An Internet connected thermostat using multiple room sensors. Temperature by Vectors Market / Microcontroller by Template / dial by Jamie Dickinson / heater by Pascal Heß / mobile phone and Calendar by Alice-vector / Cloud by Debi Alpa Nugraha / smart sensor by Andrei Yushchenko / weather by Adrien Coquet - all from the [Noun Project](https://thenounproject.com)*** -The thermostat has temperature sensors to gather telemetry. It would most likely have one temperature sensor built in, and it might connect to multiple external temperature sensors over a wireless protocol such as BLE. +The thermostat has temperature sensors to gather telemetry. It would most likely have one temperature sensor built in, and it might connect to multiple external temperature sensors over a wireless protocol such as [Bluetooth Low Energy](https://wikipedia.org/wiki/Bluetooth_Low_Energy) (BLE). An example of the telemetry data it would send could be: | Name | Value | Description | | ---- | ----- | ----------- | -| `thermostat_temperature` | 18°C | The temperature measured by the thermostat's built in temperature sensor | +| `thermostat_temperature` | 18°C | The temperature measured by the thermostat's built-in temperature sensor | | `livingroom_temperature` | 19°C | The temperature measured by a remote temperature sensor that has been named `livingroom` to identify the room it is in | | `bedroom_temperature` | 21°C | The temperature measured by a remote temperature sensor that has been named `bedroom` to identify the room it is in | @@ -139,7 +139,7 @@ Follow the relevant step below to send telemetry from your device to the MQTT br ### Receive telemetry from the MQTT broker -There's no point in sending telemetry if there's nothing on the other end to listen for it. The light level telemetry needs something listening to it to process the data. This 'server' code is the kind of code you wold deploy to a cloud service as part of a larger IoT application, but here you are going to run this code locally on your computer (on on you Pi if you are coding directly on there). The server code consists of a Python app that listens to telemetry messages over MQTT with light levels. Later in this less you will make it reply with a command message with instructions to turn the LED on or off. +There's no point in sending telemetry if there's nothing on the other end to listen for it. The light level telemetry needs something listening to it to process the data. This 'server' code is the kind of code you will deploy to a cloud service as part of a larger IoT application, but here you are going to run this code locally on your computer (or on your Pi if you are coding directly on there). The server code consists of a Python app that listens to telemetry messages over MQTT with light levels. Later in this lesson you will make it reply with a command message with instructions to turn the LED on or off. ✅ Do some research: What happens to MQTT messages if there is no listener? @@ -318,6 +318,8 @@ Write the server code. Message received: {'light': 0} Message received: {'light': 400} ``` + + The app.py file in the nightlight virtual environment has to be running for the app.py file in the nightlight-server virtual environment to recieve the messages being sent. > 💁 You can find this code in the [code-server/server](code-server/server) folder. @@ -357,7 +359,7 @@ A thermostat could receive a command from the cloud to turn the heating on. Base ### Send commands to the MQTT broker -The next step for our Internet controlled nightlight is for the server code to send a command back to the IoT device to control the light based off the light levels it senses. +The next step for our Internet controlled nightlight is for the server code to send a command back to the IoT device to control the light based on the light levels it senses. 1. Open the server code in VS Code @@ -392,9 +394,11 @@ The next step for our Internet controlled nightlight is for the server code to s > 💁 The telemetry and commands are being sent on a single topic each. This means telemetry from multiple devices will appear on the same telemetry topic, and commands to multiple devices will appear on the same commands topic. If you wanted to send a command to a specific device, you could use multiple topics, named with a unique device id, such as `/commands/device1`, `/commands/device2`. That way a device can listen on messages just meant for that one device. +> 💁 You can find this code in the [code-commands/server](code-commands/server) folder. + ### Handle commands on the IoT device -Now that commands are being sent from the server, you cna now add code to the IoT device to handle them and control the LED. +Now that commands are being sent from the server, you can now add code to the IoT device to handle them and control the LED. Follow the relevant step below to listen to commands from the MQTT broker: diff --git a/1-getting-started/lessons/4-connect-internet/code-commands/server/app.py b/1-getting-started/lessons/4-connect-internet/code-commands/server/app.py index e6b46379..01b6a0f2 100644 --- a/1-getting-started/lessons/4-connect-internet/code-commands/server/app.py +++ b/1-getting-started/lessons/4-connect-internet/code-commands/server/app.py @@ -6,7 +6,8 @@ import paho.mqtt.client as mqtt id = '' client_telemetry_topic = id + '/telemetry' -client_name = id + '_nightlight_server' +server_command_topic = id + '/commands' +client_name = id + 'nightlight_server' mqtt_client = mqtt.Client(client_name) mqtt_client.connect('test.mosquitto.org') @@ -17,6 +18,11 @@ def handle_telemetry(client, userdata, message): payload = json.loads(message.payload.decode()) print("Message received:", payload) + command = { 'led_on' : payload['light'] < 200 } + print("Sending message:", command) + + client.publish(server_command_topic, json.dumps(command)) + mqtt_client.subscribe(client_telemetry_topic) mqtt_client.on_message = handle_telemetry diff --git a/1-getting-started/lessons/4-connect-internet/code-commands/virtual-device/nightlight/app.py b/1-getting-started/lessons/4-connect-internet/code-commands/virtual-device/nightlight/app.py index 4857aa61..5e9a46fc 100644 --- a/1-getting-started/lessons/4-connect-internet/code-commands/virtual-device/nightlight/app.py +++ b/1-getting-started/lessons/4-connect-internet/code-commands/virtual-device/nightlight/app.py @@ -38,3 +38,4 @@ while True: print('Light level:', light) mqtt_client.publish(client_telemetry_topic, json.dumps({'light' : light})) + time.sleep(5) diff --git a/1-getting-started/lessons/4-connect-internet/code-server/server/app.py b/1-getting-started/lessons/4-connect-internet/code-server/server/app.py index 01b6a0f2..e6b46379 100644 --- a/1-getting-started/lessons/4-connect-internet/code-server/server/app.py +++ b/1-getting-started/lessons/4-connect-internet/code-server/server/app.py @@ -6,8 +6,7 @@ import paho.mqtt.client as mqtt id = '' client_telemetry_topic = id + '/telemetry' -server_command_topic = id + '/commands' -client_name = id + 'nightlight_server' +client_name = id + '_nightlight_server' mqtt_client = mqtt.Client(client_name) mqtt_client.connect('test.mosquitto.org') @@ -18,11 +17,6 @@ def handle_telemetry(client, userdata, message): payload = json.loads(message.payload.decode()) print("Message received:", payload) - command = { 'led_on' : payload['light'] < 200 } - print("Sending message:", command) - - client.publish(server_command_topic, json.dumps(command)) - mqtt_client.subscribe(client_telemetry_topic) mqtt_client.on_message = handle_telemetry diff --git a/1-getting-started/lessons/4-connect-internet/single-board-computer-mqtt.md b/1-getting-started/lessons/4-connect-internet/single-board-computer-mqtt.md index f153a39b..a1f11d11 100644 --- a/1-getting-started/lessons/4-connect-internet/single-board-computer-mqtt.md +++ b/1-getting-started/lessons/4-connect-internet/single-board-computer-mqtt.md @@ -74,6 +74,6 @@ Write the device code. Light level: 0 ``` -> 💁 You can find this code in the [code-mqtt/virtual-device](code/virtual-device) folder or the [code-mqtt/pi](code/pi) folder. +> 💁 You can find this code in the [code-mqtt/virtual-device](code-mqtt/virtual-device) folder or the [code-mqtt/pi](code-mqtt/pi) folder. 😀 You have successfully connected your device to an MQTT broker. diff --git a/3-transport/lessons/1-location-tracking/README.md b/3-transport/lessons/1-location-tracking/README.md index 05ebab64..2bb82fb8 100644 --- a/3-transport/lessons/1-location-tracking/README.md +++ b/3-transport/lessons/1-location-tracking/README.md @@ -10,7 +10,7 @@ Add a sketchnote if possible/appropriate ## Introduction -The main process for getting food from a farmer to a consumer involves loading boxes of produce on to trucks, ships, airplanes or other commercial transport vehicles, and delivering the food somewhere - either direct to a customer, or to a central hub or warehouse for processing. The whole end-to-end process from farm to consumer is part of a process called the *supply chain*. The video below from Arizona State University's W. P. Carey School of Business talks about the idea of the supply chain and how it is managed in more detail. +The main process for getting food from a farmer to a consumer involves loading boxes of produce on to trucks, ships, airplanes, or other commercial transport vehicles, and delivering the food somewhere - either direct to a customer, or to a central hub or warehouse for processing. The whole end-to-end process from farm to consumer is part of a process called the *supply chain*. The video below from Arizona State University's W. P. Carey School of Business talks about the idea of the supply chain and how it is managed in more detail. [![What is Supply Chain Management? A video from Arizona State University's W. P. Carey School of Business](https://img.youtube.com/vi/Mi1QBxVjZAw/0.jpg)](https://www.youtube.com/watch?v=Mi1QBxVjZAw) @@ -45,7 +45,7 @@ IoT is transforming the way goods are transported by creating fleets of *connect * Driver hours compliance - ensuring drivers only drive for their legally allowed hours based on the times they turn the engine on and off. -These benefits can be combined - for example, combining driver hours compliance with location tracking to re-route drivers if they cannot reach their destination within their allowed driving hours. These can also be combined with other vehicle-specific telemetry, such as temperature data from temperature controlled trucks, allow vehicles to be re-routed if their current route would mean goods cannot be kept at temperature. +These benefits can be combined - for example, combining driver hours compliance with location tracking to re-route drivers if they cannot reach their destination within their allowed driving hours. These can also be combined with other vehicle-specific telemetry, such as temperature data from temperature-controlled trucks, allow vehicles to be re-routed if their current route would mean goods cannot be kept at temperature. > 🎓 Logistics is the process of transporting goods from one place to another, such as from a farm to a supermarket via one or more warehouses. A farmer packs boxes of tomatoes that are loaded onto a truck, delivered to a central warehouse, and put onto a second truck that may contain a mixture of different types of produce which are then delivered to a supermarket. @@ -81,7 +81,7 @@ To measure the longitude of a point, you measure the number of degrees round the Traditionally, measurements of degrees of latitude and longitude were done using sexagesimal numbering, or base-60, a numbering system used by the Ancient Babylonians who did the first measurements and recordings of time and distance. You use sexagesimal every day probably without even realising it - dividing hours into 60 minutes and minutes into 60 seconds. -Longitude and latitude is measured in degrees, minutes and seconds, with one minute being 1/60 of a degree, and 1 second being 1/60 minute. +Longitude and latitude are measured in degrees, minutes and seconds, with one minute being 1/60 of a degree, and 1 second being 1/60 minute. For example, at the equator: @@ -89,11 +89,11 @@ For example, at the equator: * 1 minute of latitude is 111.3/60 = **1.855 kilometers** * 1 second of latitude is 1.855/60 = **0.031 kilometers** -The symbol for a minute is a single quote, for a second it is a double quote. 2 degrees, 17 minutes and 43 seconds for example, would be written as 2°17'43". Parts of seconds are given as decimals, for example half a second is 0°0'0.5". +The symbol for a minute is a single quote, for a second it is a double quote. 2 degrees, 17 minutes, and 43 seconds for example, would be written as 2°17'43". Parts of seconds are given as decimals, for example half a second is 0°0'0.5". Computers don't work in base-60, so these coordinates are given as decimal degrees when using GPS data in most computer systems. For example, 2°17'43" is 2.295277. The degree symbol is usually omitted. -Coordinates for a point are always given as `latitude,longitude`, so the example earlier of the Microsoft Campus at 47.6423109,-122.117198 has: +Coordinates for a point are always given as `latitude, longitude`, so the example earlier of the Microsoft Campus at 47.6423109,-122.117198 has: * A latitude of 47.6423109 (47.6423109 degrees north of the equator) * A longitude of -122.1390293 (122.1390293 degrees west of the Prime Meridian). @@ -152,7 +152,7 @@ GPS sensors output data using NMEA messages, using the NMEA 0183 standard. NMEA These messages are text-based. Each message consists of a *sentence* that starts with a `$` character, followed by 2 characters to indicate the source of the message (e.g GP for the US GPS system, GN for GLONASS, the Russian GPS system), and 3 characters to indicate the type of message. The rest of the message is fields separated by commas, ending in a new line character. -Some of the types of message that can be received are: +Some of the types of messages that can be received are: | Type | Description | | ---- | ----------- | @@ -164,7 +164,7 @@ Some of the types of message that can be received are: The GGA message includes the current location using the `(dd)dmm.mmmm` format, along with a single character to indicate direction. The `d` in the format is degrees, the `m` is minutes, with seconds as decimals of minutes. For example, 2°17'43" would be 217.716666667 - 2 degrees, 17.716666667 minutes. -The direction character can be `N` or `S` for latitude to indicate north or south, and `E` or `W` for longitude to indicate east or west. For example, a latitude of 2°17'43" would have a direction character of `N`, -2°17'43" would have a direction character of `S`. +The direction character can be `N` or `S` for latitude to indicate north or south, and `E` or `W` for longitude to indicate east or west. For example, a latitude of 2°17'43" would have a direction character of `N`, -2°17'43" would have a direction character of `S`. For example - the NMEA sentence `$GNGGA,020604.001,4738.538654,N,12208.341758,W,1,3,,164.7,M,-17.1,M,,*67` diff --git a/lesson-template/translations/README.es.md b/lesson-template/translations/README.es.md new file mode 100644 index 00000000..d322e9fd --- /dev/null +++ b/lesson-template/translations/README.es.md @@ -0,0 +1,51 @@ +# [Tema de la lección] + +![Embeba un video aquí](video-url) + +## [Quiz pre-sesión](quiz-url) + +[Describa qué aprenderemos] + +### Introducción + +Describa qué cubriremos + +> Notas + +### Prerrequisitos + +¿Qué temas deberían haberse cubierto antes de esta lección? + +### Preparación + +Pasos preliminares para empezar esta lección + +--- + +[Organice su contenido en bloques] + +## [Tema 1] + +### Tarea: + +Trabaje en equipo para perfeccionar progresivamente su base de código para construir el proyecto con código compartido: + +```html +bloques de código +``` + +✅ Prueba de conocimiento - use este momento para desafiar el conocimiento de sus estudiantes con preguntas abiertas + +## [Tema 2] + +## [Tema 3] + +🚀 Reto: Proponga un reto para que los estudiantes trabajen colaborativamente en clase para perfeccionar el proyecto + +Opcional: Si se requiere, agregue una captura de pantalla del UI de la lección completa + +## [Quiz post-sesión](quiz-url) + +## Revisión & Aprendizaje autónomo + +**FECHA DE ENTREGA [MM/AA]**: [Nombre de la tarea](tarea.md) diff --git a/lesson-template/translations/assignment.es.md b/lesson-template/translations/assignment.es.md new file mode 100644 index 00000000..5d25b122 --- /dev/null +++ b/lesson-template/translations/assignment.es.md @@ -0,0 +1,9 @@ +# [Nombre de la tarea] + +## Instrucciones + +## Rúbrica + +| Criterios| Excelente | Adecuado | Puede mejorar | +| -------- | --------- | -------- | ----------------- | +| | | | |