0
1
00:00:01,040 --> 00:00:07,430
Okay, so now that our LoRaWAN server is ready, we'll be able to configure our private network.
1

2
00:00:07,760 --> 00:00:12,080
And for that we'll use exactly the same four steps that we explained earlier.
2

3
00:00:12,230 --> 00:00:14,670
The first step is the gateway configuration.
3

4
00:00:14,690 --> 00:00:17,810
It tells the gateway how to reach the Network Server.
4

5
00:00:18,590 --> 00:00:24,350
The second step is the gateway registration, because only a registered gateway is allowed to talk to
5

6
00:00:24,350 --> 00:00:25,160
the Network Server.
6

7
00:00:25,160 --> 00:00:27,650
So, we need to register it before.
7

8
00:00:28,100 --> 00:00:32,990
For the third step, we're going to register our device on the Network Server.
8

9
00:00:33,350 --> 00:00:40,970
Again, we're going to register two end-devices, one with an OTAA activation mode and the other one with
9

10
00:00:41,000 --> 00:00:41,530
ABP.
10

11
00:00:42,110 --> 00:00:45,220
And finally, the fourth step is the device configuration.
11

12
00:00:45,230 --> 00:00:49,850
We load a new firmware in the device with the right LoRaWAN keys.
12

13
00:00:50,270 --> 00:00:51,050
Right.
13

14
00:00:51,050 --> 00:00:54,380
Let's start with the first step: the gateway configuration.
14

15
00:00:55,130 --> 00:00:59,190
Our ChirpStack server listens on Port 1700.
15

16
00:00:59,520 --> 00:01:04,180
As we said earlier, the service in charge of this is called the Gateway Bridge.
16

17
00:01:04,200 --> 00:01:10,140
So in our case, we need to configure the gateway to send its LoRaWAN data to this address.
17

18
00:01:10,140 --> 00:01:16,110
chirpstack.univ-lorawan.fr on Port 1700.
18

19
00:01:16,530 --> 00:01:20,220
I just remind you that this URL is my server's name.
19

20
00:01:20,220 --> 00:01:26,100
If you just have an IP address for your server, then this IP address is the one you need to enter in
20

21
00:01:26,100 --> 00:01:29,580
your gateway . Depending on the gateway you have,
21

22
00:01:29,610 --> 00:01:32,010
there are several options to configure it.
22

23
00:01:32,100 --> 00:01:37,860
We saw that sometimes we need to connect to the gateway with SSH or with a cellular link.
23

24
00:01:37,860 --> 00:01:44,460
But in our case we have a gateway with a user interface, so we can access it from a web page.
24

25
00:01:44,730 --> 00:01:50,400
We've covered this gateway configuration topic in the previous video, so please don't hesitate to check
25

26
00:01:50,400 --> 00:01:52,110
it out one more time if you need.
26

27
00:01:52,140 --> 00:01:52,710
Okay.
27

28
00:01:52,710 --> 00:01:58,320
But just before leaving this configuration page, I'm just going to copy the Gateway EUI, because I will
28

29
00:01:58,320 --> 00:02:01,110
need it in a few seconds for the gateway registration.
29

30
00:02:01,800 --> 00:02:05,550
Now I go back on my ChirpStack server for the second step.
30

31
00:02:05,910 --> 00:02:10,290
I'm going to register my gateway. On every network server
31

32
00:02:10,290 --> 00:02:16,290
the user interface will be different, but at the end the overall process remains always the same.
32

33
00:02:16,800 --> 00:02:18,050
On ChirpStack,
33

34
00:02:18,060 --> 00:02:21,870
I need to go on the gateway section and I click on add gateway.
34

35
00:02:22,350 --> 00:02:29,250
I give it a name, an optional description, and the most important field is the gateway EUI.
35

36
00:02:29,280 --> 00:02:35,400
For this demonstration, I don't care about the location so we can submit the registration without filling
36

37
00:02:35,400 --> 00:02:37,230
in anything for the location.
37

38
00:02:37,530 --> 00:02:39,090
The second step is done.
38

39
00:02:39,090 --> 00:02:45,870
So now, even if our configuration is not yet completed, the ChirpStack Network Server receives LoRaWAN
39

40
00:02:45,870 --> 00:02:46,500
frame.
40

41
00:02:46,920 --> 00:02:50,870
Any messages coming from my gateway is displayed in the console.
41

42
00:02:50,880 --> 00:02:56,630
If we want to see the gateway live data for this gateway, we just need to go on the LoRaWAN frames tab here.
42

43
00:02:56,640 --> 00:03:02,700
And of course, waiting for the messages. There is nothing yet, but there will be frames shortly.
43

44
00:03:03,360 --> 00:03:04,500
There we go.
44

45
00:03:05,220 --> 00:03:12,750
Now for the third step, we need to register end-devices and on many Network Servers, end-devices can
45

46
00:03:12,750 --> 00:03:14,550
be grouped by applications.
46

47
00:03:14,670 --> 00:03:18,000
So first we're going to create an application.
47

48
00:03:18,360 --> 00:03:21,720
In this application, we'll register two devices.
48

49
00:03:22,790 --> 00:03:30,050
So I go in the application section, I click on add application, and as usual, we can enter a name
49

50
00:03:30,050 --> 00:03:31,040
and description.
50

51
00:03:32,240 --> 00:03:34,470
Okay, now for the device, ChirpStack
51

52
00:03:34,490 --> 00:03:36,730
first need to define a device profile.
52

53
00:03:36,740 --> 00:03:39,020
So what is a device profile?
53

54
00:03:39,050 --> 00:03:44,750
A device profile is a group of settings that will be able to apply to several end-devices.
54

55
00:03:44,780 --> 00:03:51,080
For example, if we know that a group of devices is going to use the OTAA activation mode in the European
55

56
00:03:51,080 --> 00:03:55,010
region, then we can create a device profile accordingly.
56

57
00:03:55,280 --> 00:04:01,340
And when we will create end-devices with these parameters, we'll just need to apply this profile.
57

58
00:04:01,370 --> 00:04:06,640
What is nice with this method is that we don't need to re-enter the same settings again and again.
58

59
00:04:06,650 --> 00:04:09,740
Everything will be set in the device profile already.
59

60
00:04:10,430 --> 00:04:12,210
Okay, let's try that.
60

61
00:04:12,230 --> 00:04:18,500
First I want to register an OTAA end-device so I go in the device profile section.
61

62
00:04:18,620 --> 00:04:23,780
If we forget to create a device profile before creating an end device, the network server will tell
62

63
00:04:23,780 --> 00:04:24,770
you so anyway.
63

64
00:04:24,770 --> 00:04:26,150
So, no worries.
64

65
00:04:26,150 --> 00:04:28,010
You will always end up here.
65

66
00:04:28,970 --> 00:04:32,600
I add a new device profile. As usual,
66

67
00:04:32,610 --> 00:04:38,130
I give it a name profile-otaa and an optional description.
67

68
00:04:38,310 --> 00:04:42,990
And now, I can choose the parameters that will be applied to my end-devices.
68

69
00:04:43,260 --> 00:04:49,110
My first end-device uses 1.0.3 LoRaWAN version in the European region.
69

70
00:04:49,230 --> 00:04:55,890
If for testing purposes you don't know the LoRaWAN version, I would advise you to stick with the 1.0.0.
70

71
00:04:55,890 --> 00:04:59,730
But, of course it's just to check the proper communication.
71

72
00:05:00,000 --> 00:05:03,810
I can choose if the Network Server uses the ADR algorithm.
72

73
00:05:04,110 --> 00:05:08,550
The expected uplink interval is just for the dashboard on the main page.
73

74
00:05:08,580 --> 00:05:13,410
The end-device will be marked as green if it has transmitted during this interval.
74

75
00:05:14,190 --> 00:05:22,170
Now, on the second tab we can specify if you want to use ABP or OTAA for this profile. I will set OTAA
75

76
00:05:22,380 --> 00:05:23,700
then submit.
76

77
00:05:24,510 --> 00:05:30,650
Now that we've added a device profile, then we can create a new end device with this profile.
77

78
00:05:30,660 --> 00:05:37,920
So, we go in the application section and I select the application I created earlier and I create a new
78

79
00:05:37,920 --> 00:05:38,790
device.
79

80
00:05:38,850 --> 00:05:42,910
Again, I give it a name device1-otaa.
80

81
00:05:45,610 --> 00:05:51,820
I entered the device EUI. Be careful if you use the same device to test different modes because it's not
81

82
00:05:51,820 --> 00:05:54,930
allowed to use the same devEUI for different hardware.
82

83
00:05:54,940 --> 00:06:03,580
So, in my case I've got a specific devEUI when I use OTAA and another one when I use ABP. And we apply
83

84
00:06:03,580 --> 00:06:08,470
the device profile created for OTAA, it's just the one we've created.
84

85
00:06:08,680 --> 00:06:12,220
Now I can apply and generate an application key.
85

86
00:06:12,460 --> 00:06:20,170
In my case, I generate a new one and obviously this is the one I will have to enter in my end-device later.
86

87
00:06:20,860 --> 00:06:27,100
At this point the device creation is completed and some of you may have noticed that we've never entered
87

88
00:06:27,100 --> 00:06:29,260
the appEUI/joinEUI setting.
88

89
00:06:29,380 --> 00:06:30,640
Why is that?
89

90
00:06:30,880 --> 00:06:34,900
This is supposed to be one of the required parameters when we use OTAA.
90

91
00:06:35,860 --> 00:06:41,590
Actually, so far we've mostly used the value zero for the appEUI/joinEUI.
91

92
00:06:41,860 --> 00:06:43,870
That's because we didn't use it.
92

93
00:06:44,200 --> 00:06:48,710
The joinEUI is an identifier useful when we use a join server.
93

94
00:06:49,220 --> 00:06:54,730
In our case we don't have one, so ChirpStack doesn't even bother to ask for it.
94

95
00:06:54,740 --> 00:06:59,990
If you want to know more about what is a join server, then I advise you to read the LoRaWAN book for
95

96
00:06:59,990 --> 00:07:03,260
advanced user available for free on our website.
96

97
00:07:03,260 --> 00:07:05,870
You will find many useful information about it.
97

98
00:07:05,990 --> 00:07:10,190
Okay, so once we've completed the creation, then we're done.
98

99
00:07:10,220 --> 00:07:13,940
We just need to wait for new messages coming from the end-device.
99

100
00:07:14,180 --> 00:07:16,190
There are two important tabs here.
100

101
00:07:16,220 --> 00:07:21,500
The first one is a dashboard where we can check the information on the device status and the radio
101

102
00:07:21,500 --> 00:07:22,580
transmission setting.
102

103
00:07:22,580 --> 00:07:26,330
And the last tab on the right is the end-device live data log.
103

104
00:07:26,330 --> 00:07:30,110
This is where we'll see all frames arriving on the Application Server.
104

105
00:07:30,950 --> 00:07:36,740
The fourth and last step is then to configure the end-device itself with the right parameters.
105

106
00:07:36,890 --> 00:07:43,520
For that, we use the same configuration file as usual, so we need to apply the devEUI,
106

107
00:07:43,550 --> 00:07:48,800
the appEUI/joinEUI is still zero and we just need to update the appKey.
107

108
00:07:49,070 --> 00:07:50,030
There we go.
108

109
00:07:50,060 --> 00:07:53,450
We can compile this code and upload it in our end-device.
109

110
00:07:54,560 --> 00:08:00,290
On the left there is one window with my device logs and on the right there is another window with my
110

111
00:08:00,290 --> 00:08:03,050
Application Server live data in ChirpStack.
111

112
00:08:03,380 --> 00:08:06,980
My device will send a temperature every ten seconds.
112

113
00:08:07,010 --> 00:08:07,940
Let's go.
113

114
00:08:14,180 --> 00:08:14,860
Fine.
114

115
00:08:14,870 --> 00:08:16,340
Everything works well.
115

116
00:08:16,520 --> 00:08:19,730
I will let you try if you can send data to your end-device.
116

117
00:08:19,730 --> 00:08:23,510
So you will be sure that both uplink and downlink works.
117

118
00:08:23,540 --> 00:08:25,350
There should be no issues.
118

119
00:08:25,400 --> 00:08:30,140
Anyway, we'll do it when we'll explain the HTTP and MQTT integration.
119

120
00:08:31,130 --> 00:08:35,510
All right, so now let's give a try for the ABP activation mode.
120

121
00:08:35,750 --> 00:08:38,570
We'll have to create a new device profile.
121

122
00:08:41,910 --> 00:08:44,610
We call it profile-abp.
122

123
00:08:46,930 --> 00:08:55,810
And for the other field we are still in the European 868MHz band and my LoRaWAN version is still the 1.0.3.
123

124
00:08:56,260 --> 00:08:56,700
Okay.
124

125
00:08:56,710 --> 00:09:01,180
And now, in the second tab I will choose ABP instead of OTAA.
125

126
00:09:01,990 --> 00:09:08,860
Actually, when we say that our device doesn't support OTAA, then it switches automatically to ABP.
126

127
00:09:09,220 --> 00:09:16,390
You can see it as an understatement to remind you that if your end-device is able to use OTAA, then why
127

128
00:09:16,390 --> 00:09:17,530
do you want to use ABP?
128

129
00:09:17,890 --> 00:09:23,770
It's quite true that we've seen many reasons where OTAA is much better and easier to use than ABP.
129

130
00:09:24,400 --> 00:09:29,200
Anyway, if you have a good reason to use ABP then, let's do it this way.
130

131
00:09:29,560 --> 00:09:36,940
Now when we use ABP, then the Network Server will not share its parameters during the join accept response.
131

132
00:09:36,940 --> 00:09:39,700
So we need to provide it ourself.
132

133
00:09:40,000 --> 00:09:48,050
In my case my end-device has an RX1 delay of 1 second and then I write zero for x2.
133

134
00:09:48,470 --> 00:09:51,950
It doesn't use offset for RX1 data-rate.
134

135
00:09:51,950 --> 00:09:59,000
And finally the RX2 frequency is 869.525MHz.
135

136
00:09:59,360 --> 00:10:04,340
Of course you need to check these values and use the one used by your end-device.
136

137
00:10:04,850 --> 00:10:09,470
Once this profile is created, I register a new end-device.
137

138
00:10:09,470 --> 00:10:13,940
So I go in my application, click on add a device.
138

139
00:10:16,010 --> 00:10:17,930
I give it a name
139

140
00:10:17,930 --> 00:10:18,950
device1-abp,
140

141
00:10:22,180 --> 00:10:22,920
a devEUI,
141

142
00:10:22,930 --> 00:10:23,200
A devEUI.
142

143
00:10:28,750 --> 00:10:36,490
We submit the creation and in the tab called Activation, I will enter as usual, the device address,
143

144
00:10:36,580 --> 00:10:40,660
the network session key and the application session key.
144

145
00:10:41,470 --> 00:10:42,280
Great.
145

146
00:10:42,310 --> 00:10:45,010
We are done with the Network Server configuration.
146

147
00:10:45,040 --> 00:10:47,590
Now, back on my end-device.
147

148
00:10:48,190 --> 00:10:51,370
I need to copy the LoRaWAN keys and address in its firmware.
148

149
00:10:51,730 --> 00:10:58,030
So, I open my end-device configuration file and of course I enter the same device address.
149

150
00:10:59,680 --> 00:11:01,470
The same network session key.
150

151
00:11:03,300 --> 00:11:05,010
And the same application session key.
151

152
00:11:07,650 --> 00:11:13,560
On the left there is one window with my device logs, and on the right there is another window with
152

153
00:11:13,560 --> 00:11:15,750
my application server live data.
153

154
00:11:16,320 --> 00:11:19,590
My device will send the temperature every ten seconds.
154

155
00:11:19,620 --> 00:11:20,490
Let's go.
155

156
00:11:20,940 --> 00:11:27,390
We can see that in this demonstration there is no join procedure because we've used ABP activation mode.
156

157
00:11:27,630 --> 00:11:29,910
And the temperature data arrives directly.
157

158
00:11:30,300 --> 00:11:37,110
Okay, so what we must remember from this experience is that whatever the LoRaWAN server we use, even
158

159
00:11:37,110 --> 00:11:43,200
if the user interface is not the same as the one we've seen before, then all the parameters we've entered
159

160
00:11:43,230 --> 00:11:46,710
and all the Network Server management looks very similar.
160

161
00:11:46,920 --> 00:11:52,140
So at the end of the day, it's just a matter of looking for what you need in the right section.
161

162
00:11:52,140 --> 00:11:56,850
But there isn't a big difference when we stick with basic LoRaWAN functionalities.
162

163
00:11:56,940 --> 00:11:57,720
Great.
163

164
00:11:57,750 --> 00:12:03,120
Now that we have a functional LoRaWAN server, then we can have a look at how we can export this data
164

165
00:12:03,120 --> 00:12:05,760
to our Iot platform with ChirpStack.
165

166
00:12:05,910 --> 00:12:08,590
That's what we're going to do in the next video.
