Welcome back guys to video number 7.3 where we're
going to test how the mqtt broker
works. So let's get started with that. If
you see there right now, you will see there's a zero
connection zero topics zero subscription for that.
I have just opened up
three different Terminals and here we
will type the most keto underscore sub. This
is for the subscription. Ah, come on minus H
where we specify the host right now. We
have a local host. But if you have installed that broker
on VPS or a Cloud Server, then you
will put the IP here and the next is minus P
Port by default. It's sport is 1883
for the TCP. Okay,
and there are some different ports for web sockets
and the SSL which will discuss in
the later in that video. Okay, and the next
thing is minus the topic and for that Home
Room 1 and this is the temperature.
Here and we are good to go with that. Okay.
And next we need to assign a subscribe
to another topic.
localhost minus P1
Sorry.
One eight eight three minus t /
ohm / Room 1 Room
2 and temperature, okay.
And we're good to go with that. And this is the our Pub. For
example, you can say that this is the dashboard. This is another dashboard
and this is the device where from that
we're going to send the data and for the public message. We
need to use the mosquito underscore Pub.
Minus H, Local Host minus p1883 minus
t topic slash.
Ohm slash Room 1 slash temperature.
Sorry, you need to make the same spelling.
And if my message, okay, and I'm
going to drive the 18.
Okay, we're good to go with that and you will see there 18 is
there and if we visit the
dashboard then you will see the control connections to topics to
subscriptions. Okay and below are
the complete details that incoming messages outgoing messages
dropped and some of the stuff these are the
subscriptions. These are the topics. This is
the stuff that actually emqx is providing
for the real-time monitoring of the Matrix and how
your broker is going on.
How much topics are subscribed how
many connections are connected to the broker and
how the things are going
on and it will help you to Monitor and
optimize or increase your resources according
to your requirements on the cloud. If you are using AWS or
Azure, you can increase your
Cloud resources on the base of these statistics
and decrease the resources if you
have a
Less load it will make your
cost effective.
So now it's time to send the message to room two.
So I'm just going to change the
value here to okay 20
and now you will see the message came here in that window not
to that window. So how the
sub and the pub works. I explained
to you with the commands and here are
the complete details which shows you that this is the new
message came here. Okay. Now what if we
Verify it with the wild cards. So I need to
make another command prompt open here and
make it to resize.
to
yes, and
CLS and mosquito underscore sub
minus H Local Host minus
P 183 minus t
slash home and I'm
going to use the plus wild card to monitor the both room.
Temperature. Okay, and now
one by one, I will again type the command.
And you see here the message came here and the
message came here. Okay, and same if
I choose here 18.
It come here 18 and it also comes here 18.
Okay. So this is the plus wild
card. But if you have a multiple topics here, then
you can use the hashtag.
So guys in this video we have just tested
how mqtt aescore sob
and how I'm Katrina. Let's go pop works and in the next video, we're
going to talk about how to use mqtt web-based client
and the desktop always client softwares
for the testing and debugging the data from
devices and to worry for all
the stuff. So I see you in the next video. Have a good day, bye-bye.