-
Notifications
You must be signed in to change notification settings - Fork 0
[ChirpStack] Forwarding LoRa frames using UDP (to TTN, ...)
By default, concentratord
forwards Lora frames directly to a MQTT broker, either local or remote.
The following describes how to enable LoRa frames forwarding using UDP, by using chirpstack-udp-bridge
.
In the following, some it is assumed to be known
- how to establish an SSH connection to the gateway
- how to access gateway terminal-based configuration tool
Refer to this other page for details.
To add chirpstack-udp-bridge
as a service managed by monit
, in order to launch it at startup (as others already are), edit a configuration file by typing the following command in a terminal:
sudo nano /etc/monit.d/chirpstack-udp-bridge
The script file should be as below:
check process chirpstack-udp-bridge with pidfile /var/run/chirpstack-udp-bridge.pid
start program = "/etc/init.d/chirpstack-udp-bridge start"
stop program = "/etc/init.d/chirpstack-udp-bridge stop"
To take this new service into account, type the following commands in a terminal:
-
sudo monit reload
(to restart all gateway services orsudo monit start chirpstack-udp-bridge
to only start this one) -
sudo monit summary
(to check if services are started normally, as below
┌─────────────────────────────────┬────────────────────────────┬───────────────┐
│ Service Name │ Status │ Type │
├─────────────────────────────────┼────────────────────────────┼───────────────┤
│ raspberrypi3 │ OK │ System │
├─────────────────────────────────┼────────────────────────────┼───────────────┤
│ chirpstack-udp-bridge │ OK │ Process │
├─────────────────────────────────┼────────────────────────────┼───────────────┤
│ chirpstack-network-server │ OK │ Process │
├─────────────────────────────────┼────────────────────────────┼───────────────┤
│ chirpstack-gateway-bridge │ OK │ Process │
├─────────────────────────────────┼────────────────────────────┼───────────────┤
│ chirpstack-concentratord │ OK │ Process │
├─────────────────────────────────┼────────────────────────────┼───────────────┤
│ chirpstack-application-server │ OK │ Process │
└─────────────────────────────────┴────────────────────────────┴───────────────┘
To edit chirpstack-udp-bridge
configuration file (located at etc/chirpstack-udp-bridge/chirpstack-udp-bridge.toml
), just type the following command in a terminal:
sudo nano /etc/chirpstack-udp-bridge/chirpstack-udp-bridge.toml
Then, locate the [[udp_bridge.servers]]
section and set the server address:
# Servers to forward the data to using UDP.
# This section can be repeated.
[[udp_bridge.servers]]
# Server (hostname:port).
# server="localhost:1700"
server="eu1.cloud.thethings.network:1700"
N.B. no need to add a local server, since concentratord
is also running and forwards to local MQTT.
Restart chirpstack-udp-bridge
in order for changes to be applied.
In order to configure UDP forwarding to multiple servers simultaneously,
just repeat [[udp_bridge.servers]]
section, as following example:
# Servers to forward the data to using UDP.
# This section can be repeated.
[[udp_bridge.servers]]
# Server (hostname:port).
# server="localhost:1700"
server="lns.campusiot.imag.fr:1700"
[[udp_bridge.servers]]
# Server (hostname:port).
# server="localhost:1700"
server="eu1.cloud.thethings.network:1700"