Beginner needs advice - Packet Forwarder Wirnet Station


#1

Hi,

I’m new to IoT and I could need some advice.

So I have the honor to setup a LoRa system and just to make everything clear I write down the components I will use:

  • Kerlink Wirnet Station as the Gateway
  • GlobalSat LS-111P CO2/Temperature/Humidity Detector which is LoRaWAN certified
  • Elsys ERS-sound also LoRaWAN certified
  • tabs movement detector also LoRaWAN certified

At the end of the day I need the complete System, just like the Architecture shows on the website. The Gateway sending information from the devices to our own server. No cloud.

As far as I can tell loraserver.io does exactly that. Since I’m new to IoT, the guides are hard to understand for me.

So I would like to know where to start?

I started reading about MQTT Protocoll and the mosquitto broker. Looks like a few hundred pages maybe. Am I going the right way? Do I need to know that much about MQTT and mosquitto? Because for the server there is much more needed than just mosquitto. I don’t only want to set it up and that’s it. I’d like to understand what I’m doing.

So any advice on what steps to take, what to read or watch, what to try or not, would be such a big help for me.

If possible I would do all these on a Windows machine. If not, on Ubuntu.

Thanks for any help in advance!


#2

Hi Hakan

I am also kind new on IoT and had the same situation a few monts ago.
First of all, it is a interessting topic and its worth it :slight_smile:

Now your question: loraserver does (as far as i know) not run on windows. the other products, like redis, postgres and mqtt (mosquitto) can run on windows machines - even if i would not do that.

then your next question about mqtt and mosquitto. generally you dont need to know much about mosquitto and the system will run - but i would recomand some resarching at least about QoS, authentication and how the system generally works. But as i said, you can also just start the mosquitto broker and loraserver.io will run.

Maybe just a last point how i did it. i used a SLES machine and put all the stuff on the same machine (Lora-Gateway Bridge, Loraserver, LoraAppserver, Mosquitto, Redis and Postgres). as everything was up and running (which is not that complicated) i started to look at every thing seperatly. so i started building a postgreSQL Cluster on own machines, Build a Redis Sentinel “Cluster” on own machines, changed mosquito to a verneMQ Cluster. On the Lora-Side i changed the Gateway Brige to run on the gateway. then i changed the loraserver and lora-app-server to run in docker container.

after every step you can proof if the system still works - and you can learn a lot during this procces.

if there are any more specific questions, just let me know. maybe i can help (even if i am not an expert)

regars,
Sil


#3

So far I managed to set it up and have access to localhost:8080. Couldnt set up the devices yet, since Im waiting for someone else. I still have some questions and hope someone can help me.

Is there a guide for the lora-app-server, so I can learn how the webinterface works?

My next step is to install all these on Ubuntu Server with no GUI and access to the webinterface from another pc from local and also from web. The installation process will be possible since its only Terminal, but what comes after? Any advice would be great!

Have a great day!


#4

Hi Hakan

I would say the best guide is the one you allready found on loraserver.io
https://www.loraserver.io/lora-app-server/overview/

If you have everything up and running, i would try to create a gateway in the app-server (you need a gateway-profile). after this, try to make a application and then register a device (you need a device-profile).

after step one (if everythings is configured correct (also on your gateway) you should see your gateway online (Gateways --> Select your Gateway --> Gateway Details --> Last seen).
after the step with registering the device, you should see data from your device. first you should see join requests, join accepts and later data framges (under your gateway in the register “Live Lorawan Frames”

sil,


#5

Im on it right now. The device setup could be a problem since my partner wont be here today and I kinda have to wait for him. But I try to prepare everything until then. So I may get back ask for more advice or share the results.

Thank you!


Edit: Heres my question :smiley:

Im editing the config file of the app-server and the

jwt_secret=“verysecret”

is something I wonder if I need it right now? Actually in my config the brackets are empty. Can it stay empty? And what exactly is that for? Im someone who only understands easy description. Imagine Im a kid. :smiley:

Thank you!


Edit 2: Back to reading. This seems to help a little understanding json and jwt. :slight_smile:


#6

Hi Hakan

The jwt_secred is for authentication and authorization of the REST API and the gRPC Interface. Personally i only have experiences with the REST API.
Also here i recommend the documentation: https://www.loraserver.io/lora-app-server/integrate/auth/

with the command openssl rand -base64 32 you can generate a secret - put this in the configfile.
then go to the website (for example) https://jwt.io/

Put your informations there (in the decoded part)

for example (out of the documentation --> this goes to payload section): - you need to edit this for your environment

{
“iss”: “lora-app-server”, // issuer of the claim
“aud”: “lora-app-server”, // audience for which the claim is intended
“nbf”: 1489566958, // unix time from which the token is valid
“exp”: 1489653358, // unix time when the token expires
“sub”: “user”, // subject of the claim (an user)
“username”: “admin” // username the client claims to be
}
put in the secrete you generated in the part “VERIFY SIGNATURE”. after that you get a encoded token. with this token you can use the WEB API (https://servername:8080/api). put the encoded token on the header field jwt token.

you can also use curl with this secret, for example:

curl -X GET --header ‘Accept: application/json’ --header ‘Grpc-Metadata-Authorization: Bearer [Your encoded JWT Token here’ ‘https://servername:8080/api/applications

–> this lists the number of applications you have configured.

hopefully i could explain it clearly, sorry - my english is not the best.

p.s GRPC uses the same authentication method - if you plan to use this.

have fun,
sil


#7

Do I have to enter the exact information into nbf and exp? Since I dont know them…
Do I have to check the secret base64 encoded? Maybe I do understand it wrong but I used the base64 command you also wrote down.

Share JWT sounds like making it public, but thats what I have to click after all right? Will this be available for everyone?

Hope I dont bother asking. Thanks for everything!


#8

As the Name says nbf (not before) and exp (expires) date says from when until when the token is valid
you can say (for expamle) its valid from yesterday at 12 until in five years - or whatever you want. so in this case the token can be used since yesterday to in 5 years. after this five years, the token will be invalid.

use https://www.epochconverter.com/ to convert “human time” to unixtime.

you dont need to share the JWT (i would not do this). Just put everything in the right part of the website (payload and verify) and then copy the left part (encoded) and use this for WEB API or Curl commands.

Example:

Secret: 1HLOjboVSxeKBewmSk175PhjBFWQIJvvgiGqgPVJ1M8=

Payload:

{
“iss”: “lora-app-server”,
“aud”: “lora-app-server”,
“nbf”: 1508748150,
“exp”: 1600000000,
“sub”: “admin”,
“username”: “admin”
}

This gives the encoded token on the left:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJsb3JhLWFwcC1zZXJ2ZXIiLCJhdWQiOiJsb3JhLWFwcC1zZXJ2ZXIiLCJuYmYiOjE1MDg3NDgxNTAsImV4cCI6MTYwMDAwMDAwMCwic3ViIjoiYWRtaW4iLCJ1c2VybmFtZSI6ImFkbWluIn0.8TpS88smF1qqFkKJaewxiDV9OmizhFKC3Q3y4x6ZwIM

use this encoded token for your WEB API or Curl


#9

That makes sense. Didnt know I could set the expire date the way I want.

Thank you so much for your help!

Tomorrow Ill get the chance to play with the gateway and the 3 devices. Ill let you all know if we did suceed or did suceed, :smiley:

Have a great day.


#10

You can also have lora-app-server issue a token for you by using the /api/internal/login endpoint with a POST request and parameteres username and password. Internally, lora-app-server will use the JWT secret in its configuration file to generate and sign a token, and will later validate your requests with it.


#11

So I have access to the gateway via putty now and Im trying to follow the guide. It says create the folder and download the armv5 file. Whenever I try to download it gives me following error:

wget: error getting response: Connection reset by peer.


My steps to this error:

  1. SSH into gateway via port 22
  2. create and move into /mnt/fsuser-1/lora-gateway-bridge/bin
  3. wget the direct link to the file https://artifacts.loraserver.io/downloads/lora-gateway-bridge/lora-gateway-bridge_2.7.1_linux_armv5.tar.gz
  4. error

Any help would be great. Thanks!


Managed to move the files needed for the gateway. But I have a question now:

The guide says to skip the step of installing bridge if you want to install it on the gateway. So I did this gateway settings but I dont have any packet-forwarder. Do I also have to install bridge on the mosquitto broker?


#12

I dont understand how to install the packet forwarder. The guide says how to install the gateway bridge on the gateway itself, but theres no guide on how to install the packet forwarder. I dont know how to keep on and could need some help.

Im trying to install the gateway bridge on the gateway itself, not on the server.


#13

Please see the Kerlink wiki on how to install the packet-forwarder on the gateway: http://wikikerlink.fr/. There you’ll find both instructions and the packet-forwarder binaries :slight_smile: You might need to request access if you don’t have an account there. You’ll need to contact the Kerlink support for that.


#14

Thank you for your reply. I was actually there but it says I need

The following files:

custo libloragw file
dota packet forwarder.
produsb zip file

I dont know what prdusb file is, or where to get it from. The others I could download though.


#15

It would be best to contact the Kerlink support with your questions regarding the packet-forwarder setup :slight_smile:


#16

I managed to install the gateway and already received a signal from the ERS sound sensor. I could see it in the server web interface. Didnt get more far than this. But somehow the sensor didnt send anymore, or lets say, just randomly, through the day it sent 5 signals. The sensor ist set up to send every 600 seconds. I guess I have to change something else? The thing is, I only set up the device in the web interface of the server. I didnt tell the servers or the gateway that this device wants to send more signals. So Im like confused, on where to set this so it does work every 600 seconds.

Thanks for any help. This is such a great project for me and I learn so much.

Have a great day! :slight_smile: