Skip to player
Skip to main content
Skip to footer
Search
Connect
Watch fullscreen
Like
Comments
Bookmark
Share
Add to Playlist
Report
XIAO ESP32C3 as MQTT Broker | Setup MQTT Broker in XIAO ESP32C3 using EmbeddedMQTTBroker Library |
Fusion Automate
Follow
9/4/2024
------------------------------------------------------------
Website: https://fusionautomate.in
Telegram: https://t.me/fusion_automate_admin
Telegram Group: https://t.me/fusionautomate
WhatsApp: https://wa.me/message/B7RXUT4OUXWUF1
WhatsApp Group: https://chat.whatsapp.com/DW7K2yo3ee52mtG4ODTvtc
Instagram: https://instagram.com/fusion_automate
LinkedIn: https://www.linkedin.com/company/fusion-automate
GitHub: https://github.com/papercodeIN
Join this channel to get access to perks: https://www.youtube.com/channel/UCKKhdFV0q8CV5vWUDfiDfTw/join
------------------------------------------------------------
Category
🤖
Tech
Transcript
Display full video transcript
00:00
Hi everyone and welcome. In this video we will see how to set up MQTT broker in
00:07
Xiao ESP32C3 using embedded MQTT broker library. So if you want to use
00:13
your Xiao ESP32C3 board as a MQTT broker then you can use it using
00:18
embedded MQTT broker library. So instead of using Mosquito MQTT broker or
00:23
Hive MQTT broker or EMQX broker, Nano MQTT broker you can use tiny little Xiao
00:31
ESP32C3 board as a MQTT broker and you can place in your local area network
00:36
and your MQTT client can exchange the data using this Xiao ESP32C3 MQTT
00:42
broker. So let's see how you can create MQTT broker using Xiao ESP32C3.
00:48
So I have ESP32C3 connected with my system and here is the Arduino IDE.
00:54
Before uploading the code here is the connection diagram. So our ESP32C3
01:00
board is in the center which will act as a MQTT broker and different
01:04
different MQTT client can connect with this Xiao ESP32C3 MQTT broker and they
01:09
can exchange the data. Now every client can publish and subscribe to any topic
01:15
that is also possible and everything will be work in the local area network.
01:19
So if you have multiple devices in your local area network then you can exchange
01:23
the data. If you want to control some LED in your local area network then
01:28
also you can do that. If you want to read some sensor data from anywhere in the
01:32
local area network to your mobile phone to your dashboard then also you can do
01:36
that. So all these options are possible with the embedded MQTT broker library. So
01:42
here is our Arduino and I have already installed the embedded MQTT broker
01:46
library. So I'm going to copy this and here we will search it. OK. Here you can
01:51
see it is already installed in my Arduino IDE. You can also install and
01:55
then you can use it. Now once you install this embedded MQTT broker
01:59
library you have to go to the examples. OK. And here you have to search for the
02:05
embedded MQTT broker folder and here it is. OK. Embedded MQTT broker and here we
02:11
have the two example HTTP server and MQTT broker and another example is
02:16
simple MQTT broker. Now I'm going to use this simple MQTT broker sketch to use
02:21
my ESP32C3 as MQTT broker. OK. So here is our sketch. So first of all what you
02:29
have to do is you have to provide your Wi-Fi SSID and password to connect your
02:34
Xiao ESP32C3 with your Wi-Fi. OK. Or you can say to put your ESP32C3 in the
02:41
local area networks. So here I'm going to provide the SSID and password of my
02:45
Wi-Fi. So. OK. So here is the SSID and the password of my Wi-Fi. So our ESP32C3
02:54
will connect with our Wi-Fi. OK. And it will act as an MQTT broker. So all of the
02:59
MQTT client can use our ESP32C3 MQTT broker and they can exchange the
03:04
data. OK. And then after here you can see in this line you have to specify that on
03:10
which TCP port you want to start your MQTT broker. So right now the default
03:15
port is 1883. OK. But if you want to change the TCP port for your MQTT
03:19
broker then you can change it from here. OK. And you can leave the rest of the
03:24
thing as it is and you can directly upload this code into your ESP32C3
03:29
board. So here is my ESP32C3 connected. I'm going to upload this sketch
03:34
into my ESP32C3 board.
03:40
OK. So our sketch is successfully uploaded to the ESP32C3 board and now we can open
03:59
the serial monitor.
04:02
Let me press the reset button. OK. OK. Here you can see Wi-Fi connected. Broker
04:09
started and the broker is running on this IP address 192.168.1.2 and the port
04:15
is 1883. OK. So we can use this IP address and we can use this port number to
04:20
connect with the MQTT broker running inside our ESP32C3 board. So I can open
04:26
my MQTT Explorer software. OK. And I can provide the IP address which is 192.168.1.2
04:34
OK. I am going to create one more connection and it's our ESP32C3. OK. I'm
04:43
going to save it. The port number is 1883 and we can click on connect. OK. You can
04:51
see it is connected. Now we can open one more MQTT client. OK. Which is MQTT
04:56
Explorer and I'm going to use the same IP address and port number to connect
05:01
with my ESP32C3 MQTT broker. But I'm not going to use the same client ID. So
05:09
here you can see MQTT client ID. So I'm going to change my client ID and then we
05:13
will go back and then we will connect. OK. So we are connected with our ESP32C3
05:18
MQTT broker and in the topic I'm going to publish some values on the test
05:24
topic. So topic is test. The value is 1 2 3. OK. And I'm going to publish it. And
05:30
here you can see we have received the value in another client. Also I can
05:34
update the same topic value from different clients. So 4 5 6 and I can
05:41
publish. And here you can see we have received the value. OK. So this is how
05:47
you can use your ESP32C3 board as a MQTT broker. So multiple client can
05:52
connect with your ESP32C3 board and they can exchange the data. And your
05:56
client can be your Python client, your Node-RED, your SCADA system, your
06:00
Raspberry Pi. OK. Or any other ESP32C3 board or any other ESP32 board or
06:06
NodeMCU board anything. So you can use this ESP32C3 as a MQTT broker. Instead
06:12
of using Raspberry Pi and installing another MQTT broker in the Raspberry Pi
06:16
you can use this tiny and low cost microcontroller to create your own MQTT
06:21
broker. Also you can do the port forwarding and you can use this ESP32C3
06:26
MQTT broker as a cloud MQTT broker as well. OK. But with the help of port
06:30
forwarding. So you have to learn that how to do the port forwarding for your ESP32C3
06:35
board. So I hope this thing is clear that how you can set up MQTT
06:40
broker in the Xiao ESP32C3 board. And if you still have any questions or any
06:46
doubt then you can always ping me on Telegram, Instagram, WhatsApp, anywhere.
06:49
And if you want to know more about the embedded MQTT broker library then here I
06:53
have provided the GitHub repository link for this library. You can go and you can
06:56
check out the limitations and everything. OK. So I hope everything is clear and if
07:01
you still have any questions or any doubt then you can always ping me on Telegram,
07:04
Instagram, WhatsApp. All the social media link is available on our website. So
07:09
let's meet in the future videos. OK. Till then take care. Goodbye and thank you.
Recommended
0:59
|
Up next
Unboxing LILYGO T4 V1.3 ILI9341 LCD Display with ESP32 | IoT | IIoT | LILYGO | ESP |
Fusion Automate
10/28/2024
0:48
Unboxing MJ2818A Barcode Scanner | QR Code | Scanner | Barcode | Node-RED |
Fusion Automate
10/28/2024
1:48
DIY Android Tablet Using Orange Pi Zero 3 | Android V12 | VIEWE Display | 10.1 Inch HDMI Display |
Fusion Automate
4/13/2025
1:30
DIY Hacking Device using Kali Linux in Orange Pi Zero 3 | OPI Zero 3 | Hacking | KALI |
Fusion Automate
4/13/2025
1:18
Running Raspberry Pi OS in Orange Pi Zero 3 | OPI Zero 3 |
Fusion Automate
4/13/2025
0:45
Unboxing Orange Pi 32gb EMMC Module | Orange Pi 4A | OPI | eMMC Storage |
Fusion Automate
4/13/2025
11:04
How to Build a Mini NAS Server using Banana Pi M4 Zero with External Storage Drive
Fusion Automate
2/17/2025
8:27
How to Control Banana PI M4-Zero GPIO with Node-RED and node-red-contrib-opi-gpio node |
Fusion Automate
2/17/2025
5:55
How to Control Banana PI M4-Zero GPIO with Python using RPI.GPIO Library |
Fusion Automate
2/17/2025
8:02
How to Control Banana PI M4-Zero GPIO using Wiring Pi Python Library |
Fusion Automate
2/17/2025
7:02
How to Setup WiringPi Package in Banana PI M4 Zero for GPIO Control |
Fusion Automate
2/17/2025
5:53
How to Setup WiringPi Package in Banana PI M4-Berry for GPIO Control |
Fusion Automate
2/17/2025
9:04
How to Control Banana PI M4-Berry GPIO using Wiring Pi Python Library |
Fusion Automate
2/17/2025
5:11
How to Control Banana PI M4-Berry GPIO with Python using RPI.GPIO Library |
Fusion Automate
2/17/2025
8:18
How to Control Banana PI M4-Berry GPIO with Node-RED and node-red-contrib-opi-gpio node |
Fusion Automate
2/17/2025
16:49
Getting Started with Orange Pi Zero 3 | Flash Ubuntu Noble Server Linux to SD Card |
Fusion Automate
1/31/2025
10:22
Elecrow CrowPanel ESP32 4.2” E-paper HMI Display Wifi_Http_Openweather_Demo | ESP32 | E-Paper |
Fusion Automate
1/25/2025
15:38
Getting Started with Orange Pi Zero 3 - Flash Ubuntu Jammy Server Linux OS to SD Card - Configure USB Debugging - SSH Access
Fusion Automate
1/24/2025
8:42
Set up WIN-SN-TnH-M-M Temperature and Humidity Sensor Using ModScan Software | Modbus RS485 |
Fusion Automate
1/24/2025
7:26
How to Build Weather Clock using Elecrow CrowPanel ESP32 4.2” E-Paper HMI Display | IoT Clock |
Fusion Automate
1/24/2025
11:22
Getting Started with Orange Pi 4A | Flash Ubuntu Jammy Gnome Desktop Linux to SD Card | SSH Access |
Fusion Automate
1/24/2025
16:48
Getting Started with Orange Pi 4A | Flash Ubuntu Jammy Server Linux to SD Card | USB Debugging |
Fusion Automate
1/24/2025
0:30
Unboxing Pico W5 Microcontroller Development Board from Elecrow | RP2040 | WIFI 2.4GHz/5GHz | BT5 |
Fusion Automate
1/18/2025
9:40
How to Control Orange Pi Zero 3 GPIO with Python using WiringPi Library | OPI Zero 3 | WiringPi |
Fusion Automate
1/17/2025
8:02
How to Control Orange Pi Zero 3 GPIO with Node-RED using node-red-contrib-opi-gpio node |
Fusion Automate
1/17/2025