WEBVTT - This file was automatically generated by VIMEO

0
00:00:07.500 --> 00:00:10.500
Welcome back guys to video number 7.6 and this

1
00:00:10.500 --> 00:00:13.200
 is the last video of that section. And in this

2
00:00:13.200 --> 00:00:18.500
 video. We're going to send the data from esp82664 to

3
00:00:18.500 --> 00:00:21.200
 the cloud mqtt broker. So

4
00:00:21.200 --> 00:00:24.400
 guys, let's get started with that. So firstly we need to

5
00:00:24.400 --> 00:00:27.300
 before moving on. Actually. I'm

6
00:00:27.300 --> 00:00:27.700
 just

7
00:00:28.800 --> 00:00:31.300
Going to show you a demo how to use

8
00:00:31.300 --> 00:00:34.800
 mqtt library and Arduino ID

9
00:00:34.800 --> 00:00:37.200
 to send the data to the mqtt broker and

10
00:00:37.200 --> 00:00:41.000
 I will display that I in web-based mqtt

11
00:00:40.500 --> 00:00:43.400
 client, which is mqtt.ron, obviously. Okay.

12
00:00:43.400 --> 00:00:46.500
 I'm not going to attach any sensor because my

13
00:00:46.500 --> 00:00:49.500
 totally focus is on to guide you about the library not

14
00:00:49.500 --> 00:00:53.600
 to about the sensor. So before moving

15
00:00:53.600 --> 00:00:56.700
 on we need to install the library regarding

16
00:00:56.700 --> 00:01:00.000
 the mqtt. Okay, so sketch

17
00:00:59.300 --> 00:01:01.100
 in libraries and

18
00:01:02.200 --> 00:01:05.400
include library and here we will search about the different

19
00:01:05.400 --> 00:01:09.100
 mqtt libraries and only install the Arduino official

20
00:01:08.100 --> 00:01:09.400
 Library.

21
00:01:15.300 --> 00:01:16.700
type mqtt here

22
00:01:20.600 --> 00:01:23.300
and it will show you a lot of mqtt libraries. So

23
00:01:23.300 --> 00:01:27.400
 we need to install Arduino mqtt client version

24
00:01:26.400 --> 00:01:29.200
 0.1.6, which is

25
00:01:29.200 --> 00:01:32.500
 developed by the Arduino. I already installed it.

26
00:01:32.500 --> 00:01:36.200
 So just you need to click on that and install for

27
00:01:35.200 --> 00:01:38.500
 your machine, okay, and click on

28
00:01:38.500 --> 00:01:40.800
 the file examples and

29
00:01:42.100 --> 00:01:45.700
Here we have Arduino mqtt client. So click on

30
00:01:45.700 --> 00:01:46.800
 the Wi-Fi simple.

31
00:01:47.700 --> 00:01:48.400
sender

32
00:01:50.700 --> 00:01:51.600
So here we need to.

33
00:01:52.900 --> 00:01:55.300
Verify the chord. Okay. These are the

34
00:01:55.300 --> 00:01:58.100
 header files that are dino will

35
00:01:58.100 --> 00:02:01.800
 use according to the port development board. If there is a Arduino

36
00:02:01.800 --> 00:02:04.400
 mkr WiFi 1010, then

37
00:02:04.400 --> 00:02:08.200
 it will use a specific library or Nano 33 or Arduino

38
00:02:07.200 --> 00:02:10.600
 on a Wi-Fi F2. Then this Library

39
00:02:10.600 --> 00:02:13.300
 will work. If it is already know. I'm

40
00:02:13.300 --> 00:02:17.800
 care 1000 then this Library will work if it is esp8264. And

41
00:02:17.800 --> 00:02:20.600
 this Library will be included if we

42
00:02:20.600 --> 00:02:24.000
 sp32 then this letter will be included and

43
00:02:23.200 --> 00:02:26.200
 Arduino secrets are where we

44
00:02:26.200 --> 00:02:29.400
 need to mention our username and the password

45
00:02:29.400 --> 00:02:32.400
 of the SSID in my case. I have a

46
00:02:32.400 --> 00:02:33.000
 maker and

47
00:02:36.400 --> 00:02:37.000
It is the password.

48
00:02:39.800 --> 00:02:41.000
Please make it blur.

49
00:02:43.800 --> 00:02:46.700
Okay, and now we are good to go with the configuration.

50
00:02:46.700 --> 00:02:50.200
 Okay. Now here is the test mosquito

51
00:02:49.200 --> 00:02:53.400
 broker. We have a different brokers

52
00:02:52.400 --> 00:02:53.800
 available.

53
00:02:55.100 --> 00:02:55.500
like

54
00:02:56.500 --> 00:02:59.700
Test art mosquito. It is free public

55
00:02:59.700 --> 00:03:03.400
 broker and emqx public

56
00:03:02.400 --> 00:03:04.800
 broker.

57
00:03:06.500 --> 00:03:08.100
You guys can use any of

58
00:03:09.200 --> 00:03:12.900
Broker there is another Hive mq public.

59
00:03:13.800 --> 00:03:14.500
broker

60
00:03:19.100 --> 00:03:22.200
So without spending any when you get

61
00:03:22.200 --> 00:03:25.800
 these free mqtt broker to test

62
00:03:25.800 --> 00:03:28.700
 your application in the live environment. Okay. So

63
00:03:28.700 --> 00:03:31.500
 here are the information here are the different port numbers

64
00:03:31.500 --> 00:03:32.700
 Okay, so

65
00:03:35.400 --> 00:03:38.300
Here we need to mention the broker detail you

66
00:03:38.300 --> 00:03:41.700
 can I simply use the Local Host? But I'm

67
00:03:41.700 --> 00:03:44.300
 using the test our mosquito.org the port

68
00:03:44.300 --> 00:03:47.500
 number one. 883. Okay, let's make it different

69
00:03:47.500 --> 00:03:50.500
 broker dot emqx.io. Okay.

70
00:03:54.400 --> 00:03:57.500
and the port is 1883, which is also same here

71
00:03:57.500 --> 00:03:59.400
 18883 and

72
00:04:01.500 --> 00:04:02.600
but for the web sockets

73
00:04:03.300 --> 00:04:06.400
We need to use a 0 8 3 Port

74
00:04:06.400 --> 00:04:06.600
 okay.

75
00:04:07.700 --> 00:04:10.600
Here zero eight three and to topic

76
00:04:10.600 --> 00:04:12.500
 / homes /

77
00:04:13.400 --> 00:04:14.300
You can say that.

78
00:04:18.900 --> 00:04:21.500
Cities / homes / Room

79
00:04:21.500 --> 00:04:25.000
 1 / temperature. Okay, we're going

80
00:04:24.100 --> 00:04:25.500
 to use that.

81
00:04:26.800 --> 00:04:27.700
topic

82
00:04:30.300 --> 00:04:33.900
instead of that. Okay next.

83
00:04:36.800 --> 00:04:39.500
It is trying to connect with the Wi-Fi. I'm

84
00:04:39.500 --> 00:04:43.000
 not going in the details and in the loop it

85
00:04:42.100 --> 00:04:45.600
 is doing is mqtt decline.poll. And

86
00:04:45.600 --> 00:04:49.100
 yes, it is the main method where the

87
00:04:50.800 --> 00:04:52.200
mqtt is starting.

88
00:04:57.100 --> 00:04:58.400
Yes, and

89
00:05:00.200 --> 00:05:03.600
here it will tap the begin message topic print.

90
00:05:03.600 --> 00:05:06.400
 Hello count and it's sending the message to the

91
00:05:07.500 --> 00:05:11.800
Broker, okay, so just I'm

92
00:05:11.800 --> 00:05:13.200
 going to send that.

93
00:05:14.100 --> 00:05:17.400
What you need to verify the board? Yes board is connected and we

94
00:05:17.400 --> 00:05:18.200
 are good to go with that.

95
00:05:21.600 --> 00:05:23.800
And here I need to click on the connect.

96
00:05:24.800 --> 00:05:26.200
And we're good to go with that.

97
00:05:30.100 --> 00:05:31.200
Now we just need to wait.

98
00:05:33.100 --> 00:05:36.100
For the core to be uploaded to the device it took some time.

99
00:05:47.500 --> 00:05:50.200
Core has been successfully uploaded to the device. Just click

100
00:05:50.200 --> 00:05:53.100
 on the serial Monitor and here we will see

101
00:05:53.100 --> 00:05:53.200
 the

102
00:05:54.300 --> 00:05:56.400
all the message detail from the device.

103
00:05:58.200 --> 00:05:59.200
That puts going on.

104
00:06:01.300 --> 00:06:04.500
That's nowhere connected to the mqtt broker.

105
00:06:05.200 --> 00:06:07.400
Sending the message and here. Yeah.

106
00:06:08.200 --> 00:06:10.900
We are seeing the message instantly. So now

107
00:06:12.300 --> 00:06:15.800
all the communication is happening while the broker

108
00:06:15.800 --> 00:06:18.800
 dot emqx.io, which is live on

109
00:06:18.800 --> 00:06:20.100
 the internet and

110
00:06:21.900 --> 00:06:24.400
When you're saying that how the device is sending

111
00:06:24.400 --> 00:06:27.700
 instantly message while the mqtt broker.

112
00:06:28.200 --> 00:06:31.400
So guys, I hope you understand that stuff. If you have any question,

113
00:06:31.400 --> 00:06:34.800
 please feel free to send a message. We in the message box,

114
00:06:34.800 --> 00:06:37.600
 and I will try my best to accommodate your queries and

115
00:06:37.600 --> 00:06:40.300
 see you in the next section where we're

116
00:06:40.300 --> 00:06:43.800
 going to talk about the cope and other application layer

117
00:06:43.800 --> 00:06:46.100
 protocols the next section of a good

118
00:06:46.100 --> 00:06:46.900
 day, bye-bye.
