Remote MQTT connection via OS overlay

I am trying to send application MQTT data to a remote (still on local lan) MQTT broker. This is in an effort to do some automation and other integrations with LoRa devices. To preface the rest of this, if everything is set to 127.0.0.1 it works just fine.

The MQTT Forwarder on the OS configurator (port 443) is set to the remote which sends the region/gateway info, but ChirpStack (port 8080) cant see the gateway. I changed the config, manually, in the region toml which reconnected the gateway. However all of the application data is still being sent to localhost.

I have tried to search for the chirpstack.toml file and seems that that is created dynamically from somewhere? I think this because the file is in tmp and reloading the chirpstack service changes that files contents.

So ig my question is: where do i change the integration config for the actual chirpstack service?

I remember you can find the actual file somewhere that contains all the text of the configuration files that then gets created on startup, I once enabled the MQTT integration by changing that directly and that worked throughout reboots but I don’t think it would work through an update. I believe the correct way to change configuration on the gateway OS is using the overlayFS UCI commands, I will look into this.

Okay you can use UCI commands to change the Chirpstack configuration inside your GW OS RPI: Configuration - ChirpStack open-source LoRaWAN® Network Server documentation

For example:

uci show chirpstack

Should show your current Chirpstack.toml configuration settings.

And to change the MQTT integration to a different broker you could use the command:

uci set chirpstack.integration.mqtt.server=‘tcp://your-mqtt-broker-host:1883/’

uci commit chirpstack

Although I do not have my Pi with me at the moment to verify whether that exact command is correct, that is the idea of using the UCI commands.

I’m getting a parse error from that command. I don’t know anything about these UCI commands, but do I need to add the items to the configs maybe?

uci add chirpstack integration
uci add chirpstack.@integration[0] mqtt

that exact combo does not work, get an ‘entry not found’, but something similar?

I know very little of UCI commands as well, I’ve only used them once to change the network settings on my Pis. You can read about UCI here: [OpenWrt Wiki] The UCI system. Not exactly light reading though.

Maybe if you pasted your output of the uci show chirpstack (I believe that shows all the configuration options) I could figure out the integration.mqtt change from that.

uci add chirpstack integration
uci add chirpstack.@integration[0] mqtt

These don’t seem right to me and I wouldn’t just start adding things blindly either, shouldn’t do any harm but certainly adds some clutter. The integration is on by default, just pointed at Chirpstack’s own MQTT broker. So you shouldn’t have to add anything, just change the server location (I think, maybe this is missing from the PI, to confirm you can just check your current temp chirpstack.toml and see if the section for MQTT integration is there).