WEBVTT - This file was automatically generated by VIMEO

0
00:00:07.600 --> 00:00:10.400
Hello everyone. Welcome back to the video number 8.2. And

1
00:00:10.400 --> 00:00:13.200
 in this video, we're going to set up

2
00:00:13.200 --> 00:00:14.800
 device server.

3
00:00:15.300 --> 00:00:18.500
Regarding the call which will respond to the specific request.

4
00:00:18.500 --> 00:00:21.400
 But before moving to the setup, possibly we

5
00:00:21.400 --> 00:00:25.000
 need to know about the core protocol. It's specification.

6
00:00:24.700 --> 00:00:27.600
 Actually Kobe is maintained by

7
00:00:27.600 --> 00:00:30.800
 ietf internet engineering task force,

8
00:00:30.800 --> 00:00:33.200
 and there are a lot of rfcs and on the

9
00:00:33.200 --> 00:00:34.000
 Wikipedia have a

10
00:00:34.600 --> 00:00:37.300
complete page which will provide you

11
00:00:37.300 --> 00:00:41.500
 all the detail regarding message format and its

12
00:00:40.500 --> 00:00:43.300
 versions tokens options.

13
00:00:44.100 --> 00:00:47.200
And here are the implementations in different

14
00:00:47.200 --> 00:00:51.300
 languages. For example, this is a dirt client

15
00:00:50.300 --> 00:00:53.900
 for the cope and there

16
00:00:53.900 --> 00:00:56.400
 is example of Python 3

17
00:00:56.400 --> 00:00:59.500
 aiocop client plus server

18
00:00:59.500 --> 00:01:01.100
 both and we're going to use

19
00:01:03.800 --> 00:01:06.500
nordjs nordcap this

20
00:01:07.100 --> 00:01:09.400
version which is available on the GitHub and

21
00:01:10.300 --> 00:01:13.800
Is the GitHub repository I already downloaded all the

22
00:01:13.800 --> 00:01:16.000
 stuff which is available here.

23
00:01:17.400 --> 00:01:20.200
After downloading you guys need to set up

24
00:01:20.200 --> 00:01:23.600
 install and update all the stuff using npm bar

25
00:01:23.600 --> 00:01:26.300
 before moving on you need to install a node.js on your machine

26
00:01:26.300 --> 00:01:30.000
 after that. You need to open up

27
00:01:29.300 --> 00:01:32.900
 your terminal and you need

28
00:01:32.900 --> 00:01:35.500
 to move your terminal directory to

29
00:01:35.500 --> 00:01:35.700
 the

30
00:01:36.300 --> 00:01:39.600
to the specific directory where you have all the your files

31
00:01:39.600 --> 00:01:42.500
 most probably you guys you can

32
00:01:42.500 --> 00:01:45.200
 download and move it to the C and here you can

33
00:01:45.200 --> 00:01:48.500
 extract all the stuff and install npm install Corp and

34
00:01:48.500 --> 00:01:52.500
 before moving on you can use npm update

35
00:01:51.500 --> 00:01:54.200
 and all the stuff so you can get

36
00:01:54.200 --> 00:01:54.700
 all the

37
00:01:56.700 --> 00:01:59.800
independencies for installation. So after

38
00:01:59.800 --> 00:02:02.700
 installation here is the terminal where

39
00:02:02.700 --> 00:02:05.800
 we have our examples. This is

40
00:02:05.800 --> 00:02:08.800
 the complete folder where we have a good distribution

41
00:02:08.800 --> 00:02:11.500
 Library module snore modules and

42
00:02:11.500 --> 00:02:14.700
 here are the examples. We have a different type of examples here,

43
00:02:14.700 --> 00:02:17.500
 but here is an example device server

44
00:02:17.500 --> 00:02:20.200
 that actually I have

45
00:02:20.200 --> 00:02:23.400
 seen on internet and then I modified it and

46
00:02:23.400 --> 00:02:26.600
 use this is a very good example. It's like you

47
00:02:26.600 --> 00:02:29.200
 need to set up a device and This

48
00:02:29.200 --> 00:02:31.200
 Server will act as a device where

49
00:02:32.100 --> 00:02:35.300
We have a three sensors air quality index

50
00:02:35.300 --> 00:02:38.400
 temperature and the humidity one hour anybody

51
00:02:38.400 --> 00:02:41.300
 any device request the data from that

52
00:02:41.300 --> 00:02:44.300
 server. It will send the data. So let's get started with

53
00:02:44.300 --> 00:02:45.800
 that firstly. We need to Define.

54
00:02:47.100 --> 00:02:50.500
The cope required that Library. Okay, and here

55
00:02:50.500 --> 00:02:54.700
 is the function which will return the value. We are

56
00:02:54.700 --> 00:02:57.200
 providing minimum maximum range and it will return us the random

57
00:02:57.200 --> 00:03:00.600
 number. Actually, we are not using the sensors. We're just providing the

58
00:03:00.600 --> 00:03:03.300
 dummy values. That's why we have created the random

59
00:03:03.300 --> 00:03:06.600
 integer method here to send and four

60
00:03:06.600 --> 00:03:09.500
 by default Port is five six eight three for the Cove server

61
00:03:09.500 --> 00:03:12.600
 and here we are creating the create Cove server

62
00:03:12.600 --> 00:03:15.200
 function request and go device

63
00:03:15.200 --> 00:03:18.400
 got a request from that it will display a message

64
00:03:18.400 --> 00:03:21.100
 whenever it will receive the request from

65
00:03:22.200 --> 00:03:25.500
And in order for the data, okay, and then later

66
00:03:25.500 --> 00:03:28.600
 on it will verify that what's the

67
00:03:28.600 --> 00:03:31.500
 URL actually in the previous video. I

68
00:03:31.500 --> 00:03:34.800
 told you that it works like the HTTP URLs.

69
00:03:34.800 --> 00:03:37.500
 So for example, if a client is requesting

70
00:03:37.500 --> 00:03:39.700
 here, it will request your call.

71
00:03:40.200 --> 00:03:44.000
Localhost / aqy. Sorry, this

72
00:03:43.000 --> 00:03:44.300
 is the

73
00:03:45.000 --> 00:03:45.500
local

74
00:03:50.700 --> 00:03:53.200
this is the localhost. Okay, and

75
00:03:54.600 --> 00:03:57.900
it will automatically fetch that part and check which

76
00:03:57.900 --> 00:04:00.600
 part has been requested here and according

77
00:04:00.600 --> 00:04:02.300
 to that it will provide you the

78
00:04:03.600 --> 00:04:06.300
output. Okay. So here we have our random input

79
00:04:06.300 --> 00:04:09.300
 method. We provided the range from 0 to

80
00:04:09.300 --> 00:04:12.900
 1000 and it's providing us some brand name integer for

81
00:04:12.900 --> 00:04:15.600
 that and here is a temperature case and the humidity case

82
00:04:15.600 --> 00:04:18.300
 and after that it will say that

83
00:04:18.300 --> 00:04:19.200
 cop server is

84
00:04:20.300 --> 00:04:23.300
started at Port number five six eight three and this is

85
00:04:23.300 --> 00:04:26.600
 the method display output that we are

86
00:04:26.600 --> 00:04:27.800
 using to

87
00:04:28.900 --> 00:04:30.300
send the output to the

88
00:04:32.400 --> 00:04:35.500
Client or any other machine which

89
00:04:35.500 --> 00:04:38.700
 is requesting the data. Okay. So now we

90
00:04:38.700 --> 00:04:40.600
 need to open up in the terminal to

91
00:04:42.300 --> 00:04:43.900
execute it to Y server.

92
00:04:44.400 --> 00:04:45.800
Open an integrated terminal.

93
00:04:46.900 --> 00:04:49.700
and node device

94
00:04:50.600 --> 00:04:51.000
server

95
00:04:53.500 --> 00:04:53.800
Sorry.

96
00:04:59.100 --> 00:05:02.300
Now the cops server has been started at Port number five six eight

97
00:05:02.300 --> 00:05:06.800
 three in the next video. We are going to create a

98
00:05:05.800 --> 00:05:08.300
 program which will

99
00:05:08.300 --> 00:05:11.100
 request the data from that server to go. See you

100
00:05:11.100 --> 00:05:12.300
 in the next video. Have a good day. Bye.
