Compare commits

...

9 Commits

Author SHA1 Message Date
1d2f627bbb Bump version to 4.2.0 2023-01-24 12:23:44 +00:00
54815f03ca Reset channels to default on AdrAckReq uplink.
As part of the ADR back-off, the device will eventually revert to the
default channel-plan but there is no explicit signalling if this
happened.

This might cause some small overhead in case the device did not (yet)
revert to the default channel-mask, but it avoids scenarios where the
device and NS are out-of-sync.
2023-01-24 09:46:31 +00:00
20b454d519 Fix not recording device-metrics if auto-detect is disabled.
Fixes #94.
2023-01-23 15:28:31 +00:00
69d3169eac Bump bumpalo from 3.11.0 to 3.12.0 (#95)
Bumps [bumpalo](https://github.com/fitzgen/bumpalo) from 3.11.0 to 3.12.0.
- [Release notes](https://github.com/fitzgen/bumpalo/releases)
- [Changelog](https://github.com/fitzgen/bumpalo/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fitzgen/bumpalo/compare/3.11.0...3.12.0)

---
updated-dependencies:
- dependency-name: bumpalo
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-23 09:50:14 +00:00
7c68500e81 Bump paho-mqtt from 0.11.1 to 0.12.0 (#96)
Bumps [paho-mqtt](https://github.com/eclipse/paho.mqtt.rust) from 0.11.1 to 0.12.0.
- [Release notes](https://github.com/eclipse/paho.mqtt.rust/releases)
- [Changelog](https://github.com/eclipse/paho.mqtt.rust/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eclipse/paho.mqtt.rust/compare/v0.11.1...v0.12.0)

---
updated-dependencies:
- dependency-name: paho-mqtt
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-23 09:50:05 +00:00
25f1b224f7 Bump tokio from 1.23.1 to 1.24.2 (#97)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.23.1 to 1.24.2.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/commits)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-23 09:49:56 +00:00
cdb92d6772 Bump async-trait from 0.1.61 to 0.1.63 (#98)
Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.61 to 0.1.63.
- [Release notes](https://github.com/dtolnay/async-trait/releases)
- [Commits](https://github.com/dtolnay/async-trait/compare/0.1.61...0.1.63)

---
updated-dependencies:
- dependency-name: async-trait
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-23 09:49:46 +00:00
fb73e09337 Bump serde_json from 1.0.85 to 1.0.91 (#99)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.85 to 1.0.91.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.85...v1.0.91)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-23 09:49:34 +00:00
a36d323f2b Migrate to topic prefix instead of individual topic config.
This makes the configuration easier, as well if new topics are added in
the future, there is no need to update all the configuration files
again to add the missing topic configuration.
2023-01-19 12:01:20 +00:00
55 changed files with 329 additions and 243 deletions

36
Cargo.lock generated
View File

@ -299,9 +299,9 @@ checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524"
[[package]]
name = "async-trait"
version = "0.1.61"
version = "0.1.63"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "705339e0e4a9690e2908d2b3d049d85682cf19fbd5782494498fbf7003a6a282"
checksum = "eff18d764974428cf3a9328e23fc5c986f5fbed46e6cd4cdf42544df5d297ec1"
dependencies = [
"proc-macro2",
"quote",
@ -663,7 +663,7 @@ dependencies = [
[[package]]
name = "backend"
version = "4.2.0-test.1"
version = "4.2.0"
dependencies = [
"aes-kw",
"anyhow",
@ -810,9 +810,9 @@ dependencies = [
[[package]]
name = "bumpalo"
version = "3.11.0"
version = "3.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d"
checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535"
[[package]]
name = "byteorder"
@ -880,7 +880,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chirpstack"
version = "4.2.0-test.1"
version = "4.2.0"
dependencies = [
"aes",
"anyhow",
@ -959,7 +959,7 @@ dependencies = [
[[package]]
name = "chirpstack_api"
version = "4.2.0-test.1"
version = "4.2.0"
dependencies = [
"hex",
"pbjson",
@ -1085,9 +1085,9 @@ dependencies = [
[[package]]
name = "cmake"
version = "0.1.45"
version = "0.1.49"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eb6210b637171dfba4cda12e579ac6dc73f5165ad56133e5d72ef3131f320855"
checksum = "db34956e100b30725f2eb215f90d4871051239535632f84fea3bc92722c66b7c"
dependencies = [
"cc",
]
@ -2239,7 +2239,7 @@ dependencies = [
[[package]]
name = "lrwn"
version = "4.2.0-test.1"
version = "4.2.0"
dependencies = [
"aes",
"anyhow",
@ -2616,9 +2616,9 @@ dependencies = [
[[package]]
name = "paho-mqtt"
version = "0.11.1"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9fac58bae33ba9679bb4908ffa7c3950114345860d3f9b98340c4943f18ff324"
checksum = "a3934b32a8321d0f64dee17c97ea1ffbf78d75f850ff13f7dd33c6e5438e32bf"
dependencies = [
"async-channel",
"crossbeam-channel",
@ -2632,9 +2632,9 @@ dependencies = [
[[package]]
name = "paho-mqtt-sys"
version = "0.7.0"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10e6244f27644eed5709e318a3ad7f785906fbb6030f0a9b9ba50923b456c0c5"
checksum = "f92767091deda553bdb716820e5c168e2fbeb48c2f7f27a3d459b84cd53d680c"
dependencies = [
"cmake",
"openssl-sys",
@ -3556,9 +3556,9 @@ dependencies = [
[[package]]
name = "serde_json"
version = "1.0.85"
version = "1.0.91"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44"
checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883"
dependencies = [
"itoa",
"ryu",
@ -3978,9 +3978,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
[[package]]
name = "tokio"
version = "1.23.1"
version = "1.24.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38a54aca0c15d014013256222ba0ebed095673f89345dd79119d912eb561b7a8"
checksum = "597a12a59981d9e3c38d216785b0c37399f6e415e8d0712047620f189371b0bb"
dependencies = [
"autocfg",
"bytes",

View File

@ -1,6 +1,6 @@
{
"name": "@chirpstack/chirpstack-api-grpc-web",
"version": "4.2.0-test.1",
"version": "4.2.0",
"description": "Chirpstack gRPC-web API",
"license": "MIT",
"devDependencies": {

View File

@ -8,7 +8,7 @@ plugins {
}
group = "io.chirpstack"
version = "4.2.0-test.1"
version = "4.2.0"
repositories {
mavenCentral()

2
api/js/package.json vendored
View File

@ -1,6 +1,6 @@
{
"name": "@chirpstack/chirpstack-api",
"version": "4.2.0-test.1",
"version": "4.2.0",
"description": "Chirpstack JS and TS API",
"license": "MIT",
"devDependencies": {

View File

@ -9,7 +9,7 @@ plugins {
}
group = "io.chirpstack"
version = "4.2.0-test.1"
version = "4.2.0"
repositories {
mavenCentral()

View File

@ -18,7 +18,7 @@ CLASSIFIERS = [
setup(
name='chirpstack-api',
version = "4.2.0-test.1",
version = "4.2.0",
url='https://github.com/brocaar/chirpstack-api',
author='Orne Brocaar',
author_email='info@brocaar.com',

6
api/rust/Cargo.lock generated vendored
View File

@ -117,7 +117,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chirpstack_api"
version = "4.2.0-test.1"
version = "4.2.0"
dependencies = [
"hex",
"pbjson",
@ -755,9 +755,9 @@ dependencies = [
[[package]]
name = "tokio"
version = "1.23.1"
version = "1.24.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38a54aca0c15d014013256222ba0ebed095673f89345dd79119d912eb561b7a8"
checksum = "597a12a59981d9e3c38d216785b0c37399f6e415e8d0712047620f189371b0bb"
dependencies = [
"autocfg",
"bytes",

4
api/rust/Cargo.toml vendored
View File

@ -1,7 +1,7 @@
[package]
name = "chirpstack_api"
description = "ChirpStack Protobuf / gRPC API definitions."
version = "4.2.0-test.1"
version = "4.2.0"
authors = ["Orne Brocaar <info@brocaar.com>"]
license = "MIT"
homepage = "https://www.chirpstack.io"
@ -22,7 +22,7 @@ hex = "0.4"
rand = "0.8"
tonic = { version = "0.8", features = ["codegen", "prost"], default-features = false }
tokio = { version = "1.23", features = ["macros"], optional = true }
tokio = { version = "1.24", features = ["macros"], optional = true }
serde = { version = "1.0" }
[build-dependencies]

View File

@ -1,6 +1,6 @@
[package]
name = "backend"
version = "4.2.0-test.1"
version = "4.2.0"
authors = ["Orne Brocaar <info@brocaar.com>"]
edition = "2018"
publish = false
@ -16,7 +16,7 @@ rand = "0.8"
aes-kw = "0.2"
reqwest = { version = "0.11", features = ["json", "rustls-tls"], default-features = false }
chrono = { version = "0.4", features = ["serde"] }
tokio = { version = "1.23", features = ["macros" ] }
tokio = { version = "1.24", features = ["macros" ] }
# Development and testing
[dev-dependencies]

View File

@ -3,7 +3,7 @@ name = "chirpstack"
description = "ChirpStack is an open-source LoRaWAN(TM) Network Server"
repository = "https://github.com/chirpstack/chirpstack"
homepage="https://www.chirpstack.io/"
version = "4.2.0-test.1"
version = "4.2.0"
authors = ["Orne Brocaar <info@brocaar.com>"]
edition = "2021"
publish = false
@ -60,7 +60,7 @@ rdkafka = { version = "0.28", features = ["cmake-build"]}
tonic = "0.8"
tonic-web = "0.5"
tonic-reflection = "0.5"
tokio = { version = "1.23", features = ["macros", "rt-multi-thread"] }
tokio = { version = "1.24", features = ["macros", "rt-multi-thread"] }
tokio-stream = "0.1"
prost-types = "0.11"
prost = "0.11"
@ -89,7 +89,7 @@ openssl = { version = "0.10", features = ["vendored"] }
openidconnect = { version = "2.5", features = ["accept-rfc3339-timestamps"] }
# MQTT
paho-mqtt = { version = "0.11", features = ["vendored-ssl"] }
paho-mqtt = { version = "0.12", features = ["vendored-ssl"] }
hex = "0.4"
# Codecs

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="as923/gateway/+/event/+"
# Command topic template.
command_topic="as923/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="as923"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="as923_2/gateway/+/event/+"
# Command topic template.
command_topic="as923_2/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="as923_2"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="as923_3/gateway/+/event/+"
# Command topic template.
command_topic="as923_3/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="as923_3"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="as923_4/gateway/+/event/+"
# Command topic template.
command_topic="as923_4/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="as923_4"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="au915_0/gateway/+/event/+"
# Command topic template.
command_topic="au915_0/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="au915_0"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="au915_1/gateway/+/event/+"
# Command topic template.
command_topic="au915_1/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="au915_1"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="au915_2/gateway/+/event/+"
# Command topic template.
command_topic="au915_2/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="au915_2"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="au915_3/gateway/+/event/+"
# Command topic template.
command_topic="au915_3/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="au915_3"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="au915_4/gateway/+/event/+"
# Command topic template.
command_topic="au915_4/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="au915_4"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="au915_5/gateway/+/event/+"
# Command topic template.
command_topic="au915_5/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="au915_5"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="au915_6/gateway/+/event/+"
# Command topic template.
command_topic="au915_6/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="au915_6"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="au915_7/gateway/+/event/+"
# Command topic template.
command_topic="au915_7/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="au915_7"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="cn470_0/gateway/+/event/+"
# Command topic template.
command_topic="cn470_0/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="cn470_0"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="cn470_1/gateway/+/event/+"
# Command topic template.
command_topic="cn470_1/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="cn470_1"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="cn470_10/gateway/+/event/+"
# Command topic template.
command_topic="cn470_10/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="cn470_10"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="cn470_11/gateway/+/event/+"
# Command topic template.
command_topic="cn470_11/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="cn470_11"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="cn470_2/gateway/+/event/+"
# Command topic template.
command_topic="cn470_2/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="cn470_2"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="cn470_3/gateway/+/event/+"
# Command topic template.
command_topic="cn470_3/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="cn470_3"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="cn470_4/gateway/+/event/+"
# Command topic template.
command_topic="cn470_4/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="cn470_4"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="cn470_5/gateway/+/event/+"
# Command topic template.
command_topic="cn470_5/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="cn470_5"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="cn470_6/gateway/+/event/+"
# Command topic template.
command_topic="cn470_6/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="cn470_6"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="cn470_7/gateway/+/event/+"
# Command topic template.
command_topic="cn470_7/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="cn470_7"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="cn470_8/gateway/+/event/+"
# Command topic template.
command_topic="cn470_8/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="cn470_8"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="cn470_9/gateway/+/event/+"
# Command topic template.
command_topic="cn470_9/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="cn470_9"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="cn779/gateway/+/event/+"
# Command topic template.
command_topic="cn779/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="cn779"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="eu433/gateway/+/event/+"
# Command topic template.
command_topic="eu433/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="eu433"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="eu868/gateway/+/event/+"
# Command topic template.
command_topic="eu868/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="eu868"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="in865/gateway/+/event/+"
# Command topic template.
command_topic="in865/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="in865"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="ism2400/gateway/+/event/+"
# Command topic template.
command_topic="ism2400/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="ism2400"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="kr920/gateway/+/event/+"
# Command topic template.
command_topic="kr920/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="kr920"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="ru864/gateway/+/event/+"
# Command topic template.
command_topic="ru864/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="ru864"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="us915_0/gateway/+/event/+"
# Command topic template.
command_topic="us915_0/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="us915_0"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="us915_1/gateway/+/event/+"
# Command topic template.
command_topic="us915_1/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="us915_1"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="us915_2/gateway/+/event/+"
# Command topic template.
command_topic="us915_2/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="us915_2"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="us915_3/gateway/+/event/+"
# Command topic template.
command_topic="us915_3/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="us915_3"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="us915_4/gateway/+/event/+"
# Command topic template.
command_topic="us915_4/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="us915_4"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="us915_5/gateway/+/event/+"
# Command topic template.
command_topic="us915_5/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="us915_5"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="us915_6/gateway/+/event/+"
# Command topic template.
command_topic="us915_6/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="us915_6"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -30,11 +30,12 @@
# MQTT configuration.
[regions.gateway.backend.mqtt]
# Event topic template.
event_topic="us915_7/gateway/+/event/+"
# Command topic template.
command_topic="us915_7/gateway/{{ gateway_id }}/command/{{ command }}"
# Topic prefix.
#
# The topic prefix can be used to define the region of the gateway.
# Note, there is no need to add a trailing '/' to the prefix. The trailing
# '/' is automatically added to the prefix if it is configured.
topic_prefix="us915_7"
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
server="tcp://$MQTT_BROKER_HOST:1883"

View File

@ -542,9 +542,7 @@ impl Default for Region {
backend: GatewayBackend {
enabled: "mqtt".into(),
mqtt: GatewayBackendMqtt {
event_topic: "eu868/gateway/+/event/+".into(),
command_topic: "eu868/gateway/{{ gateway_id }}/command/{{ command }}"
.into(),
topic_prefix: "eu868".into(),
..Default::default()
},
},
@ -621,6 +619,7 @@ pub struct GatewayBackend {
#[derive(Serialize, Deserialize, Clone)]
#[serde(default)]
pub struct GatewayBackendMqtt {
pub topic_prefix: String,
pub event_topic: String,
pub command_topic: String,
pub server: String,
@ -639,6 +638,7 @@ pub struct GatewayBackendMqtt {
impl Default for GatewayBackendMqtt {
fn default() -> Self {
GatewayBackendMqtt {
topic_prefix: "".into(),
event_topic: "".into(),
command_topic: "".into(),
server: "tcp://127.0.0.1:1883/".into(),

View File

@ -85,7 +85,19 @@ impl<'a> MqttBackend<'a> {
) -> Result<MqttBackend<'a>> {
// topic templates
let mut templates = Handlebars::new();
templates.register_template_string("command_topic", &conf.command_topic)?;
templates.register_template_string(
"command_topic",
if conf.command_topic.is_empty() {
let command_topic = "gateway/{{ gateway_id }}/command/{{ command }}".to_string();
if conf.topic_prefix.is_empty() {
command_topic
} else {
format!("{}/{}", conf.topic_prefix, command_topic)
}
} else {
conf.command_topic.clone()
},
)?;
// get client id, this will generate a random client_id when no client_id has been
// configured.
@ -211,7 +223,16 @@ impl<'a> MqttBackend<'a> {
// (Re)subscribe loop.
tokio::spawn({
let region_config_id = region_config_id.to_string();
let event_topic = conf.event_topic.clone();
let event_topic = if conf.event_topic.is_empty() {
let event_topic = "gateway/+/event/+".to_string();
if conf.topic_prefix.is_empty() {
event_topic
} else {
format!("{}/{}", conf.topic_prefix, event_topic)
}
} else {
conf.event_topic.clone()
};
let client = b.client.clone();
let qos = conf.qos as i32;

View File

@ -4001,7 +4001,7 @@ async fn test_lorawan_10_adr() {
device_queue_items: vec![],
before_func: None,
after_func: None,
device_session: Some(ds.clone()),
device_session: Some(ds_7chan.clone()), // we want to see the NS to reset channels
tx_info: tx_info.clone(),
rx_info: rx_info.clone(),
phy_payload: lrwn::PhyPayload {
@ -4027,6 +4027,7 @@ async fn test_lorawan_10_adr() {
assert: vec![
assert::f_cnt_up(dev.dev_eui.clone(), 11),
assert::n_f_cnt_down(dev.dev_eui.clone(), 5),
assert::enabled_uplink_channel_indices(dev.dev_eui.clone(), vec![0, 1, 2]),
assert::downlink_phy_payloads(vec![
lrwn::PhyPayload {
mhdr: lrwn::MHDR {

View File

@ -16,7 +16,7 @@ use crate::storage::{
application, device, device_gateway, device_profile, device_queue, device_session, fields,
metrics, tenant,
};
use crate::{codec, config, downlink, framelog, integration, maccommand, metalog};
use crate::{codec, config, downlink, framelog, integration, maccommand, metalog, region};
use chirpstack_api::{api, common, integration as integration_pb, internal, meta};
use lrwn::AES128Key;
@ -97,6 +97,7 @@ impl Data {
ctx.set_uplink_data_rate().await?;
ctx.set_enabled_class().await?;
ctx.log_uplink_meta().await?;
ctx.reset_channels_on_adr_ack_req()?;
ctx.handle_mac_commands().await?;
if !ctx._is_roaming() {
ctx.save_device_gateway_rx_info().await?;
@ -570,6 +571,35 @@ impl Data {
Ok(())
}
// This is needed as in case the device sets the ADRAckReq bit, we do not know if the device
// has reset its channels / channel-mask or not, as there is no explicit signalling in case
// this happens. This way, we make sure that the channels are always in sync, although it could
// lead to a small bit of overhead (e.g. re-sending the channels / channel-mask even if the
// device did not reset these).
fn reset_channels_on_adr_ack_req(&mut self) -> Result<()> {
trace!("Reset channels on adr ack req");
if let lrwn::Payload::MACPayload(pl) = &self.uplink_frame_set.phy_payload.payload {
if pl.fhdr.f_ctrl.adr_ack_req {
let region_conf = region::get(&self.uplink_frame_set.region_config_id)?;
let mut ds = self.device_session.as_mut().unwrap();
// We reset the device-session enabled_uplink_channel_indices and
// extra_uplink_channels. On the downlink path, the mac-command handling will
// detect that the device is out-of-sync with the NS configuration and will send
// mac-commands to re-sync.
ds.enabled_uplink_channel_indices = region_conf
.get_default_uplink_channel_indices()
.iter()
.map(|i| *i as u32)
.collect();
ds.extra_uplink_channels = HashMap::new();
}
}
Ok(())
}
async fn handle_mac_commands(&mut self) -> Result<()> {
trace!("Handling uplink mac-commands");
@ -748,11 +778,6 @@ impl Data {
let up_event = self.uplink_event.as_ref().unwrap();
let dev = self.device.as_ref().unwrap();
if !dp.auto_detect_measurements {
trace!("Auto detecting measurements is disabled in device-profile");
return Ok(());
}
let data_measurements: HashMap<String, pbjson_types::value::Kind> = match &up_event.object {
None => HashMap::new(),
Some(v) => codec::get_measurements(v),
@ -804,7 +829,7 @@ impl Data {
}
_ => {}
}
} else {
} else if dp.auto_detect_measurements {
update_dp_measurements = true;
measurements.insert(
k.clone(),

View File

@ -3,7 +3,7 @@ name = "lrwn"
description = "Library for encoding / decoding LoRaWAN frames."
homepage = "https://www.chirpstack.io"
license = "MIT"
version = "4.2.0-test.1"
version = "4.2.0"
authors = ["Orne Brocaar <info@brocaar.com>"]
edition = "2018"
repository = "https://github.com/chirpstack/chirpstack"

View File

@ -1,6 +1,6 @@
{
"name": "chirpstack-ui",
"version": "4.2.0-test.1",
"version": "4.2.0",
"private": true,
"dependencies": {
"@ant-design/colors": "^6.0.0",