Skip to content

Latest commit

 

History

History
281 lines (189 loc) · 8.76 KB

README.md

File metadata and controls

281 lines (189 loc) · 8.76 KB

WORKSHOP_MQTT_ESP32

Summary

Story

The schema below shows the architecture of broker MQTT:

Data scheme

Explanation
Each device can publish on a broker local or global.
The Broker is an intermediary between devices and subscribers.
It allows to store, process and share the data to other entities.
Whether it is another broker or his phone to be aware of an alert according to the data.

Setup:

Step 01 - Turn on an LED

🛠️ Required Hardware:
  • ESP32
  • USB cable

📑 Description:

Your first objective is to light an LED on your ESP32 with code.

📌 Tasks:

Use the LED on your card or an external LED and turn it on.

📚 Documentation:

Step 02 - LED flash

🛠️ Required Hardware:
  • ESP32
  • USB cable

📑 Description:

Now it's time to make your LED blink.
To do this, implement some code in your ESP32.

📌 Tasks:

Your LED must blink with 500 ms.

📚 Documentation:

Step 03 - Connect to WI-FI

🛠️ Required Hardware:
  • ESP32
  • USB cable

📑 Description:

For this step, you will set ssid and password for connect your board to the WI-Fi.
Integred conditional state for print Wi-fi and Ip Address of your device.

  • To print data you must use serial connection.
  • The first purpose of the MQTT IOT is a Wi-Fi.

📌 Tasks:

  • Print the ip of your board in serial monitor

📚 Documentation:

✔️ Validation:

  • Ping your device.
    If this step is ending you can go out to the next step. 🎉

Step 04 - SetUp Mosquitto

🛠️ Required Hardware:
  • Your Computer

📑 Description:

Now that you have an network to your esp32.
This is the first step.
Then you must understand and work MQTT IoT.

📌 Tasks:

  • Call a manager to explain how a broker works. 👋

📚 Documentation:

Step 05 - SetUp your first Subscribe to Mosquitto

🛠️ Required Hardware:
  • Your computer

📑 Description:

Now it's time to know how subscribes to a topic.

📌 Tasks:

This information is necessary to communicate with the Broker 🚀

Topic : /Workshop/Hardware/MQTT
Username : MosquiFruit
Password : SendMeYourEmail

  • First step : Subscribe to all topics
  • Second step : Subscribe to specific topic /Workshop/Hardware/MQTT

😊 Subscribe to the topic

📚 Documentation:

✔️ Validation:

If your received message, you can jump to the task 06 🎉

Step 06 - Publish with Mosquitto

🛠️ Required Hardware:
  • Your Computer

📌 Tasks:

You will now publish your epitech 📧 to the topic /Workshop/Hardware/.
You can find all information in the step 05 to send me your email.
If the messages appear in my log you have successfully completed this step!

Let's continue to the next step! 👏

📚 Documentation:

Step 07 - Set MQTT with your esp32

🛠️ Required Hardware:
  • ESP32
  • USB cable

📑 Description:

We will set up network on your esp32 and understand how use MQTT.
Now you must publish and subscribe to topic with your esp32.

📌 Tasks:

  • Create client
  • Subscribe to /Workshop/Hardware/Step07/
  • Publish the date time.

👉 Don't forget information for the communication with the broker local.

Surprise The Broker respond to you 😎

You can pass to the last step of this Workshop !

📚 Documentation:

Step 08 - Create your Broker

🛠️ Required Hardware:
  • Raspberry Pi
  • USB cable

📑 Description:

Come and see a supervisor and ask for a raspberry pi 🏄

The raspberry is almost configured.

📌 Tasks:

Your job if you accept it is :

  • to change the mosquitto configuration to subscribe to /Workshop/Hardware/Success.
  • Redirect the messages to the main broker.

😊 After change config, don't forget to restart service.

📚 Documentation:

🎉 Congratulation!

You now know the basics of MQTT ESP32. Feel free to use your imagination to implement IoT Communication. Or combine the previous exercises for new results.

Authors


Albert VALENTIN

Organization


LinkedIn logo Instagram logo Twitter logo Discord logo

Website logo

🚀 Don't hesitate to follow us on our different networks, and put a star 🌟 on PoC's repositories.