Could you share some relevant code, logs, etc.? And what’s exactly the issue you are facing?
Sorry, I was referring to this piece that you had mentioned. Also I apologize, I was in a rush with other stuff last night.
I was following through the Quick Install Guide and have installed Mosquitto and set the passwords for the four users (loraroot, loragw, loraserver, and loraappserver). My local.conf just has the two lines:
I then installed Postgresql, and set up the two users and databases loraserver_as and loraserver_ns, followed by adding the extension pg_trgm to the loraserver_as database.
I then went about installing the Lora Gateway Bridge and the Lora Server. For the Gateway Bridge is my udp.bind is set to 0.0.0.0:1700, and the mqtt.username is set to loragw and the mqtt.password is set to the corresponding password that I set for that user earlier. For the Lora Server my band is set to the US_902_928, the postgresql.dsn is set to postgres://loraserver_ns:dbpassword@localhost/loraserver_ns?sslmode=disable where dbpassword is the same as the one I set up for the database for loraserver_ns. My postgresql.automigrate is set to true, mqtt.username is set to loraserver and the mqtt.password is the one I setup for that user. Everything else is set as it was mentioned in the quick install guide, and when I did sudo systemctl start loraserver and journalctl -u loraserver the first time it seemed to be ok, I received an error message at first but I just went with the fact that it was the one indicating the Lora App Server was not running.
I then went on to install the Lora App Server and set the following in the lora-app-server.toml file.
After setting up that file I started the lora app server and stopped for the evening. Coming back the next day, I did a restart on everything just to check to see if it would reset itself easily. When I checked the journals for the loraserver and lora-app-server that is when I first started noticing the issue that you had mentioned and that I have copied above.
Lastly I checked the status of each of the services, and mosquitto and postgresql are labeled as active (exited) while loraserver, lora-app-server and lora-gateway-bridge are listed as active(running). I don’t know if that is of any help.
Here exactly are the outputs of the status.
root@raspberrypi:/home/pi# sudo systemctl status loraserver
● loraserver.service - LoRa Server
Loaded: loaded (/lib/systemd/system/loraserver.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2018-04-08 12:56:17 EDT; 9min ago
Main PID: 1397 (loraserver)
Apr 08 13:05:16 raspberrypi loraserver: time=“2018-04-08T13:05:16-04:00” level=error msg=“ping database error, will retry in 2s: dial tcp [::1]:5432: connect: connection refused”
root@raspberrypi:/home/pi# sudo systemctl status lora-app-server
● lora-app-server.service - LoRa App Server
Loaded: loaded (/lib/systemd/system/lora-app-server.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2018-04-08 12:56:37 EDT; 17min ago
Main PID: 1414 (lora-app-server)
Apr 08 13:13:55 raspberrypi lora-app-server: time=“2018-04-08T13:13:55-04:00” level=error msg=“ping database error, will retry in 2s: dial tcp [::1]:5432: connect: connection refused”
@raspberrypi:/home/pi# sudo systemctl status lora-gateway-bridge
● lora-gateway-bridge.service - LoRa Gateway Bridge
Loaded: loaded (/lib/systemd/system/lora-gateway-bridge.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2018-04-08 12:56:53 EDT; 17min ago
Main PID: 1431 (lora-gateway-br)
Apr 08 13:14:42 raspberrypi lora-gateway-bridge: time=“2018-04-08T13:14:42-04:00” level=error msg=“could not setup mqtt backend, retry in 2 seconds: Network Error : dial tcp 127.0.0.1:1883: getsockopt: connection refused”
Apr 08 13:14:44 raspberrypi lora-gateway-bridge: time=“2018-04-08T13:14:44-04:00” level=info msg=“backend: TLS config is empty”
Apr 08 13:14:44 raspberrypi lora-gateway-bridge: time=“2018-04-08T13:14:44-04:00” level=info msg=“backend: connecting to mqtt broker” server=“tcp://127.0.0.1:1883”
root@raspberrypi:/home/pi# sudo systemctl status postgresql
● postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
Active: active (exited) since Sat 2018-04-07 21:55:49 EDT; 15h ago
Process: 499 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 499 (code=exited, status=0/SUCCESS)
Apr 07 21:55:37 raspberrypi systemd: Starting PostgreSQL RDBMS…
Apr 07 21:55:49 raspberrypi systemd: Started PostgreSQL RDBMS.
root@raspberrypi:/home/pi# sudo systemctl status mosquitto
● mosquitto.service - LSB: mosquitto MQTT v3.1 message broker
Loaded: loaded (/etc/init.d/mosquitto; generated; vendor preset: enabled)
Active: active (exited) since Sun 2018-04-08 13:04:08 EDT; 13min ago
Process: 1505 ExecStop=/etc/init.d/mosquitto stop (code=exited, status=0/SUCCESS)
Process: 1512 ExecStart=/etc/init.d/mosquitto start (code=exited, status=0/SUCCESS)
Apr 08 13:04:08 raspberrypi systemd: Starting LSB: mosquitto MQTT v3.1 message broker…
Apr 08 13:04:08 raspberrypi mosquitto: Starting network daemon:: mosquitto.
Apr 08 13:04:08 raspberrypi systemd: Started LSB: mosquitto MQTT v3.1 message broker.
The errors suggest that Postgres isn’t running or the connection DSNs are wrong.
That was probably from me screwing around with the .toml file last night. I’ll need to double check it.
Ok rechecked my files, and restarted everything. Now the error message seems to point to mosquitto.
Here’s what I’m seeing now.
Apr 08 19:09:37 raspberrypi lora-app-server: time=“2018-04-08T19:09:37-04:00” level=info msg=“starting LoRa App Server” docs=“https://docs.loraserver.io/” version=0.19.0
Apr 08 19:09:37 raspberrypi lora-app-server: time=“2018-04-08T19:09:37-04:00” level=info msg=“connecting to postgresql”
Apr 08 19:09:38 raspberrypi lora-app-server: time=“2018-04-08T19:09:38-04:00” level=info msg=“setup redis connection pool”
Apr 08 19:09:38 raspberrypi lora-app-server: time=“2018-04-08T19:09:38-04:00” level=info msg=“handler/mqtt: TLS config is empty”
Apr 08 19:09:38 raspberrypi lora-app-server: time=“2018-04-08T19:09:38-04:00” level=info msg=“handler/mqtt: connecting to mqtt broker” server=“tcp://localhost:1883”
Apr 08 19:09:38 raspberrypi lora-app-server: time=“2018-04-08T19:09:38-04:00” level=error msg=“handler/mqtt: connecting to broker error, will retry in 2s: Network Error : dial tcp [::1]:1883: connect: connection refused”
I can’t recall if that message was specific or generic and don’t have means to check it right now, but again it seems that either mosquitto isn’t running, credentials for mosquitto at lora-app-server configuration are wrong or mosquitto authentication is not correctly set. You’ll need to check those things to see which is the one causing the issue.
It appears to have been an issue with Mosquitto not actually running. Upon starting the service with the code
sudo mosquitto -c /etc/mosquitto/mosquitto.conf
I found the issue was within the .conf file apparently I was having a hard time typing in English the other evening and my
Sorry again for the hassle as I should have been checking my .conf files better. Hopefully the rest of the setup will run smoothly. Thank you again for your help.
I am trying to setup LoRa Server and LoRa APP server on the same Raspberry Pi. I followed the quick install guide . LoRa server is working but lora app server failed to do so. Other than this, when i check the created role for created database, it give peer authentication failed for user  error. When i check the status of lora app server it gives the error as shown in attached image. I am wondering what should i do to eliminate this error?