[SOLVED]Debugging database and mosquitto connection issues

Hello everyone and feeling really happy joined your community.

I read and follow the instructions using LoRA Server documentation directory step -by-step and tried to install the components in order to emulate api in browser (using localhost), in scope to connect with some devices.

After the installation of lora server,server-api,postgres,redis and mosquitto i run the lora-server and lora-server api.

In conf files i just changed the usernames and passwords (but i maintained host’s IP etc).

After, i tried connect to https://localhost:8080 but i took the message “unable to connect”.

Using journactl in lora-app-server, as i saw in other (related) post i get: level=error, msg=ping database error…, pq:password authentication failed.

Using journactl in loraserver, i also get: level=error, msg=backend/gateway:connecting to mqtt broker failed database error…, Error: dial tcp : getsockopt: connection refused.

Is something wrong with mosquitto or postgres by my side? do i need to make a re-installation?

Thanks in advance.

Regarding DB connection

To verify if the user and database have been setup correctly, try to connect to it:
psql -h localhost -U loraserver_ns -W loraserver_ns

Is above mentioned step working for you?

Regarding MQTT,
Are you executing mosquito in background ?

Thanks for the reply Jith.

As i mentioned before, i believe that the installation of lora server, lora-app server and mosqutto installation is ok.
Also, using the command for connection to the database i get the result, in below picture:

And after i hit the url in Firefox, i got again “unable to connect”.

I should have taken the demand of username and password for log into the app, right?

Except i made something wrong during the configuration.

Thanks again in advance Jith.

The LoRa App Server logs would be the first place to start debugging your issue. Confirm that it actually started and is listening on port 8080.

set -a
source /etc/default/lora-app-server

This will actually gives u log of lora-app-server.

Check which version of postgresql you have installed. It should be 9.5+. I had the same issue where version of postgresql was the issue. :grinning:

Hello again!

I finally achieved to install the server.

Next step, in next days, will be to make the communication between hardware and server.

Thanks again for the support!

1 Like

Hi sharmila,

I have the same issue,
When I check the status for the loraserver, lora-app-server, and lora-gateway-bridge, they all show active (running). However, I still can’t connect to the localhost 8080 (unable to connect).
I have tried to confirm that it is actually started as you suggested but it seems that there is no lora-app-server in (/etc/default/llora-app-server)???

Could anyone please help??