WEBVTT - This file was automatically generated by VIMEO

0
00:00:08.100 --> 00:00:11.500
Hello everyone. Welcome back to the video. Number three point three.

1
00:00:11.500 --> 00:00:15.200
 And in this video. We're going to code development board

2
00:00:14.200 --> 00:00:17.400
 and send the commands

3
00:00:17.400 --> 00:00:20.400
 using the Bluetooth serial terminal mobile app. So guys,

4
00:00:20.400 --> 00:00:21.900
 let's get started with that. Okay.

5
00:00:22.900 --> 00:00:23.700
before moving on

6
00:00:25.300 --> 00:00:28.000
If you want to know more about the examples, you need to

7
00:00:28.300 --> 00:00:32.000
 click on the examples and in the Bluetooth, you have a lot of different examples.

8
00:00:31.700 --> 00:00:34.300
 And by the way, I choose serial to serial

9
00:00:34.300 --> 00:00:37.900
 BT and I modified the code according to my requirement. So

10
00:00:37.900 --> 00:00:40.300
 firstly we need to understand that how the process

11
00:00:40.300 --> 00:00:43.600
 will work. So we need to send either

12
00:00:43.600 --> 00:00:46.700
 one or either zero to the relay

13
00:00:46.700 --> 00:00:49.500
 to turn on or off the current so the lock

14
00:00:49.500 --> 00:00:52.600
 will be turned on or turn off according to the relay.

15
00:00:53.200 --> 00:00:56.100
So we need a set of where our

16
00:00:56.100 --> 00:00:59.400
 mobile will connect it to the Bluetooth and mobile will send

17
00:00:59.400 --> 00:01:02.500
 the command 1 or either 0 to control

18
00:01:02.500 --> 00:01:05.300
 the lock. So that's why we need to include the Bluetooth

19
00:01:05.300 --> 00:01:08.900
 serial dot h and here we need to define the your

20
00:01:08.900 --> 00:01:12.000
 Bluetooth device name AI type esp32 Smart

21
00:01:11.300 --> 00:01:14.800
 Lock and these are some configurations.

22
00:01:14.800 --> 00:01:17.600
 It will just see if defined

23
00:01:17.600 --> 00:01:20.100
 or not different automatically Define this stuff.

24
00:01:20.100 --> 00:01:23.500
 So this is the important here. We need to define the

25
00:01:23.500 --> 00:01:26.400
 Bluetooth serial object and in the

26
00:01:26.400 --> 00:01:27.200
 setup

27
00:01:28.900 --> 00:01:30.500
Actually, I'm using the pin 2.

28
00:01:31.700 --> 00:01:34.500
For control the relay. So here's

29
00:01:34.500 --> 00:01:37.500
 the pin mod to output and by default

30
00:01:37.500 --> 00:01:40.800
 digital right to high to control the lock and serial

31
00:01:40.800 --> 00:01:44.200
 that begin and here the serial BT dot

32
00:01:43.200 --> 00:01:46.400
 begin. This is the object that we are

33
00:01:46.400 --> 00:01:51.100
 using begin and wise name. Is that variable

34
00:01:50.100 --> 00:01:53.500
 that we Define here. Esp32 Smart Lock

35
00:01:53.500 --> 00:01:56.500
 actually when you try to use it will

36
00:01:56.500 --> 00:01:59.800
 show you the name. Okay and is the

37
00:02:01.300 --> 00:02:04.700
Serial printf the device with name is connected. And if

38
00:02:04.700 --> 00:02:07.300
 to find use pin we are not going to use the

39
00:02:07.300 --> 00:02:11.700
 pin so you can remove that line. Just

40
00:02:10.700 --> 00:02:13.500
 delete and

41
00:02:13.500 --> 00:02:16.300
 we are good to go with that. Okay, and here

42
00:02:16.300 --> 00:02:19.600
 is the loop serial rb2 data available. It will check

43
00:02:19.600 --> 00:02:22.400
 whether any data is available on

44
00:02:22.400 --> 00:02:26.400
 serial Bluetooth, then it comes inside and

45
00:02:26.400 --> 00:02:29.700
 here we will fetch the value serial. BT

46
00:02:29.700 --> 00:02:32.700
 dot read actually I'm using a corrector because we

47
00:02:32.700 --> 00:02:35.800
 only receive one RS 0 data. So if

48
00:02:35.800 --> 00:02:38.600
 the value is of one and digital right to come along

49
00:02:38.600 --> 00:02:39.100
 to

50
00:02:40.700 --> 00:02:43.300
Open the lock and else if

51
00:02:43.300 --> 00:02:46.600
 value equal to 0 then digital right to high. So this

52
00:02:46.600 --> 00:02:49.500
 is the all the stuff and now I need to move

53
00:02:49.500 --> 00:02:53.000
 to the app area. The code has been already uploaded. So

54
00:02:52.300 --> 00:02:55.600
 you guys don't need to worry about that and for

55
00:02:55.600 --> 00:02:56.800
 the mobile app.

56
00:02:59.200 --> 00:03:03.400
Here we have a Serial Bluetooth terminal.

57
00:03:02.400 --> 00:03:05.100
 Okay, just click on

58
00:03:05.100 --> 00:03:05.300
 that.

59
00:03:08.500 --> 00:03:10.300
and air we need to

60
00:03:11.400 --> 00:03:15.100
firstly you need to open up the Bluetooth. Okay from

61
00:03:14.100 --> 00:03:17.800
 that terminal. I already open that and

62
00:03:17.800 --> 00:03:21.100
 click on the device. And here we have a esp32

63
00:03:20.100 --> 00:03:23.200
 Smart Lock and it's trying to

64
00:03:23.200 --> 00:03:26.400
 connecting to asp32 Smart Lock and now

65
00:03:26.400 --> 00:03:27.700
 we need to send one.

66
00:03:29.400 --> 00:03:32.700
Okay, and sorry, I need to plug the 12

67
00:03:32.700 --> 00:03:35.200
 volt adapter to see how it works.

68
00:03:35.200 --> 00:03:36.600
 And now you see it's working.

69
00:03:37.400 --> 00:03:40.400
And if we would have the zero the lock will be

70
00:03:40.400 --> 00:03:43.700
 on okay, and if Y type

71
00:03:43.700 --> 00:03:46.300
 1 1 means open up and you see the lock

72
00:03:46.300 --> 00:03:49.200
 goes back and if I type

73
00:03:49.200 --> 00:03:52.500
 0 to make it close the lock will

74
00:03:52.500 --> 00:03:55.400
 be released. So now the next thing is

75
00:03:55.400 --> 00:03:59.300
 we need to create a custom app to control

76
00:03:58.300 --> 00:04:01.400
 our device stuff. So

77
00:04:01.400 --> 00:04:05.000
 in the next video, I'm going to create a app using MIT mobile

78
00:04:04.800 --> 00:04:07.300
 and winter by just drag

79
00:04:07.300 --> 00:04:10.100
 and drop and blocks and it will be

80
00:04:10.100 --> 00:04:10.400
 very

81
00:04:11.500 --> 00:04:15.000
you can say that funny stuff. And

82
00:04:14.300 --> 00:04:18.000
 by the way, I will recommend to iot Geeks

83
00:04:17.400 --> 00:04:20.400
 that if you want to develop a mobile app,

84
00:04:20.400 --> 00:04:24.000
 then you need to use that stuff. It

85
00:04:23.100 --> 00:04:24.300
 makes you

86
00:04:25.700 --> 00:04:26.700
super powerful

87
00:04:27.400 --> 00:04:30.100
without any coding, so guys see you

88
00:04:30.100 --> 00:04:31.300
 in the next video. Have a good day. Bye.
