Skip to content

Commit 96cb063

Browse files
committed
Add ChirpStack Gateway Bridge Basics Station setup.
1 parent c7cad3b commit 96cb063

File tree

45 files changed

+1666
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1666
-3
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ It will:
1111
* Setup Mosquitto (MQTT broker) + client and server-certificate configuration
1212
* Setup Redis
1313
* Setup PostgreSQL + creation of role and database
14-
* Setup [ChirpStack Gateway Bridge](https://www.chirpstack.io/docs/chirpstack-gateway-bridge/)
14+
* Setup [ChirpStack Gateway Bridge](https://www.chirpstack.io/docs/chirpstack-gateway-bridge/) for UDP
15+
* Setup [ChirpStack Gateway Bridge](https://www.chirpstack.io/docs/chirpstack-gateway-bridge/) for Basics Station
1516
* Setup [ChirpStack](https://www.chirpstack.io/docs/chirpstack/)
1617
* Request a HTTPS certificate from [Let's Encrypt](https://letsencrypt.org)
1718

@@ -23,6 +24,7 @@ the following ports to your host system:
2324

2425
* `8080`: ChirpStack UI and gRPC API
2526
* `1700`: ChirpStack Gateway Bridge UDP listener (configured for EU868 region by default)
27+
* `3001`: ChirpStack Gateway Bridge Basics Station listener (configured for EU868 region by default)
2628
* `8883`: Mosquitto MQTT (with TLS, client-certificate files can be generated in the ChirpStack UI)
2729

2830
Note: when using Vagrant, there is no need to install Ansible (this will be

Vagrantfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Vagrant.configure("2") do |config|
88
box.vm.network "forwarded_port", guest: 80, host: 8080, protocol: "tcp"
99
box.vm.network "forwarded_port", guest: 443, host: 4443, protocol: "tcp"
1010
box.vm.network "forwarded_port", guest: 8883, host: 8883, protocol: "tcp"
11+
box.vm.network "forwarded_port", guest: 3001, host: 3001, protocol: "tcp"
1112
box.vm.network "forwarded_port", guest: 1700, host: 1700, protocol: "udp"
1213

1314
box.vm.provision "ansible_local" do |ansible|

deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@
2323
- redis
2424
- mosquitto
2525
- chirpstack-gateway-bridge
26+
- chirpstack-gateway-bridge-basicstation
2627
- chirpstack
2728
become: 'yes'

group_vars/chirpstack.example.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# iptable configuration
22
#
3-
# all ports will be blocked, except the ports listed below
3+
# All ports will be blocked, except the ports listed below.
44
iptables:
55
accept:
66
-
@@ -19,6 +19,10 @@ iptables:
1919
port: 8883
2020
source: 0.0.0.0/0
2121
protocol: tcp
22+
-
23+
port: 3001
24+
source: 0.0.0.0/0
25+
protocol: tcp
2226
-
2327
port: 1700
2428
source: 0.0.0.0/0
@@ -37,6 +41,15 @@ chirpstack_gateway_bridge:
3741
# regions that are configured in the chirpstack.toml configuration file.
3842
region: eu868
3943

44+
# ChirpStack Gateway Bridge configuration (Basics Station)
45+
chirpstack_gateway_bridge_basicstation:
46+
# Region.
47+
# This defines the configuration file that will be copied from the
48+
# roles/chirpstack-gateway-bridge-basicstation/templates directory.
49+
# The file copied will be equal to:
50+
# chirpstack-gateway-bridge-basicstation-[region].toml
51+
region: eu868
52+
4053
# ChirpStack configuration.
4154
chirpstack:
4255
# The full domain by which ChirpStack is reachable.

host_vars/vagrant.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# iptable configuration
2+
#
3+
# All ports will be blocked, except the ports listed below.
24
iptables:
35
accept:
46
-
@@ -17,30 +19,58 @@ iptables:
1719
port: 8883
1820
source: 0.0.0.0/0
1921
protocol: tcp
22+
-
23+
port: 3001
24+
source: 0.0.0.0/0
25+
protocol: tcp
2026
-
2127
port: 1700
2228
source: 0.0.0.0/0
2329
protocol: udp
2430

2531
# Mosquitto configuration
2632
mosquitto:
33+
# the full domain by which the MQTT broker is reachable
34+
# e.g. subdomain.example.com
2735
fqdn: localhost
2836

29-
# ChirpStack Gateway Bridge configuration
37+
# ChirpStack Gateway Bridge configuration (UDP)
3038
chirpstack_gateway_bridge:
39+
# Region.
40+
# This is used as MQTT topic prefix, and must match one of the available
41+
# regions that are configured in the chirpstack.toml configuration file.
42+
region: eu868
43+
44+
# ChirpStack Gateway Bridge configuration (Basics Station)
45+
chirpstack_gateway_bridge_basicstation:
46+
# Region.
47+
# This defines the configuration file that will be copied from the
48+
# roles/chirpstack-gateway-bridge-basicstation/templates directory.
49+
# The file copied will be equal to:
50+
# chirpstack-gateway-bridge-basicstation-[region].toml
3151
region: eu868
3252

3353
# ChirpStack configuration.
3454
chirpstack:
55+
# The full domain by which ChirpStack is reachable.
56+
# e.g. subdomain.example.com
3557
fqdn: localhost
58+
59+
# If enabled, a Let's Encrypt certificate will be configured. Else a
60+
# self-signed certificate will be used.
3661
letsencrypt:
3762
3863
request: false
64+
65+
# API configuration.
3966
api:
4067
# You must replace this value!
4168
# To generate random secret:
4269
# openssl rand -base64 32
4370
secret: ReplaceMe
71+
72+
# PostgreSQL database credentials.
73+
# The role and database will be created by Ansible.
4474
postgresql:
4575
db: chirpstack
4676
user: chirpstack
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- name: reload systemctl daemon
2+
systemd:
3+
daemon_reload: true
4+
5+
- name: restart chirpstack-gateway-bridge-basicstation
6+
service:
7+
name: chirpstack-gateway-bridge-basicstation
8+
state: restarted
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
- name: install chirpstack-gateway-bridge
2+
package:
3+
name: chirpstack-gateway-bridge
4+
state: latest
5+
6+
- name: add systemd service
7+
template:
8+
src: chirpstack-gateway-bridge-basicstation.service
9+
dest: /lib/systemd/system/chirpstack-gateway-bridge-basicstation.service
10+
notify:
11+
- reload systemctl daemon
12+
13+
- name: copy configuration
14+
template:
15+
src: "chirpstack-gateway-bridge-basicstation-{{ chirpstack_gateway_bridge_basicstation.region }}.toml"
16+
dest: /etc/chirpstack-gateway-bridge/chirpstack-gateway-bridge-basicstation.toml
17+
owner: gatewaybridge
18+
group: gatewaybridge
19+
mode: "0640"
20+
notify:
21+
- restart chirpstack-gateway-bridge-basicstation
22+
23+
- name: start chirpstack-gateway-bridge-basicstation on boot
24+
service:
25+
name: chirpstack-gateway-bridge-basicstation
26+
state: started
27+
enabled: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
2+
# configuration example and documentation.
3+
4+
[integration.mqtt.auth.generic]
5+
servers=["tcp://localhost:1883"]
6+
username=""
7+
password=""
8+
9+
[integration.mqtt]
10+
event_topic_template="{{ chirpstack_gateway_bridge_basicstation.region }}{% raw %}/gateway/{{ .GatewayID }}/event/{{ .EventType }}{% endraw %}"
11+
state_topic_template="{{ chirpstack_gateway_bridge_basicstation.region }}{% raw %}/gateway/{{ .GatewayID }}/state/{{ .StateType }}{% endraw %}"
12+
command_topic_template="{{ chirpstack_gateway_bridge_basicstation.region }}{% raw %}/gateway/{{ .GatewayID }}/command/#{% endraw %}"
13+
14+
[backend]
15+
type="basic_station"
16+
17+
[backend.basic_station]
18+
bind=":3001"
19+
tls_cert=""
20+
tls_key=""
21+
ca_cert=""
22+
23+
region="AS923"
24+
frequency_min=915000000
25+
frequency_max=928000000
26+
27+
28+
[[backend.basic_station.concentrators]]
29+
30+
[backend.basic_station.concentrators.multi_sf]
31+
frequencies=[
32+
923200000,
33+
923400000,
34+
923600000,
35+
923800000,
36+
924000000,
37+
924200000,
38+
924400000,
39+
924600000,
40+
]
41+
42+
[backend.basic_station.concentrators.lora_std]
43+
frequency=924500000
44+
bandwidth=250000
45+
spreading_factor=7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
2+
# configuration example and documentation.
3+
4+
[integration.mqtt.auth.generic]
5+
servers=["tcp://localhost:1883"]
6+
username=""
7+
password=""
8+
9+
[integration.mqtt]
10+
event_topic_template="{{ chirpstack_gateway_bridge_basicstation.region }}{% raw %}/gateway/{{ .GatewayID }}/event/{{ .EventType }}{% endraw %}"
11+
state_topic_template="{{ chirpstack_gateway_bridge_basicstation.region }}{% raw %}/gateway/{{ .GatewayID }}/state/{{ .StateType }}{% endraw %}"
12+
command_topic_template="{{ chirpstack_gateway_bridge_basicstation.region }}{% raw %}/gateway/{{ .GatewayID }}/command/#{% endraw %}"
13+
14+
[backend]
15+
type="basic_station"
16+
17+
[backend.basic_station]
18+
bind=":3001"
19+
tls_cert=""
20+
tls_key=""
21+
ca_cert=""
22+
23+
region="AS923"
24+
frequency_min=915000000
25+
frequency_max=928000000
26+
27+
28+
[[backend.basic_station.concentrators]]
29+
30+
[backend.basic_station.concentrators.multi_sf]
31+
frequencies=[
32+
921400000,
33+
921600000,
34+
921800000,
35+
922000000,
36+
922200000,
37+
922400000,
38+
922600000,
39+
922800000,
40+
]
41+
42+
[backend.basic_station.concentrators.lora_std]
43+
frequency=922700000
44+
bandwidth=250000
45+
spreading_factor=7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
2+
# configuration example and documentation.
3+
4+
[integration.mqtt.auth.generic]
5+
servers=["tcp://localhost:1883"]
6+
username=""
7+
password=""
8+
9+
[integration.mqtt]
10+
event_topic_template="{{ chirpstack_gateway_bridge_basicstation.region }}{% raw %}/gateway/{{ .GatewayID }}/event/{{ .EventType }}{% endraw %}"
11+
state_topic_template="{{ chirpstack_gateway_bridge_basicstation.region }}{% raw %}/gateway/{{ .GatewayID }}/state/{{ .StateType }}{% endraw %}"
12+
command_topic_template="{{ chirpstack_gateway_bridge_basicstation.region }}{% raw %}/gateway/{{ .GatewayID }}/command/#{% endraw %}"
13+
14+
[backend]
15+
type="basic_station"
16+
17+
[backend.basic_station]
18+
bind=":3001"
19+
tls_cert=""
20+
tls_key=""
21+
ca_cert=""
22+
23+
region="AS923"
24+
frequency_min=915000000
25+
frequency_max=928000000
26+
27+
28+
[[backend.basic_station.concentrators]]
29+
30+
[backend.basic_station.concentrators.multi_sf]
31+
frequencies=[
32+
916600000,
33+
916800000,
34+
917000000,
35+
917200000,
36+
917400000,
37+
917600000,
38+
917800000,
39+
918000000,
40+
]
41+
42+
[backend.basic_station.concentrators.lora_std]
43+
frequency=917900000
44+
bandwidth=250000
45+
spreading_factor=7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
2+
# configuration example and documentation.
3+
4+
[integration.mqtt.auth.generic]
5+
servers=["tcp://localhost:1883"]
6+
username=""
7+
password=""
8+
9+
[integration.mqtt]
10+
event_topic_template="{{ chirpstack_gateway_bridge_basicstation.region }}{% raw %}/gateway/{{ .GatewayID }}/event/{{ .EventType }}{% endraw %}"
11+
state_topic_template="{{ chirpstack_gateway_bridge_basicstation.region }}{% raw %}/gateway/{{ .GatewayID }}/state/{{ .StateType }}{% endraw %}"
12+
command_topic_template="{{ chirpstack_gateway_bridge_basicstation.region }}{% raw %}/gateway/{{ .GatewayID }}/command/#{% endraw %}"
13+
14+
[backend]
15+
type="basic_station"
16+
17+
[backend.basic_station]
18+
bind=":3001"
19+
tls_cert=""
20+
tls_key=""
21+
ca_cert=""
22+
23+
region="AS923"
24+
frequency_min=915000000
25+
frequency_max=928000000
26+
27+
28+
[[backend.basic_station.concentrators]]
29+
30+
[backend.basic_station.concentrators.multi_sf]
31+
frequencies=[
32+
917300000,
33+
917500000,
34+
917700000,
35+
917900000,
36+
918100000,
37+
918300000,
38+
918500000,
39+
918700000,
40+
]
41+
42+
[backend.basic_station.concentrators.lora_std]
43+
frequency=918600000
44+
bandwidth=250000
45+
spreading_factor=7

0 commit comments

Comments
 (0)