How to Install Mosquitto MQTT Broker on Raspberry Pi & Connect ESP32

Опубликовано: 18 Май 2026
на канале: IoT Bhai
1,375
26

In this video, I show you how to turn your Raspberry Pi into a local IoT server using the Mosquitto MQTT Broker. We will go step-by-step from installation to controlling an ESP32 over your local network without relying on any cloud services.

*💡 What you will learn:*
Setting up a local MQTT Broker on Raspberry Pi
Understanding Publisher vs Subscriber concepts
Sending data between ESP32 and Raspberry Pi
Controlling hardware over Wi-Fi without the Cloud

Required Hardware:
Raspberry Pi (3, 4, or 5):
Amazon: https://amzn.to/44LW6C6
AliExpress: https://s.click.aliexpress.com/e/_c3J...
ESP32 Development Board:
Amazon: https://amzn.to/49iLJqR
AliExpress: https://s.click.aliexpress.com/e/_c2I...
LED: https://amzn.to/49swaOB
330 Ohm Resistor: https://amzn.to/49uSBCF
Jumper Wires: https://amzn.to/49wn2IL

Software Used:
Mosquitto MQTT Broker
MQTTX (Desktop Client)
Arduino IDE (for ESP32)

🔧 *Commands Used in Video:*
Update: sudo apt update
Install: sudo apt install mosquitto mosquitto-clients
Edit Config: sudo nano /etc/mosquitto/conf.d/default.conf (or /etc/mosquitto/mosquitto.conf)
Restart: sudo systemctl restart mosquitto

*⏱️ Timestamps:*
[00:00] Intro & Project Overview (Animation)
[00:01:46] SSH into Raspberry Pi & Update
[00:02:23] How to Install Mosquitto Broker
[00:03:13] Configuring Mosquitto Port & Authentication
[00:04:11] Testing Broker Connection with MQTTX
[00:05:10] Auto-Start MQTT Service on Boot
[00:05:54] Testing Pub/Sub with Terminal
[00:06:28] ESP32 Code Explanation (WiFi & MQTT)
[00:07:26] ESP32 Demo: Publishing Data to Pi
[00:08:06] Controlling ESP32 LED remotely

ESP32 Code : https://github.com/ittipu/IoT_Bhai_Yo...

[Contact Me]
Website - https://iotbhai.io/
Facebook - https://www.facebook.com/profile.php?...
Email - [email protected]
GitHub - https://github.com/ittipu
WhatsApp +8801715497977

Like, comment, and subscribe for more Raspberry Pi, Arduino, ESP32, GSM, GPS, Embedded System & IoT tutorials!

#esp32 #ota #github #iot #microcontroller #electronics #firmwareupdate #embeddedsystems #esp32projects #arduino #arduinoproject #arduinoprogramming #esp32ota #iotbhai #esp32wifi #raspberrypi #RaspberryPi #ESP32 #MQTT #Mosquitto #IoT #EmbeddedSystems #HomeAutomation #techtutorial