Skip to player
Skip to main content
Search
Connect
Watch fullscreen
Like
Bookmark
Share
More
Add to Playlist
Report
ESP8266 as MQTT Broker | Setup Secure MQTT Broker in NodeMCU ESP8266 using sMQTTBroker Library |
Fusion Automate
Follow
1 year ago
This video is about how to setup secure MQTT broker in NodeMCU ESP8266 board using sMQTTBroker Library with username and password authentication.
Get the Code: https://fusionautomate.in/esp8266-as-mqtt-broker/
------------------------------------------------------------
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 the previous video we have covered that how to set up
00:06
basic MQTT broker in NodeMCU using SMQTT broker library. So that was very basic
00:13
MQTT broker implementation in the NodeMCU without any security or you can
00:17
say without any username and password. Okay so any client okay any MQTT client
00:22
can directly connect with that MQTT broker without any security but we want
00:27
a security in our broker without any username and password no client should
00:32
able to connect with our MQTT broker then how we can implement it. Okay so
00:36
that thing we are going to cover in this video. So this is the topic for this
00:40
video that how to set up secure MQTT broker in the NodeMCU using SMQTT
00:46
broker library with username and password authentication. So until and
00:50
unless you are not providing correct username and password you won't be able
00:54
to connect with NodeMCU MQTT broker. So let's see how you can implement it. So
01:00
here I have my entire code okay so here is our secure ESP8266 MQTT broker
01:07
code I'm going to provide it okay after this video so you can directly use it.
01:11
Now here is our entire code so you have to change few things as per your
01:18
requirement in this code. So first thing is your MQTT connection username and
01:23
password so whenever you try to connect with your NodeMCU MQTT broker what
01:28
username and password you want to set that you have to specify here. So I have
01:32
set my MQTT client username admin and MQTT client password password okay just
01:37
for the demonstration purpose and then after you have to change another thing
01:41
which is your Wi-Fi SSID and password so on which Wi-Fi connection you are going
01:47
to connect your ESP8266 or NodeMCU board that you have to specify here and
01:53
the one more thing you have to specify as per your requirement is the MQTT
01:57
port so on which TCP port you want to start your MQTT broker so that you have
02:02
to specify here. So totally you have to modify five things as per your
02:06
requirement first two things are MQTT connection username and password okay
02:12
third and fourth is your Wi-Fi SSID and password and the fifth is MQTT broker
02:17
port number. So once you modify everything as per your requirement then
02:22
you can directly upload this code into your NodeMCU board. So here is my NodeMCU
02:27
board connected with my system I am going to upload this sketch into my
02:31
NodeMCU board okay
02:35
you
02:39
okay we have successfully uploaded the code and here we have the IP address of
02:44
our NodeMCU board. Now we can use this IP address to connect with our NodeMCU
02:48
MQTT broker. So again I am going to open MQTT Explorer which is MQTT client
02:55
software and I'm going to select the ESP8266 connection and I'll try to
03:00
connect okay here you can see connection refused because of bad username or
03:05
password now we have already specified the username and password here to
03:09
connect with our MQTT broker so without any username and password you won't be
03:13
able to connect with our MQTT broker so that is what we want right so I'm going
03:17
to copy the username from here and I'm going to paste it here and we will copy
03:21
the password and we will paste it here and then after we will try to connect
03:26
and we are successfully connected okay so if you do not provide any username or
03:31
password then you won't be able to connect with our NodeMCU MQTT broker
03:35
and if you provide wrong username and password okay in this scenario username
03:40
is correct but password is wrong so still you are not able to connect you
03:44
can see bad username and password okay and if you provide correct username and
03:50
password then only you will be able to connect with NodeMCU MQTT broker now
03:54
again I am going to open another MQTT client which is again MQTT Explorer I
03:59
will select the NodeMCU connection okay the password is password and the
04:04
username is admin and then we will try to connect okay here you can see
04:09
connection refused identify rejected because let me show you so if you go to
04:16
the advanced here also if you go to the advanced then the client ID for this two
04:21
client is same okay so you have to change the client ID then only the
04:25
second client will be able to connect with your ESP8266 MQTT broker so I'm
04:31
going to add some random number here okay and then we will go back and then
04:35
we will try to connect and we are connected so if your client IDs are same
04:40
then you won't be able to connect with your NodeMCU MQTT broker okay so that
04:45
thing also you have to take care of now we can use some test topic and we can
04:49
publish some test data okay and in the second client we have received that
04:54
also we can publish some test data from the second client and here we have okay
05:00
so it is working absolutely fine with security so I hope this thing is clear
05:06
that how you can set up your secure MQTT broker in the NodeMCU so here is the
05:11
code I will provide the code okay maybe you will get that into our GitHub
05:16
repository or I'll provide the code into our website so you can directly
05:20
copy from our website so I hope everything is clear that how you can set
05:25
up your secure MQTT broker in the NodeMCU and if you still have any
05:29
questions or any doubt then you can always ping me on telegram Instagram
05:32
whatsapp anywhere okay all the social media link is available on our website
05:36
also you can send me a mail also you can comment on this video now let's meet in
05:42
the next video till then take care goodbye and thank you
Be the first to comment
Add your comment
Recommended
7:23
|
Up next
ESP8266 as MQTT Broker | How to Setup Basic MQTT Broker in NodeMCU ESP8266 using sMQTTBroker Library
Fusion Automate
1 year ago
8:03
ESP32 as MQTT Broker | How to Setup Secure MQTT Broker in ESP32 using PicoMQTT Library with Username and Password Authentication |
Fusion Automate
1 year ago
7:27
ESP32 as MQTT Broker | How to Setup MQTT Broker with Custom TCP Port in ESP32 using PicoMQTT Library |
Fusion Automate
1 year ago
8:09
ESP32 as MQTT Broker | How to Setup Basic MQTT Broker in ESP32 using PicoMQTT Library
Fusion Automate
1 year ago
0:52
Unboxing Elecrow ESP32 Serial Port to Ethernet Module | WT32-ETH01 Development Board Module | IoT |
Fusion Automate
1 year ago
1:04
ZLAN 5143D Modbus Serial to TCP Converter Gateway | Protocol Converter | IoT | IIoT | Modbus |
Fusion Automate
1 year ago
9:18
How to Connect Node RED with Mosquitto MQTT Broker as a MQTT Publisher and MQTT Subscriber | IoT |
Fusion Automate
2 years ago
0:13
💡✨A Robot Revolution #Robots #Humanoids #AI #ShanghaiRoboticsEvent #FutureTech
✨DailyFavoriteSearch
1 year ago
9:41
Getting Started with D-Robotics RDK X5 | Flash Ubuntu Desktop OS to SD Card | HDMI Screen Setup |
Fusion Automate
7 weeks ago
0:59
D-Robotics RDK X5 Single Board Computer Unboxing & First Impressions
Fusion Automate
7 weeks ago
0:59
DIY Mini PC Using D Robotics RDK X5 SBC | Ubuntu Desktop Linux | Elecrow 7 inch Touch Monitor |
Fusion Automate
7 weeks ago
0:50
Assembling Your RDK X5 with the D-Robotics RDK X5 Metal Case
Fusion Automate
7 weeks ago
0:45
Protect Your RDK X5 in Style – Unboxing the Official D-Robotics RDK X5 SBC Case
Fusion Automate
7 weeks ago
1:48
DIY Android Tablet Using Orange Pi Zero 3 | Android V12 | VIEWE Display | 10.1 Inch HDMI Display |
Fusion Automate
8 months ago
1:30
DIY Hacking Device using Kali Linux in Orange Pi Zero 3 | OPI Zero 3 | Hacking | KALI |
Fusion Automate
8 months ago
1:18
Running Raspberry Pi OS in Orange Pi Zero 3 | OPI Zero 3 |
Fusion Automate
8 months ago
0:45
Unboxing Orange Pi 32gb EMMC Module | Orange Pi 4A | OPI | eMMC Storage |
Fusion Automate
8 months ago
11:04
How to Build a Mini NAS Server using Banana Pi M4 Zero with External Storage Drive
Fusion Automate
10 months ago
8:27
How to Control Banana PI M4-Zero GPIO with Node-RED and node-red-contrib-opi-gpio node |
Fusion Automate
10 months ago
5:55
How to Control Banana PI M4-Zero GPIO with Python using RPI.GPIO Library |
Fusion Automate
10 months ago
8:02
How to Control Banana PI M4-Zero GPIO using Wiring Pi Python Library |
Fusion Automate
10 months ago
7:02
How to Setup WiringPi Package in Banana PI M4 Zero for GPIO Control |
Fusion Automate
10 months ago
5:53
How to Setup WiringPi Package in Banana PI M4-Berry for GPIO Control |
Fusion Automate
10 months ago
9:04
How to Control Banana PI M4-Berry GPIO using Wiring Pi Python Library |
Fusion Automate
10 months ago
5:11
How to Control Banana PI M4-Berry GPIO with Python using RPI.GPIO Library |
Fusion Automate
10 months ago
Be the first to comment