[Debian 9]"database «loraserver» does not exist"

Hello everyone !

Sorry to disturb, but I have a little problem with LoRaServer installation.
I’m on a VM Debian 9, and I’m using the “Quick Install” instructions to see if I can use it with my LoRaWAN network (instructions available > here < )

The first steps didn’t take too much time, but my problem comes with the “Installing LoRa Server” part :

-> apt install loraserver OK
-> change values in /etc/default/loraserver OK
-> systemctl start loraserver OK
-> journalctl -u loraserver NOK

When I’m reading the logs, I have repeated messages saying "level=error msg=“ping database error, will retry in 2s: pq: “loraserver” database does not exist”

And I don’t get what I did wrong.
Can anyone help me ?

Thank you very much,
Etienne

Weel, as the error states, there’s no database called “loraserver”, so your DSN at /etc/default/loraerver is pointing to a DB named loraserver, but it doesn’t exist. If you were following the quick-install, you probably did this:

-- set up the users and the passwords (note that it is important to use single quotes and a semicolon at the end!)
create role loraserver_as with login password 'dbpassword';
create role loraserver_ns with login password 'dbpassword';

-- create the database for the servers
create database loraserver_as with owner loraserver_as;
create database loraserver_ns with owner loraserver_ns;

-- exit psql
\q

So, if you followed it strictly, the loraserver DB would be named loraserver_ns, not loraserver. You can check your existing databases in postgres by listing them:

Connect to postgres:

sudo -u postgres psql

List DBs:

\list

Thank you very much for your answer !

So, if I understand well, I just have to change the database name in /etc/default/loraserver in order to match the existing ?

Yep, you should modify your POSTGRES_DSN var to look like something like this:

POSTGRES_DSN=postgres://loraserver_user:loraserver_password@host:port/loraserver_ns?sslmode=disable

Dear sir or madam;

Thank you very much, it worked well, and I could finish the installation without problems.
I just have another question :
When trying to configure lora-gateway-bridge on my gateway (Multitech Mlinux model), an error is returned in lora-gateway-bridge.log

I set localhost:8001 in runGateway.sh, since it’s a test virtual machine my Gateway is directly connected to my computer, but I don’t know if it’s the right value.

Thank you very much,

Etienne

Hi, you set the mqtt-server option as “localhost:8001”, which is wrong in potentially 2 ways:

  1. The mqtt connection expects a protocol to be set, either tcp, ws or tls (ssl works the same), which localhost:8001 does not provide. So, for example, tcp://127.0.0.1:1883 (default value if mosquitto is running on the same machine as lora-gateway-bridge) would be a valid mqtt-server option.

  2. Mosquitto typically runs in port 1883, so unless you modified the defaults, 8001 is not the correct port.

Please check the docs on configurations for every module to see what is expected:

@etienneb you might be interested in the ipk packages that we offer specific for the Multitech Conduit: https://forum.loraserver.io/t/multitech-conduit-ipk-packages/554

This will be included in the documentation for the Conduit as soon as I’ve gathered enough (positive) feedback. It should make it easier to get started for you :slight_smile:

@iegomez Thank you very much, your advice was indeed useful. I was a little confused about this configuration, but it’s very clear now.

@brocaar Thank you very much ! I have never seen these packages, but I am going to test them right now ! I will give you another feedback after having finished the configuration.
I just had another question, can LoRa Server only be used with its GUI, or is there a way to use it in command lines ?

Let’s not dive into this topic here, but all components expose APIs. See https://docs.loraserver.io/loraserver/integrate/api/ and https://docs.loraserver.io/lora-app-server/integrate/rest/.