Once again, I'm going to use the same diagram that we saw earlier. 1
For now, I will focus on the Uplink stream. 2
In this figure, the client, so the LoRaWAN server generates a HTTP POST request to the server, 3
(so our IoT platform.) The particularity of this request is that they don't really request something, 4
but instead they carry the message they want to provide. 5
The response from the server is a simple acknowledgement to let the client know that everything went 6
well. 7
Great. 8
So now we need to set up the client and the server. 9
Let's start with the server. 10
What I need to set up is a server able to handle HTTP POST requests. 11
There are many possibilities in order to have a functional HTTP server, but we have chosen one already 12
available on the internet so you have nothing to install. 13
This utility will play the role of an HTTP server and will show us the content of the HTTP POST request 14
that has been received. 15
I advise to use the online rbaskets.in endpoint, 16
but if you're not happy with the online version, then you can install it on your own 17
server using docker. 18
All the documentation is available on their Docker Hub web page. 19
If for some reasons rbasket is offline, then there are other ones like beeceptor.com and they work pretty 20
much in the same way. 21
So, to start we need to create a end point. 22
It's what they call a basket. 23
It's just the URL of an instance of the HTTP server to which will send the request. 24
So we create it. 25
The one proposed suits me, so I just need to click on "create" as the server is on the public network 26
and there wasn't any registration or authentication before creating this end point. 27
Then a token is provided. 28
This token is here to prove that it belongs to me in case I want to retrieve this endpoint later. 29
In my case, I won't use it because I've created this basket just for this demo. 30
So I close this window and I go to my endpoint web interface. 31
Excellent. 32
Our HTTP server is ready to receive requests. 33
Let's try it. 34
So what do you think the LoRaWAN server should send? 35
It will send an HTTP POST request within the body section, 36
all the useful information of the message. 37
Actually, a bit more information because there will be the overall JSON text message. 38
Exactly 39
the one we received with the GET method. 40
Now I need to configure the LoRaWAN server, so it will send this HTTP POST request before going on the 41
LoRaWAN server. 42
I need to save the endpoint address of where I need to send the request. 43
There. 44
I copy it. 45
So now let's go on TTN. 46
I need to go on my application and once again, exporting data is possible thanks to what we call integrations. 47
I used the storage integration earlier, but this time I'm going to use a Webhook. 48
I had a new one, 49
and I end up with a choice of many predefined webhook. 50
They are here to connect TTN to a specific IoT platform just in one click. 51
Some are free but limited, and for some others there is a registration fees. 52
We'll try those later, for the moment, 53
I've got my specific HTTP endpoint that I created. 54
So I choose "custom webhhook". 55
The configuration is very easy. 56
First, we can give it a name. 57
Let's say webhook-http. 58
Then we'll use the JSON format, 59
and then we specify the HTTP URL. 60
That's the one we've created in rbasket. 61
This one: https://rbaskets.in/92ru9ec. 62
And I choose the type of event that will launch the request. 63
In my case, I choose only the uplink message. 64
But you can ask for more even if you want. 65
Let's try it now. 66
I've got one window representing my device on the left, and on the right, 67
it's my HTTP server. 68
My enddevice is going to send the string: 69
"Hello." 70
Every time I press the push button. 71
So let's go. 72
I press the push button. 73
And then, here, I can see the POST request on my server. 74
I just stop the auto update to see what's in there. 75
I can see that I've got the same information we saw earlier. 76
The most important section is again, the Frame Payload. 77
So the message sent by my device. Here it's the string hello presenting it base 64. 78
And you can use your favorite base 64 decoder to check. 79
We've done it already in the previous video. 80
Great. 81
That's excellent. 82
We're now able to export our data to an external IoT platform. 83
For now, we are done with the uplink. So we can do exactly the same thing with downlink. 84
We're going to do that in the next video.