Skip to content

Week 11


Assignment - Networking and Communications

  • Group assignment:

    • Send a message between two projects
    • Document your work to the group work page and reflect on your individual page what you learned
  • Individual assignment:

    • Design, build and connect wired or wireless node(s) with network or bus addresses and a local input and/or output device(s)

From Assignment Details


Hero Image

Group Assignment

First version was a slightly modified Arduino example, thats writes to the Serial Monitor.

I installed the ArduinoMQTTClient library in the Arduino IDE, and then opened the example from the File>Examples menu.

I updated the file called secrets.h, using the credentials Julian shared, so I could use the shared Fab Academy MQTT Broker.

#define SECRET_SSID ""
#define SECRET_PASS ""
#define SECRET_BROKER "mqtt.fabcloud.org"
#define SECRET_PORT 1883
#define SECRET_TOPIC "fabacademy/etc"
#define SECRET_USER "fabacademy"
#define SECRET_PSK "fabacademy"

And I combined with the Xiao ESP32 unit with the OLED screen that I made in week 8. It listens to MQTT on the topic: fabacademy/creative-spark. And I had it write messages to the screen.

After first attempt, I thought my issue was my University’s Network.

Not Connecting

Tried my phone’s hotspot, it worked. I went back to the University Network… which then worked too.

Connecting

So, then I tried publishing a message with mosquitto_pub from the terminal on my computer.

Message From Terminal

“Hello Ger” :)

Message Coming Through

Reflection

Some old sources on MQTT:

I’ve used MQTT in home automation projects. I never really got the chance to get in deeper into QoS, retained messages, topic structure, wildcards, but it was really interestign to read. I have used MQTT nodes in Node-RED which expose these features.

There is password authentication, though it can be used on a local network or behind a VPN. Which feels secure for most cases.

A sophisticated protocol that does basic message brokering well, and has advanced features that are there for more complicated uses.

Files