Installation of the LoRaServer on Raspberry pi 3 B


#1

Hi guys,
Firstly, I will like to thank you for the LoRaServer initiative.
I will like to install the LoRaServer on a Raspberry PI 3 B. The installation instruction are somehow hard for me to understand. For what I know, it specifies Ubuntu as the operating system on which it should be installed and I know Ubuntu is basically Linux just like Raspberry Pi.
My main question is: Assuming it is possible to install it on RPI, are the installation steps similar to that of Ubuntu? Are they some additional requirement for RPIs?


#2

If you follow the quick install guide that should work for RaspberryPi3 or at the very least it worked for me when I tested it a couple months ago. The only thing that I can remember to be aware of is when you are setting up the key for the new repository that you add. Unless it’s been updated that step will probably give you an error because it’s dependent on “dirmngr” and it’s not installed by default with Raspbian now.
See here: [https://www.raspberrypi.org/forums/viewtopic.php?t=193536]

You will need to just simply install dirmngr by using sudo apt-get install dirmngr. Besides that I don’t remember there being any other issues other than my own self induced errors. Good luck with your install.


#3

Thanks a lot for your prompt and descriptive reply. I will keep you posted, should any issue come up during the installation process.


#4

You might also be interested in https://github.com/brocaar/loraserver-pi-gen, which you can use to generate a Raspberry Pi image with LoRa Server pre-installed.


#5

Thanks for your reply, but in another post, you pointed out that the image was not to be run on the RPI. I am a bit confused.
I tried installing the server the way described in the quick install guide but the Lora app server won’t connect to the database.


#6

So if I understand it right, with the Lora server-pi-gen I will have to boot my RPI with it such as I would do with the raspian os software when starting?


#7

Please one more issue. A failure occurs when i try to start the application server as you can see in the log file bellow---------------------------------------------------og-------------------------------------------------------------------------
pi@raspberrypi:~ $ journalctl -u lora-app-server -f
– Logs begin at Thu 2016-11-03 18:16:43 CET. –
May 29 13:46:36 raspberrypi lora-app-server[5082]: time=“2018-05-29T13:46:36+02:00” level=info msg=“starting application-server api” bind=“0.0.0.0:8001” ca-cert= tls-cert= tls-key=
May 29 13:46:36 raspberrypi systemd[1]: lora-app-server.service: Main process exited, code=exited, status=1/FAILURE
May 29 13:46:36 raspberrypi systemd[1]: lora-app-server.service: Unit entered failed state.
May 29 13:46:36 raspberrypi systemd[1]: lora-app-server.service: Failed with result ‘exit-code’.
May 29 13:46:36 raspberrypi systemd[1]: lora-app-server.service: Service hold-off time over, scheduling restart.
May 29 13:46:36 raspberrypi systemd[1]: Stopped LoRa App Server.
May 29 13:46:36 raspberrypi systemd[1]: lora-app-server.service: Start request repeated too quickly.
May 29 13:46:36 raspberrypi systemd[1]: Failed to start LoRa App Server.
May 29 13:46:36 raspberrypi systemd[1]: lora-app-server.service: Unit entered failed state.
May 29 13:46:36 raspberrypi systemd[1]: lora-app-server.service: Failed with result ‘exit-code’.
----------------------------------------------------end log-----------------------------------------------------------------


#8

After a while this errors show up

---------------------------------------------------------------log-------------------------------------------------------------------------May 29 14:01:07 raspberrypi lora-app-server[5581]: time=“2018-05-29T14:01:07+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “loraserver_as””
May 29 14:01:09 raspberrypi lora-app-server[5581]: time=“2018-05-29T14:01:09+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “loraserver_as””
May 29 14:01:11 raspberrypi lora-app-server[5581]: time=“2018-05-29T14:01:11+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “loraserver_as””
May 29 14:01:13 raspberrypi lora-app-server[5581]: time=“2018-05-29T14:01:13+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “loraserver_as””
May 29 14:01:15 raspberrypi lora-app-server[5581]: time=“2018-05-29T14:01:15+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “loraserver_as””
May 29 14:01:17 raspberrypi lora-app-server[5581]: time=“2018-05-29T14:01:17+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “loraserver_as””
May 29 14:01:20 raspberrypi lora-app-server[5581]: time=“2018-05-29T14:01:20+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “loraserver_as””
May 29 14:01:22 raspberrypi lora-app-server[5581]: time=“2018-05-29T14:01:22+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “loraserver_as””
May 29 14:01:24 raspberrypi lora-app-server[5581]: time=“2018-05-29T14:01:24+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “loraserver_as””
May 29 14:01:26 raspberrypi lora-app-server[5581]: time=“2018-05-29T14:01:26+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “loraserver_as””
May 29 14:01:28 raspberrypi lora-app-server[5581]: time=“2018-05-29T14:01:28+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “loraserver_as””
May 29 14:01:30 raspberrypi lora-app-server[5581]: time=“2018-05-29T14:01:30+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “loraserver_as””
May 29 14:01:32 raspberrypi lora-app-server[5581]: time=“2018-05-29T14:01:32+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “loraserver_as””
May 29 14:01:34 raspberrypi lora-app-server[5581]: time=“2018-05-29T14:01:34+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “loraserver_as””
May 29 14:01:36 raspberrypi lora-app-server[5581]: time=“2018-05-29T14:01:36+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “loraserver_as””
May 29 14:01:38 raspberrypi lora-app-server[5581]: time=“2018-05-29T14:01:38+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “loraserver_as””
May 29 14:01:40 raspberrypi lora-app-server[5581]: time=“2018-05-29T14:01:40+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “loraserver_as””
May 29 14:01:42 raspberrypi lora-app-server[5581]: time=“2018-05-29T14:01:42+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “loraserver_as””
May 29 14:01:44 raspberrypi lora-app-server[5581]: time=“2018-05-29T14:01:44+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “loraserver_as””
May 29 14:01:46 raspberrypi lora-app-server[5581]: time=“2018-05-29T14:01:46+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “loraserver_as””
May 29 14:01:48 raspberrypi lora-app-server[5581]: time=“2018-05-29T14:01:48+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “loraserver_as””
May 29 14:01:50 raspberrypi lora-app-server[5581]: time=“2018-05-29T14:01:50+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “loraserver_as””
May 29 14:01:52 raspberrypi lora-app-server[5581]: time=“2018-05-29T14:01:52+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “loraserver_as””
May 29 14:01:54 raspberrypi lora-app-server[5581]: time=“2018-05-29T14:01:54+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “loraserver_as””
------------------------------------------------------------end log-------------------------------------------------------------


#9

You should not run the loraserver-pi-gen script on the Raspberry Pi, however it does generate a Raspberry Pi Image.

Regarding your above error I think the error is self describing:

password authentication failed for user “loraserver_as

You will find other topics covering this issue: https://forum.loraserver.io/search?q=pq%20password%20authentication%20failed


#10

Thanks for your reply.


#11

Thanks for your support. The server an all other server component start very well, I receive packages from my end-devices as well, But I somehow can’t access server web-interface API. I followed the instructions in the quick install section of your tutorial. I am using the Ip, and the port from the application_server.external_api.bind which is 0.0.0.0:8080 (e.g., 0.0.0.0:8080) and I am running this on the same host. The browser replies with “This site can’t be reached.”


#12

Can you check by using:
netstat -plnt
in a terminal that your Loraserver pieces are all running? If it is you should see it on that list. If not can you check the status of your lora-app-server by using:
sudo systemctl status lora-app-server


#13

the command sudo systemctl status lora-app-server returned the following:
--------------------------------------------------------------------------------------------------------------------------------------------● lora-app-server.service - LoRa App Server
Loaded: loaded (/lib/systemd/system/lora-app-server.service; enabled; vendor
Active: active (running) since Tue 2018-05-29 16:14:45 CEST; 2h 43min ago
Docs: https://docs.loraserver.io
Main PID: 11408 (lora-app-server)
CGroup: /system.slice/lora-app-server.service
└─11408 /usr/bin/lora-app-server

May 29 18:58:04 raspberrypi lora-app-server[11408]: time="2018-05-29T18:58:04+02
May 29 18:58:06 raspberrypi lora-app-server[11408]: time="2018-05-29T18:58:06+02
May 29 18:58:08 raspberrypi lora-app-server[11408]: time="2018-05-29T18:58:08+02
May 29 18:58:10 raspberrypi lora-app-server[11408]: time="2018-05-29T18:58:10+02
May 29 18:58:12 raspberrypi lora-app-server[11408]: time="2018-05-29T18:58:12+02
May 29 18:58:14 raspberrypi lora-app-server[11408]: time="2018-05-29T18:58:14+02
May 29 18:58:16 raspberrypi lora-app-server[11408]: time="2018-05-29T18:58:16+02
May 29 18:58:18 raspberrypi lora-app-server[11408]: time="2018-05-29T18:58:18+02
May 29 18:58:20 raspberrypi lora-app-server[11408]: time="2018-05-29T18:58:20+02
May 29 18:58:22 raspberrypi lora-app-server[11408]: time="2018-05-29T18:58:22+02
lines 1-18/18 (END)…skipping…
● lora-app-server.service - LoRa App Server
Loaded: loaded (/lib/systemd/system/lora-app-server.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2018-05-29 16:14:45 CEST; 2h 43min ago
Docs: https://docs.loraserver.io
Main PID: 11408 (lora-app-server)
CGroup: /system.slice/lora-app-server.service
└─11408 /usr/bin/lora-app-server

May 29 18:58:04 raspberrypi lora-app-server[11408]: time=“2018-05-29T18:58:04+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “appserver””
May 29 18:58:06 raspberrypi lora-app-server[11408]: time=“2018-05-29T18:58:06+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “appserver””
May 29 18:58:08 raspberrypi lora-app-server[11408]: time=“2018-05-29T18:58:08+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “appserver””
May 29 18:58:10 raspberrypi lora-app-server[11408]: time=“2018-05-29T18:58:10+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “appserver””
May 29 18:58:12 raspberrypi lora-app-server[11408]: time=“2018-05-29T18:58:12+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “appserver””
May 29 18:58:14 raspberrypi lora-app-server[11408]: time=“2018-05-29T18:58:14+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “appserver””
May 29 18:58:16 raspberrypi lora-app-server[11408]: time=“2018-05-29T18:58:16+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “appserver””
May 29 18:58:18 raspberrypi lora-app-server[11408]: time=“2018-05-29T18:58:18+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “appserver””
May 29 18:58:20 raspberrypi lora-app-server[11408]: time=“2018-05-29T18:58:20+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “appserver””
May 29 18:58:22 raspberrypi lora-app-server[11408]: time=“2018-05-29T18:58:22+02:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “appserver””


#14

It is still pointing at the password authenication failure.


#15

Ok, did you confirm (like @brocaar suggested) in your lora-server-app.toml file that the password you input on the line

postgresql.dsn postgres://loraserver_as:dbpassword@localhost/loraserver_as?sslmode=disable

Is in fact the password you used when you created your loraserver_as user in postgresql? And just to double check when you do that or you did that, if something was wrong did you stop and then restart the lora-app-server after you saved the .toml file? I just ask because it has been a habit of mine to make sure I stop the services from running before I do any update on their files. Just to make sure that I’m not keeping an issue from being fixed because the service isn’t using the updated information.


#16

I did all that , thanks for making sure though. When I start the application server ,I get the logs bellow. My question is : is that a valid start of the service?


– Logs begin at Tue 2018-05-29 06:12:31 CEST, end at Tue 2018-05-29 19:41:29 CEST. –
May 29 06:12:51 raspberrypi systemd[1]: Started LoRa App Server.
May 29 06:12:54 raspberrypi lora-app-server[595]: time=“2018-05-29T06:12:54+02:00” level=info msg=“starting LoRa App Server” docs=“https://www.loraserver.io/” version=1.0.0
May 29 06:12:54 raspberrypi lora-app-server[595]: time=“2018-05-29T06:12:54+02:00” level=info msg=“connecting to postgresql”
May 29 06:12:54 raspberrypi lora-app-server[595]: time=“2018-05-29T06:12:54+02:00” level=info msg=“setup redis connection pool”
May 29 06:12:54 raspberrypi lora-app-server[595]: time=“2018-05-29T06:12:54+02:00” level=info msg=“handler/mqtt: TLS config is empty”
May 29 06:12:54 raspberrypi lora-app-server[595]: time=“2018-05-29T06:12:54+02:00” level=info msg=“handler/mqtt: connecting to mqtt broker” server=“tcp://localhost:1883”
May 29 06:12:54 raspberrypi lora-app-server[595]: time=“2018-05-29T06:12:54+02:00” level=info msg=“applying database migrations”
May 29 06:12:54 raspberrypi lora-app-server[595]: time=“2018-05-29T06:12:54+02:00” level=info msg=“handler/mqtt: connected to mqtt broker”
May 29 06:12:54 raspberrypi lora-app-server[595]: time=“2018-05-29T06:12:54+02:00” level=info msg=“handler/mqtt: subscribing to tx topic” qos=0 topic=application/+/device/+/tx
May 29 06:12:54 raspberrypi lora-app-server[595]: time=“2018-05-29T06:12:54+02:00” level=info msg=“migrations applied” count=0
May 29 06:12:54 raspberrypi lora-app-server[595]: time=“2018-05-29T06:12:54+02:00” level=info msg=“starting application-server api” bind=“0.0.0.0:8001” ca-cert= tls-cert= tls-key=
May 29 06:12:54 raspberrypi systemd[1]: lora-app-server.service: Main process exited, code=exited, status=1/FAILURE
May 29 06:12:54 raspberrypi systemd[1]: lora-app-server.service: Unit entered failed state.
May 29 06:12:54 raspberrypi systemd[1]: lora-app-server.service: Failed with result ‘exit-code’.
May 29 06:12:54 raspberrypi systemd[1]: lora-app-server.service: Service hold-off time over, scheduling restart.
May 29 06:12:54 raspberrypi systemd[1]: Stopped LoRa App Server.
May 29 06:12:54 raspberrypi systemd[1]: Started LoRa App Server.


#17

That part most certainly isn’t a valid start. But it somehow then restarts apparently, but you don’t see any further information like I would expect. I unfortunately don’t have my RaspberryPi Server set up in front of me, but it seems like it’s running but exited which is an issue I briefly saw during my install process when I was working through some errors. If I have a chance this evening I’ll have to look at my log files.


#18

Thank you very much, that would be great.


#19

After stoping the all services then saving the files with the password was to be specified, this is what the returns

May 29 06:12:54 raspberrypi systemd[1]: lora-app-server.service: Main process exited, code=exited, status=1/FAILURE
May 29 06:12:54 raspberrypi systemd[1]: lora-app-server.service: Unit entered failed state.
May 29 06:12:54 raspberrypi systemd[1]: lora-app-server.service: Failed with result ‘exit-code’.
May 29 06:12:54 raspberrypi systemd[1]: lora-app-server.service: Service hold-off time over, scheduling restart.
May 29 06:12:54 raspberrypi systemd[1]: Stopped LoRa App Server.
May 29 06:12:54 raspberrypi systemd[1]: Started LoRa App Server.
May 29 06:12:55 raspberrypi lora-app-server[699]: time=“2018-05-29T06:12:55+02:00” level=info msg=“starting LoRa App Server” docs=“https://www.loraserver.io/” version=1.0.0
May 29 06:12:55 raspberrypi lora-app-server[699]: time=“2018-05-29T06:12:55+02:00” level=info msg=“connecting to postgresql”
May 29 06:12:55 raspberrypi lora-app-server[699]: time=“2018-05-29T06:12:55+02:00” level=info msg=“setup redis connection pool”
May 29 06:12:55 raspberrypi lora-app-server[699]: time=“2018-05-29T06:12:55+02:00” level=info msg=“handler/mqtt: TLS config is empty”
May 29 06:12:55 raspberrypi lora-app-server[699]: time=“2018-05-29T06:12:55+02:00” level=info msg=“handler/mqtt: connecting to mqtt broker” server=“tcp://localhost:1883”
lines 1-23


#20

I see that in the v1.0.0 LoRa App Server install script for .deb the tls_key and tls_cert aren’t automatically set anymore. Please check if this is your issue. I’ll issue a minor release which will set these fields automatically again :slight_smile:

Either you set them manually (the apt install … showed you the path of the self-signed certificate), or you install v1.0.1 (will be out in ~30m min). Please note that you have to remove the lora-app-server.toml config file, else it won’t be re-generated:

rm /etc/lora-app-server/lora-app-server.toml