From 13968829c5f40d5f4fae5720c81b9e4bd9c7848e Mon Sep 17 00:00:00 2001 From: "Sterling G. Baird" Date: Tue, 1 Oct 2024 12:09:14 -0400 Subject: [PATCH] Update 1.4-hardware-software-communication.md with workaround links https://github.com/peterhinch/micropython-mqtt/issues/155 --- .../hello-world/1.4-hardware-software-communication.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/courses/hello-world/1.4-hardware-software-communication.md b/docs/courses/hello-world/1.4-hardware-software-communication.md index 0f94c36..f0647c0 100644 --- a/docs/courses/hello-world/1.4-hardware-software-communication.md +++ b/docs/courses/hello-world/1.4-hardware-software-communication.md @@ -26,7 +26,7 @@ In this tutorial, you will learn how to send commands to and receive sensor data In an earlier module (blink and read), you learned how to blink the onboard LED every two seconds. In this section, you will control the onboard LED using MQTT, a standard protocol for internet-of-things communication. By definition, hardware/software communication implies that you are interfacing multiple devices (in this case, your microcontroller and a Jupyter notebook running on e.g., Google Colab). Let's start with a hands-on example. -✅ Create a new file on your Pico W microcontroller called `mqtt_led.py` and copy the script below (based on [JayPalm's gist](https://gist.github.com/JayPalm/8bfd836b696c28ec5dc1f6b5b4dd18ea) and [`mqtt_as` README](https://github.com/peterhinch/micropython-mqtt/blob/master/mqtt_as/README.md)). Ensure that your microcontroller has been set up according to the instructions in the "Running the demo" module earlier in the course (only [`netman.py`](https://github.com/sparks-baird/self-driving-lab-demo/blob/main/src/public_mqtt_sdl_demo/lib/netman.py) [[permalink](https://github.com/sparks-baird/self-driving-lab-demo/blob/0ff0adec3e997c096990de594844d73a9ce18fd6/src/public_mqtt_sdl_demo/lib/netman.py)] and an appropriately filled-out `my_secrets.py` are required). You will also need to upload the [`mqtt_as.py` module](https://github.com/peterhinch/micropython-mqtt/blob/master/mqtt_as/mqtt_as.py) to either the main directory or the `lib` folder. Make sure to replace `` with your course ID (without the brackets). If you've forgotten your GitHub Classroom course ID, you can refer back to your quiz responses from the GitHub starter tutorial assignment. Once you've updated the file, save the file and click play. +✅ Create a new file on your Pico W microcontroller called `mqtt_led.py` and copy the script below (based on [JayPalm's gist](https://gist.github.com/JayPalm/8bfd836b696c28ec5dc1f6b5b4dd18ea) and [`mqtt_as` README](https://github.com/peterhinch/micropython-mqtt/blob/master/README.md)). Ensure that your microcontroller has been set up according to the instructions in the "Running the demo" module earlier in the course (only [`netman.py`](https://github.com/sparks-baird/self-driving-lab-demo/blob/main/src/public_mqtt_sdl_demo/lib/netman.py) [[permalink](https://github.com/sparks-baird/self-driving-lab-demo/blob/0ff0adec3e997c096990de594844d73a9ce18fd6/src/public_mqtt_sdl_demo/lib/netman.py)] and an appropriately filled-out `my_secrets.py` are required). You will also need to upload the [`mqtt_as.py` module](https://github.com/sparks-baird/self-driving-lab-demo/blob/045b276480d64bdd24287f427491041c33535ef2/src/public_mqtt_sdl_demo/lib/mqtt_as.py) to either the main directory or the `lib` folder. Make sure to replace `` with your course ID (without the brackets). If you've forgotten your GitHub Classroom course ID, you can refer back to your quiz responses from the GitHub starter tutorial assignment. Once you've updated the file, save the file and click play. `my_secrets.py` ```python @@ -212,7 +212,7 @@ For a hobbyist project, these might not be large concerns; however, when impleme -✅ Review the [micropython-mqtt repository README](https://github.com/peterhinch/micropython-mqtt) and its [Asynchronous MQTT docs](https://github.com/peterhinch/micropython-mqtt/blob/master/mqtt_as/README.md) +✅ Review the [micropython-mqtt repository README](https://github.com/peterhinch/micropython-mqtt) and its [Asynchronous MQTT docs](https://github.com/peterhinch/micropython-mqtt/blob/master/README.md) ✅ Read [Receiving Messages with the Paho MQTT Python Client](http://www.steves-internet-guide.com/receiving-messages-mqtt-python-client/), paying special attention to the "Use the Queue object" section. Then read the Basic first-in first-out (FIFO) Queue section from [this page](https://pymotw.com/2/Queue/#basic-fifo-queue)