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