Lora-gateway-bridge.toml configuration file issue

I’ve some problem related to the lora-gateway-bridge.toml file, even if it seems only in a unique location
root@lorank8:~# sudo find / -name “lora-gateway-bridge.toml”
when I query it with
root@lorank8:~# cat /etc/lora-gateway-bridge/lora-gateway-bridge.toml | grep tcp
I get the server address I want,
while when I execute
root@lorank8:~# sudo lora-gateway-bridge configfile --config /etc/lora-gateway-bridge/lora-gateway-bridge.toml | grep tcp:
I get the original server address.
Tcpdump also confirms that is the address that is used by the lora-gateway-bridge service.
I’ve also try with sudo systemctl daemon-reload without any success.
Any idea in what I’m wrong ?

Hey… i am not sure with this. but as you start the lora-gateway-brdige with this:

the part “configfile” should not be used for start. as it generates a new config file (prints out to standard output).

so try this:

sudo lora-gateway-bridge --config /etc/lora-gateway-bridge/lora-gateway-bridge.toml | grep tcp:

Many thanks Sil,
If I wasn’t wrong, I’ve used this command
sudo lora-gateway-bridge configfile --config /etc/lora-gateway-bridge/lora-gateway-bridge.toml | grep tcp:
only for see what parameters currently used by the service and not for launching the program.
Anyway your suggestion is useful, so I stopped the service and I launch the program from the shell by
root@lorank8:~# sudo lora-gateway-bridge --config /etc/lora-gateway-bridge/lora-gateway-bridge.toml
INFO[0000] starting LoRa Gateway Bridge docs=“https://www.loraserver.io/lora-gateway-bridge/” version=3.3.0
INFO[0000] backend/semtechudp: starting gateway udp listener addr=“”
INFO[0000] integration/mqtt: connected to mqtt broker
INFO[0002] integration/mqtt: subscribing to topic qos=0 topic=“gateway/1dee0b7ab21516f3/command/#”
INFO[0002] integration/mqtt: publishing event event=stats qos=0 stats_id=ac28e778-3655-4301-bd5a-734add2a37bf topic=gateway/1dee0b7ab215

Even with this explicit configutìration file path, it seems the program publish to localhost … also tcpdump seems to confirm
09:16:00.577985 IP localhost.1700 > localhost.48586: UDP, length 4
E… E]@.@…m…
09:16:03.900588 IP localhost.58722 > localhost.1700: UDP, length 12

okey, now i got it… can you please describe again exactly what your problem ist?

you grep your config on TCP, this shows you the MQTT-Server which is configured. As i see in the logs from your start, it connects to a mqtt broker.

so your lora-bridge seams to be installed on a lorank8 gateway and i asume its the same place as the packet forwarder is running. so you just need to see that the packetforwarder sends your data to Port 1700 on the localhost.

if you describe your full problem, its maybe more easy to help

Yes I’ll try.
Both lora-bridge and semtech packet forwarder are running on a Lorank8 gateway.
The lora-bridge is configured to send the mqtt payload to an AWS machine, but instead it seems that sent to localhost.
This seems caused by the lora-gateway-bridge config file that when I edit in /etc/lora-gateway-bridge/lora-gateaway-bridge.toml show a correct content but when I see by the configfile option of the lora-gateway-bridge has another content.
I hope this better explain my problem …

These are some additional info:
root@lorank8:~# sudo lora-gateway-bridge --config /etc/lora-gateway-bridge/lora-gateway-bridge.toml configfile > lora-gateway-bridge.toml.now
root@lorank8:~# cat ./lora-gateway-bridge.toml.now | grep tcp
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
root@lorank8:~# cat /etc/lora-gateway-bridge/lora-gateway-bridge.toml | grep tcp
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)

okey… you still make some mistakes i think…

root@lorank8:~# sudo lora-gateway-bridge --config /etc/lora-gateway-bridge/lora-gateway-bridge.toml configfile > lora-gateway-bridge.toml.now

this does not start the service. as soon as configfile parameter is given, it only prints a default config file. So if you grep this for tcp (mqtt-server), it uses as default localhost. So in your case lora-gateway-bridge.toml.now is a default config file which is not used.

i think you dont have a mqtt-service on the lorank8, right?

so when i see your logs, it seams to work correctly - as it connects to the mqtt.

if there is no mqtt broker on the lorank, it seams to work good. as it sends also data to the mqtt.

if there would be no mqtt it would be result in a log like this:

ERRO[0000] could not setup mqtt backend, retry in 2 seconds: Network Error : dial tcp connect: connection refused

On your logs you see a listen on Localhost port 1700… this is the gateway bridge, which is listening. it listens for data from the package forwarder and this should be good as well. does your package forwarder send data to localhost, port 1700?

Hi Sil,
about the configuration file, I interpreted this command:
root@lorank8:~# sudo lora-gateway-bridge --config /etc/lora-gateway-bridge/lora-gateway-bridge.toml configfile > lora-gateway-bridge.toml.now
as specified in https://www.loraserver.io/lora-gateway-bridge/install/config/ that says:

To generate a new configuration file lora-gateway-bridge.toml, execute the following command:
lora-gateway-bridge configfile > lora-gateway-bridge.toml
Note that this configuration file will be pre-filled with the current configuration (either loaded from the paths mentioned above, or by using the --config flag).

This last part talk about the

“current configuration (either loaded from the paths mentioned above, or by using the --config flag)” and not about a “default config file”

so I imagine that the resulting file contains the configuration currently used by the service an not the default one.

The traffic captured by tcpdump on port 1700 confirm that the packet forwarder msg are sent and ack by the lora-gateway-bridge
Here is a mix of the tcpdump and the journal of the lora-gateway-bridge:

11:42:23.088865 IP localhost.38298 > localhost.1700: UDP, length 217
E…Q@.@.5…|…z…{“time”:“2019-09-27T11:42:22Z”,“stat”:{“time”:“2019-09-27 11:42:22 GMT”,“lati”:0.00000,“long”:0.00000,“alti”:0,“rxnb”:0,“rxok”:0,“rxfw”:0,“ackr”:66.7,“dwnb”:0,“txnb”:0,“pf
11:42:23.096058 IP localhost.1700 > localhost.38298: UDP, length 4
E… .R@.@.6y…|…
11:42:24.714662 IP localhost.45894 > localhost.1700: UDP, length 12
11:42:24.717737 IP localhost.1700 > localhost.45894: UDP, length 4
E… .T@.@.5w…F…N.

Due to a previous installation of all the loraserver components on the gateway, the mosquitto service was still active on lorank8 (Thanks for the suggestion!).
Disabling it I get what you indicate::
Sep 27 12:06:01 lorank8 systemd[1]: Started LoRa Gateway Bridge.
Sep 27 12:06:01 lorank8 lora-gateway-bridge[779]: time=“2019-09-27T12:06:01Z” level=info msg=“starting LoRa Gateway Bridge” docs=“https://www.loraserver.io/lora-gateway-bridge/” version=3.3.0
Sep 27 12:06:01 lorank8 lora-gateway-bridge[779]: time=“2019-09-27T12:06:01Z” level=info msg=“backend/semtechudp: starting gateway udp listener” addr=“”
Sep 27 12:06:01 lorank8 lora-gateway-bridge[779]: time=“2019-09-27T12:06:01Z” level=error msg=“integration/mqtt: connection error” error=“Network Error : dial tcp connect: connection refused”

So it seems the lora-gateway-bridge sent mqtt payload on localhost even if in the .toml file there is :
root@lorank8:~# cat /etc/lora-gateway-bridge/lora-gateway-bridge.toml | grep tcp

I’ve also deleted the .toml file and the journal give me the same error, so it seems teservice doesn’t look at all at this file.

So I purge the lora-gateway-bridge package (I’ve also explicity deleted the /etc/lora-gateway-bridge dir and its contents) and reinstall it.
Changing the IP address of the mqtt broker to point to the AWS instance and finally it works!
It’s still not clear to me why the previous installation doesn’t work …
Many thanks to Sil for his help.

I think that it could be useful for somone else with this problem
Flagged means for example to select “Solution” ?

I am also confused about the config files (.toml). I make changes to the /path/*.toml file to for example change to json format instead of protobuf. When printing out the configfile using (chirpstack-gateway-bridge configfile) I see only the original contents (i.e. “protobuf”). Whereas when I print out the modified file (more /path/chirpstack-gateway-bridge.toml), I can see “json”.
How to activate the updates in the modified .toml file?
How to back up the existing .toml file before activating the changes?