Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions assignments/05-walkie-talkie-discover/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@ Although we will use a lot of code, you are not required to understand every lit
{: .warning }
As a prerequisite for this tutorial to work, make sure you followed and successfully completed [Tutorial 4 of the Connected Interaction Kit website](https://id-studiolab.github.io/Connected-Interaction-Kit/tutorials/03-connect-to-the-internet/) and connected your PicoExpander to the internet.

After connecting to the internet the next step is to [download the MQTT library](MQTT.zip) and move it to the ```/lib``` folder on your **CIRCUITPY drive**.

After connecting to the internet, download the MQTT library: [MQTT.zip](MQTT.zip).
Once downloaded, extract its contents to a folder.
Open the extracted MQTT folder and copy the file named ```MQTT.py``` to your the ```/lib``` folder in your **CIRCUITPY drive**.
Make sure the ```MQTT.py``` file is successfully placed in the ```/lib``` folder before proceeding to the next step.

Next we are going to update the ```settings.toml``` file in order to connect to the MQTT server.
Open de ```settings.toml``` file in a **text-editor** (unfortunately mu-editor cannot open it).
Open the ```settings.toml``` file in a **text-editor** (Not word, use kladblok or similar. Unfortunately mu-editor cannot open it).

```toml
CIRCUITPY_WIFI_SSID = "TUD-facility" # name of your wifi
Expand All @@ -45,7 +50,6 @@ Extend your settings.toml file with the entries for the MQTT server and fill in
When connected to an MQTT broker, a device can **subscribe** to a topic to receive data, and **publish** to a topic to send data.
Publishing sends a message to the broker, which then forwards it to all devices that are subscribed to that topic.

You can verify whether you're connected to the MQTT broker and see the messages sent through this website: [Shiftr.io](https://ide-education.cloud.shiftr.io/)

---

Expand Down Expand Up @@ -191,6 +195,8 @@ while True:
| ![](walkie_talkie_state_diagram.png) |


After running the code, you can verify whether you're connected to the MQTT broker and see the messages sent through this website: [Shiftr.io](https://ide-education.cloud.shiftr.io/)

## Understanding Speak and Listen Topics

In the code, you'll find two variables called `mqtt_speak_topic` and `mqtt_listen_topic`. You can use them to establish communication between walkie-talkies.
Expand Down
Loading