mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-04-15 15:49:15 +00:00
Compare commits
19 Commits
v4.0.0-rc.
...
v4.0.0
Author | SHA1 | Date | |
---|---|---|---|
84a1c6e1be | |||
a43ef72fb2 | |||
331f4bce40 | |||
90c5af20df | |||
b0e61b50d2 | |||
0fc548d6b4 | |||
62f981fefe | |||
cba8da2d05 | |||
97a235cc80 | |||
8a4b537645 | |||
32889d7052 | |||
4dd441e85d | |||
0fa40717e8 | |||
7e6552df5e | |||
4f08f7ddcb | |||
0a5c38d322 | |||
3cf05e8fb9 | |||
46bc4d6038 | |||
75f67f8c5c |
8
Cargo.lock
generated
8
Cargo.lock
generated
@ -635,7 +635,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "backend"
|
||||
version = "4.0.0-rc.3"
|
||||
version = "4.0.0"
|
||||
dependencies = [
|
||||
"aes-kw",
|
||||
"anyhow",
|
||||
@ -879,7 +879,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||
|
||||
[[package]]
|
||||
name = "chirpstack"
|
||||
version = "4.0.0-rc.3"
|
||||
version = "4.0.0"
|
||||
dependencies = [
|
||||
"aes 0.7.5",
|
||||
"anyhow",
|
||||
@ -958,7 +958,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "chirpstack_api"
|
||||
version = "4.0.0-rc.3"
|
||||
version = "4.0.0"
|
||||
dependencies = [
|
||||
"hex",
|
||||
"pbjson",
|
||||
@ -2222,7 +2222,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "lrwn"
|
||||
version = "4.0.0-rc.3"
|
||||
version = "4.0.0"
|
||||
dependencies = [
|
||||
"aes 0.7.5",
|
||||
"anyhow",
|
||||
|
4
Makefile
4
Makefile
@ -30,11 +30,11 @@ build-ui:
|
||||
|
||||
# Enters the devshell for ChirpStack development.
|
||||
devshell:
|
||||
docker-compose run --rm --service-ports chirpstack bash
|
||||
docker-compose run --rm --service-ports --name chirpstack chirpstack bash
|
||||
|
||||
# Enters the devshell for ChirpStack UI development.
|
||||
devshell-ui:
|
||||
docker-compose run --rm --service-ports chirpstack-ui bash
|
||||
docker-compose run --rm --service-ports --name chirpstack-ui chirpstack-ui bash
|
||||
|
||||
# Runs the tests
|
||||
test:
|
||||
|
2
api/grpc-web/package.json
vendored
2
api/grpc-web/package.json
vendored
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@chirpstack/chirpstack-api-grpc-web",
|
||||
"version": "4.0.0-rc.3",
|
||||
"version": "4.0.0",
|
||||
"description": "Chirpstack gRPC-web API",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
|
2
api/js/package.json
vendored
2
api/js/package.json
vendored
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@chirpstack/chirpstack-api",
|
||||
"version": "4.0.0-rc.3",
|
||||
"version": "4.0.0",
|
||||
"description": "Chirpstack JS and TS API",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
|
4
api/proto/api/tenant.proto
vendored
4
api/proto/api/tenant.proto
vendored
@ -189,6 +189,10 @@ message ListTenantsRequest {
|
||||
|
||||
// If set, the given string will be used to search on name.
|
||||
string search = 3;
|
||||
|
||||
// If set, filters the result set to the tenants of the user.
|
||||
// Only global API keys are able to filter by this field.
|
||||
string user_id = 4;
|
||||
}
|
||||
|
||||
message ListTenantsResponse {
|
||||
|
@ -189,6 +189,10 @@ message ListTenantsRequest {
|
||||
|
||||
// If set, the given string will be used to search on name.
|
||||
string search = 3;
|
||||
|
||||
// If set, filters the result set to the tenants of the user.
|
||||
// Only global API keys are able to filter by this field.
|
||||
string user_id = 4;
|
||||
}
|
||||
|
||||
message ListTenantsResponse {
|
||||
|
2
api/python/src/setup.py
vendored
2
api/python/src/setup.py
vendored
@ -18,7 +18,7 @@ CLASSIFIERS = [
|
||||
|
||||
setup(
|
||||
name='chirpstack-api',
|
||||
version = "4.0.0-rc.3",
|
||||
version = "4.0.0",
|
||||
url='https://github.com/brocaar/chirpstack-api',
|
||||
author='Orne Brocaar',
|
||||
author_email='info@brocaar.com',
|
||||
|
2
api/rust/Cargo.toml
vendored
2
api/rust/Cargo.toml
vendored
@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "chirpstack_api"
|
||||
description = "ChirpStack Protobuf / gRPC API definitions."
|
||||
version = "4.0.0-rc.3"
|
||||
version = "4.0.0"
|
||||
authors = ["Orne Brocaar <info@brocaar.com>"]
|
||||
license = "MIT"
|
||||
homepage = "https://www.chirpstack.io"
|
||||
|
4
api/rust/proto/chirpstack/api/tenant.proto
vendored
4
api/rust/proto/chirpstack/api/tenant.proto
vendored
@ -189,6 +189,10 @@ message ListTenantsRequest {
|
||||
|
||||
// If set, the given string will be used to search on name.
|
||||
string search = 3;
|
||||
|
||||
// If set, filters the result set to the tenants of the user.
|
||||
// Only global API keys are able to filter by this field.
|
||||
string user_id = 4;
|
||||
}
|
||||
|
||||
message ListTenantsResponse {
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "backend"
|
||||
version = "4.0.0-rc.3"
|
||||
version = "4.0.0"
|
||||
authors = ["Orne Brocaar <info@brocaar.com>"]
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
@ -528,7 +528,11 @@ pub struct BasePayloadResult {
|
||||
pub struct ResultPayload {
|
||||
#[serde(rename = "ResultCode")]
|
||||
pub result_code: ResultCode,
|
||||
#[serde(rename = "Description")]
|
||||
#[serde(
|
||||
default,
|
||||
rename = "Description",
|
||||
skip_serializing_if = "String::is_empty"
|
||||
)]
|
||||
pub description: String,
|
||||
}
|
||||
|
||||
@ -938,7 +942,12 @@ pub struct ULMetaData {
|
||||
pub f_ns_ul_token: Vec<u8>,
|
||||
#[serde(rename = "RecvTime")]
|
||||
pub recv_time: DateTime<Utc>,
|
||||
#[serde(default, rename = "RFRegion", skip_serializing_if = "String::is_empty")]
|
||||
#[serde(
|
||||
default,
|
||||
rename = "RFRegion",
|
||||
with = "rf_region_encode",
|
||||
skip_serializing_if = "String::is_empty"
|
||||
)]
|
||||
pub rf_region: String,
|
||||
#[serde(rename = "GWCnt")]
|
||||
pub gw_cnt: Option<usize>,
|
||||
|
@ -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.0.0-rc.3"
|
||||
version = "4.0.0"
|
||||
authors = ["Orne Brocaar <info@brocaar.com>"]
|
||||
edition = "2021"
|
||||
publish = false
|
||||
|
@ -70,6 +70,7 @@
|
||||
"as923_3",
|
||||
"as923_4",
|
||||
"au915_0",
|
||||
"cn470_10",
|
||||
"cn779",
|
||||
"eu433",
|
||||
"eu868",
|
||||
|
237
chirpstack/configuration/region_cn470_0.toml
Normal file
237
chirpstack/configuration/region_cn470_0.toml
Normal file
@ -0,0 +1,237 @@
|
||||
# This file contains an example CN470 example (channels 0-7).
|
||||
[[regions]]
|
||||
|
||||
# Name is an use-defined identifier for this region.
|
||||
name="cn470_0"
|
||||
|
||||
# Common-name refers to the common-name of this region as defined by
|
||||
# the LoRa Alliance.
|
||||
common_name="CN470"
|
||||
|
||||
|
||||
# Gateway configuration.
|
||||
[regions.gateway]
|
||||
|
||||
# Force gateways as private.
|
||||
#
|
||||
# If enabled, gateways can only be used by devices under the same tenant.
|
||||
force_gws_private=false
|
||||
|
||||
|
||||
# Gateway backend configuration.
|
||||
[regions.gateway.backend]
|
||||
|
||||
# The enabled backend type.
|
||||
enabled="mqtt"
|
||||
|
||||
# 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 }}"
|
||||
|
||||
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
|
||||
server="tcp://$MQTT_BROKER_HOST:1883"
|
||||
|
||||
# Connect with the given username (optional)
|
||||
username=""
|
||||
|
||||
# Connect with the given password (optional)
|
||||
password=""
|
||||
|
||||
# Quality of service level
|
||||
#
|
||||
# 0: at most once
|
||||
# 1: at least once
|
||||
# 2: exactly once
|
||||
#
|
||||
# Note: an increase of this value will decrease the performance.
|
||||
# For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels
|
||||
qos=0
|
||||
|
||||
# Clean session
|
||||
#
|
||||
# Set the "clean session" flag in the connect message when this client
|
||||
# connects to an MQTT broker. By setting this flag you are indicating
|
||||
# that no messages saved by the broker for this client should be delivered.
|
||||
clean_session=false
|
||||
|
||||
# Client ID
|
||||
#
|
||||
# Set the client id to be used by this client when connecting to the MQTT
|
||||
# broker. A client id must be no longer than 23 characters. If left blank,
|
||||
# a random id will be generated by ChirpStack.
|
||||
client_id=""
|
||||
|
||||
# CA certificate file (optional)
|
||||
#
|
||||
# Use this when setting up a secure connection (when server uses ssl://...)
|
||||
# but the certificate used by the server is not trusted by any CA certificate
|
||||
# on the server (e.g. when self generated).
|
||||
ca_cert=""
|
||||
|
||||
# TLS certificate file (optional)
|
||||
tls_cert=""
|
||||
|
||||
# TLS key file (optional)
|
||||
tls_key=""
|
||||
|
||||
|
||||
# Gateway channel configuration.
|
||||
#
|
||||
# Note: this configuration is only used in case the gateway is using the
|
||||
# ChirpStack Concentratord daemon. In any other case, this configuration
|
||||
# is ignored.
|
||||
[[regions.gateway.channels]]
|
||||
frequency=470300000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=470500000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=470700000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=470900000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=471100000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=471300000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=471500000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=471700000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
|
||||
# Region specific network configuration.
|
||||
[regions.network]
|
||||
|
||||
# Installation margin (dB) used by the ADR engine.
|
||||
#
|
||||
# A higher number means that the network-server will keep more margin,
|
||||
# resulting in a lower data-rate but decreasing the chance that the
|
||||
# device gets disconnected because it is unable to reach one of the
|
||||
# surrounded gateways.
|
||||
installation_margin=10
|
||||
|
||||
# RX window (Class-A).
|
||||
#
|
||||
# Set this to:
|
||||
# 0: RX1 / RX2
|
||||
# 1: RX1 only
|
||||
# 2: RX2 only
|
||||
rx_window=0
|
||||
|
||||
# RX1 delay (1 - 15 seconds).
|
||||
rx1_delay=1
|
||||
|
||||
# RX1 data-rate offset
|
||||
rx1_dr_offset=0
|
||||
|
||||
# RX2 data-rate
|
||||
rx2_dr=0
|
||||
|
||||
# RX2 frequency (Hz)
|
||||
rx2_frequency=505300000
|
||||
|
||||
# Prefer RX2 on RX1 data-rate less than.
|
||||
#
|
||||
# Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate
|
||||
# is smaller than the configured value, then the Network Server will
|
||||
# first try to schedule the downlink for RX2, failing that (e.g. the gateway
|
||||
# has already a payload scheduled at the RX2 timing) it will try RX1.
|
||||
rx2_prefer_on_rx1_dr_lt=0
|
||||
|
||||
# Prefer RX2 on link budget.
|
||||
#
|
||||
# When the link-budget is better for RX2 than for RX1, the Network Server will first
|
||||
# try to schedule the downlink in RX2, failing that it will try RX1.
|
||||
rx2_prefer_on_link_budget=false
|
||||
|
||||
# Downlink TX Power (dBm)
|
||||
#
|
||||
# When set to -1, the downlink TX Power from the configured band will
|
||||
# be used.
|
||||
#
|
||||
# Please consult the LoRaWAN Regional Parameters and local regulations
|
||||
# for valid and legal options. Note that the configured TX Power must be
|
||||
# supported by your gateway(s).
|
||||
downlink_tx_power=-1
|
||||
|
||||
# ADR is disabled.
|
||||
adr_disabled=false
|
||||
|
||||
# Minimum data-rate.
|
||||
min_dr=0
|
||||
|
||||
# Maximum data-rate.
|
||||
max_dr=5
|
||||
|
||||
# Enabled uplink channels.
|
||||
#
|
||||
# Use this when ony a sub-set of the by default enabled channels are being
|
||||
# used. For example when only using the first 8 channels of the US band.
|
||||
# Note: when left blank / empty array, all channels will be enabled.
|
||||
enabled_uplink_channels=[0, 1, 2, 3, 4, 5, 6, 7]
|
||||
|
||||
|
||||
# Rejoin-request configuration (LoRaWAN 1.1)
|
||||
[regions.network.rejoin_request]
|
||||
|
||||
# Request devices to periodically send rejoin-requests.
|
||||
enabled=false
|
||||
|
||||
# The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4)
|
||||
# uplink messages. Valid values are 0 to 15.
|
||||
max_count_n=0
|
||||
|
||||
# The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10)
|
||||
# seconds. Valid values are 0 to 15.
|
||||
#
|
||||
# 0 = roughly 17 minutes
|
||||
# 15 = about 1 year
|
||||
max_time_n=0
|
||||
|
||||
|
||||
# Class-B configuration.
|
||||
[regions.network.class_b]
|
||||
|
||||
# Ping-slot data-rate.
|
||||
ping_slot_dr=0
|
||||
|
||||
# Ping-slot frequency (Hz)
|
||||
#
|
||||
# set this to 0 to use the default frequency plan for the configured region
|
||||
# (which could be frequency hopping).
|
||||
ping_slot_frequency=0
|
237
chirpstack/configuration/region_cn470_1.toml
Normal file
237
chirpstack/configuration/region_cn470_1.toml
Normal file
@ -0,0 +1,237 @@
|
||||
# This file contains an example CN470 example (channels 8-15).
|
||||
[[regions]]
|
||||
|
||||
# Name is an use-defined identifier for this region.
|
||||
name="cn470_1"
|
||||
|
||||
# Common-name refers to the common-name of this region as defined by
|
||||
# the LoRa Alliance.
|
||||
common_name="CN470"
|
||||
|
||||
|
||||
# Gateway configuration.
|
||||
[regions.gateway]
|
||||
|
||||
# Force gateways as private.
|
||||
#
|
||||
# If enabled, gateways can only be used by devices under the same tenant.
|
||||
force_gws_private=false
|
||||
|
||||
|
||||
# Gateway backend configuration.
|
||||
[regions.gateway.backend]
|
||||
|
||||
# The enabled backend type.
|
||||
enabled="mqtt"
|
||||
|
||||
# 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 }}"
|
||||
|
||||
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
|
||||
server="tcp://$MQTT_BROKER_HOST:1883"
|
||||
|
||||
# Connect with the given username (optional)
|
||||
username=""
|
||||
|
||||
# Connect with the given password (optional)
|
||||
password=""
|
||||
|
||||
# Quality of service level
|
||||
#
|
||||
# 0: at most once
|
||||
# 1: at least once
|
||||
# 2: exactly once
|
||||
#
|
||||
# Note: an increase of this value will decrease the performance.
|
||||
# For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels
|
||||
qos=0
|
||||
|
||||
# Clean session
|
||||
#
|
||||
# Set the "clean session" flag in the connect message when this client
|
||||
# connects to an MQTT broker. By setting this flag you are indicating
|
||||
# that no messages saved by the broker for this client should be delivered.
|
||||
clean_session=false
|
||||
|
||||
# Client ID
|
||||
#
|
||||
# Set the client id to be used by this client when connecting to the MQTT
|
||||
# broker. A client id must be no longer than 23 characters. If left blank,
|
||||
# a random id will be generated by ChirpStack.
|
||||
client_id=""
|
||||
|
||||
# CA certificate file (optional)
|
||||
#
|
||||
# Use this when setting up a secure connection (when server uses ssl://...)
|
||||
# but the certificate used by the server is not trusted by any CA certificate
|
||||
# on the server (e.g. when self generated).
|
||||
ca_cert=""
|
||||
|
||||
# TLS certificate file (optional)
|
||||
tls_cert=""
|
||||
|
||||
# TLS key file (optional)
|
||||
tls_key=""
|
||||
|
||||
|
||||
# Gateway channel configuration.
|
||||
#
|
||||
# Note: this configuration is only used in case the gateway is using the
|
||||
# ChirpStack Concentratord daemon. In any other case, this configuration
|
||||
# is ignored.
|
||||
[[regions.gateway.channels]]
|
||||
frequency=471900000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=472100000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=472300000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=472500000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=472700000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=472900000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=473100000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=473300000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
|
||||
# Region specific network configuration.
|
||||
[regions.network]
|
||||
|
||||
# Installation margin (dB) used by the ADR engine.
|
||||
#
|
||||
# A higher number means that the network-server will keep more margin,
|
||||
# resulting in a lower data-rate but decreasing the chance that the
|
||||
# device gets disconnected because it is unable to reach one of the
|
||||
# surrounded gateways.
|
||||
installation_margin=10
|
||||
|
||||
# RX window (Class-A).
|
||||
#
|
||||
# Set this to:
|
||||
# 0: RX1 / RX2
|
||||
# 1: RX1 only
|
||||
# 2: RX2 only
|
||||
rx_window=0
|
||||
|
||||
# RX1 delay (1 - 15 seconds).
|
||||
rx1_delay=1
|
||||
|
||||
# RX1 data-rate offset
|
||||
rx1_dr_offset=0
|
||||
|
||||
# RX2 data-rate
|
||||
rx2_dr=0
|
||||
|
||||
# RX2 frequency (Hz)
|
||||
rx2_frequency=505300000
|
||||
|
||||
# Prefer RX2 on RX1 data-rate less than.
|
||||
#
|
||||
# Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate
|
||||
# is smaller than the configured value, then the Network Server will
|
||||
# first try to schedule the downlink for RX2, failing that (e.g. the gateway
|
||||
# has already a payload scheduled at the RX2 timing) it will try RX1.
|
||||
rx2_prefer_on_rx1_dr_lt=0
|
||||
|
||||
# Prefer RX2 on link budget.
|
||||
#
|
||||
# When the link-budget is better for RX2 than for RX1, the Network Server will first
|
||||
# try to schedule the downlink in RX2, failing that it will try RX1.
|
||||
rx2_prefer_on_link_budget=false
|
||||
|
||||
# Downlink TX Power (dBm)
|
||||
#
|
||||
# When set to -1, the downlink TX Power from the configured band will
|
||||
# be used.
|
||||
#
|
||||
# Please consult the LoRaWAN Regional Parameters and local regulations
|
||||
# for valid and legal options. Note that the configured TX Power must be
|
||||
# supported by your gateway(s).
|
||||
downlink_tx_power=-1
|
||||
|
||||
# ADR is disabled.
|
||||
adr_disabled=false
|
||||
|
||||
# Minimum data-rate.
|
||||
min_dr=0
|
||||
|
||||
# Maximum data-rate.
|
||||
max_dr=5
|
||||
|
||||
# Enabled uplink channels.
|
||||
#
|
||||
# Use this when ony a sub-set of the by default enabled channels are being
|
||||
# used. For example when only using the first 8 channels of the US band.
|
||||
# Note: when left blank / empty array, all channels will be enabled.
|
||||
enabled_uplink_channels=[8, 9, 10, 11, 12, 13, 14, 15]
|
||||
|
||||
|
||||
# Rejoin-request configuration (LoRaWAN 1.1)
|
||||
[regions.network.rejoin_request]
|
||||
|
||||
# Request devices to periodically send rejoin-requests.
|
||||
enabled=false
|
||||
|
||||
# The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4)
|
||||
# uplink messages. Valid values are 0 to 15.
|
||||
max_count_n=0
|
||||
|
||||
# The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10)
|
||||
# seconds. Valid values are 0 to 15.
|
||||
#
|
||||
# 0 = roughly 17 minutes
|
||||
# 15 = about 1 year
|
||||
max_time_n=0
|
||||
|
||||
|
||||
# Class-B configuration.
|
||||
[regions.network.class_b]
|
||||
|
||||
# Ping-slot data-rate.
|
||||
ping_slot_dr=0
|
||||
|
||||
# Ping-slot frequency (Hz)
|
||||
#
|
||||
# set this to 0 to use the default frequency plan for the configured region
|
||||
# (which could be frequency hopping).
|
||||
ping_slot_frequency=0
|
237
chirpstack/configuration/region_cn470_10.toml
Normal file
237
chirpstack/configuration/region_cn470_10.toml
Normal file
@ -0,0 +1,237 @@
|
||||
# This file contains an example CN470 example (channels 80-87).
|
||||
[[regions]]
|
||||
|
||||
# Name is an use-defined identifier for this region.
|
||||
name="cn470_10"
|
||||
|
||||
# Common-name refers to the common-name of this region as defined by
|
||||
# the LoRa Alliance.
|
||||
common_name="CN470"
|
||||
|
||||
|
||||
# Gateway configuration.
|
||||
[regions.gateway]
|
||||
|
||||
# Force gateways as private.
|
||||
#
|
||||
# If enabled, gateways can only be used by devices under the same tenant.
|
||||
force_gws_private=false
|
||||
|
||||
|
||||
# Gateway backend configuration.
|
||||
[regions.gateway.backend]
|
||||
|
||||
# The enabled backend type.
|
||||
enabled="mqtt"
|
||||
|
||||
# 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 }}"
|
||||
|
||||
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
|
||||
server="tcp://$MQTT_BROKER_HOST:1883"
|
||||
|
||||
# Connect with the given username (optional)
|
||||
username=""
|
||||
|
||||
# Connect with the given password (optional)
|
||||
password=""
|
||||
|
||||
# Quality of service level
|
||||
#
|
||||
# 0: at most once
|
||||
# 1: at least once
|
||||
# 2: exactly once
|
||||
#
|
||||
# Note: an increase of this value will decrease the performance.
|
||||
# For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels
|
||||
qos=0
|
||||
|
||||
# Clean session
|
||||
#
|
||||
# Set the "clean session" flag in the connect message when this client
|
||||
# connects to an MQTT broker. By setting this flag you are indicating
|
||||
# that no messages saved by the broker for this client should be delivered.
|
||||
clean_session=false
|
||||
|
||||
# Client ID
|
||||
#
|
||||
# Set the client id to be used by this client when connecting to the MQTT
|
||||
# broker. A client id must be no longer than 23 characters. If left blank,
|
||||
# a random id will be generated by ChirpStack.
|
||||
client_id=""
|
||||
|
||||
# CA certificate file (optional)
|
||||
#
|
||||
# Use this when setting up a secure connection (when server uses ssl://...)
|
||||
# but the certificate used by the server is not trusted by any CA certificate
|
||||
# on the server (e.g. when self generated).
|
||||
ca_cert=""
|
||||
|
||||
# TLS certificate file (optional)
|
||||
tls_cert=""
|
||||
|
||||
# TLS key file (optional)
|
||||
tls_key=""
|
||||
|
||||
|
||||
# Gateway channel configuration.
|
||||
#
|
||||
# Note: this configuration is only used in case the gateway is using the
|
||||
# ChirpStack Concentratord daemon. In any other case, this configuration
|
||||
# is ignored.
|
||||
[[regions.gateway.channels]]
|
||||
frequency=486300000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=486500000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=486700000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=486900000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=487100000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=487300000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=487500000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=487700000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
|
||||
# Region specific network configuration.
|
||||
[regions.network]
|
||||
|
||||
# Installation margin (dB) used by the ADR engine.
|
||||
#
|
||||
# A higher number means that the network-server will keep more margin,
|
||||
# resulting in a lower data-rate but decreasing the chance that the
|
||||
# device gets disconnected because it is unable to reach one of the
|
||||
# surrounded gateways.
|
||||
installation_margin=10
|
||||
|
||||
# RX window (Class-A).
|
||||
#
|
||||
# Set this to:
|
||||
# 0: RX1 / RX2
|
||||
# 1: RX1 only
|
||||
# 2: RX2 only
|
||||
rx_window=0
|
||||
|
||||
# RX1 delay (1 - 15 seconds).
|
||||
rx1_delay=1
|
||||
|
||||
# RX1 data-rate offset
|
||||
rx1_dr_offset=0
|
||||
|
||||
# RX2 data-rate
|
||||
rx2_dr=0
|
||||
|
||||
# RX2 frequency (Hz)
|
||||
rx2_frequency=505300000
|
||||
|
||||
# Prefer RX2 on RX1 data-rate less than.
|
||||
#
|
||||
# Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate
|
||||
# is smaller than the configured value, then the Network Server will
|
||||
# first try to schedule the downlink for RX2, failing that (e.g. the gateway
|
||||
# has already a payload scheduled at the RX2 timing) it will try RX1.
|
||||
rx2_prefer_on_rx1_dr_lt=0
|
||||
|
||||
# Prefer RX2 on link budget.
|
||||
#
|
||||
# When the link-budget is better for RX2 than for RX1, the Network Server will first
|
||||
# try to schedule the downlink in RX2, failing that it will try RX1.
|
||||
rx2_prefer_on_link_budget=false
|
||||
|
||||
# Downlink TX Power (dBm)
|
||||
#
|
||||
# When set to -1, the downlink TX Power from the configured band will
|
||||
# be used.
|
||||
#
|
||||
# Please consult the LoRaWAN Regional Parameters and local regulations
|
||||
# for valid and legal options. Note that the configured TX Power must be
|
||||
# supported by your gateway(s).
|
||||
downlink_tx_power=-1
|
||||
|
||||
# ADR is disabled.
|
||||
adr_disabled=false
|
||||
|
||||
# Minimum data-rate.
|
||||
min_dr=0
|
||||
|
||||
# Maximum data-rate.
|
||||
max_dr=5
|
||||
|
||||
# Enabled uplink channels.
|
||||
#
|
||||
# Use this when ony a sub-set of the by default enabled channels are being
|
||||
# used. For example when only using the first 8 channels of the US band.
|
||||
# Note: when left blank / empty array, all channels will be enabled.
|
||||
enabled_uplink_channels=[80, 81, 82, 83, 84, 85, 86, 87]
|
||||
|
||||
|
||||
# Rejoin-request configuration (LoRaWAN 1.1)
|
||||
[regions.network.rejoin_request]
|
||||
|
||||
# Request devices to periodically send rejoin-requests.
|
||||
enabled=false
|
||||
|
||||
# The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4)
|
||||
# uplink messages. Valid values are 0 to 15.
|
||||
max_count_n=0
|
||||
|
||||
# The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10)
|
||||
# seconds. Valid values are 0 to 15.
|
||||
#
|
||||
# 0 = roughly 17 minutes
|
||||
# 15 = about 1 year
|
||||
max_time_n=0
|
||||
|
||||
|
||||
# Class-B configuration.
|
||||
[regions.network.class_b]
|
||||
|
||||
# Ping-slot data-rate.
|
||||
ping_slot_dr=0
|
||||
|
||||
# Ping-slot frequency (Hz)
|
||||
#
|
||||
# set this to 0 to use the default frequency plan for the configured region
|
||||
# (which could be frequency hopping).
|
||||
ping_slot_frequency=0
|
237
chirpstack/configuration/region_cn470_11.toml
Normal file
237
chirpstack/configuration/region_cn470_11.toml
Normal file
@ -0,0 +1,237 @@
|
||||
# This file contains an example CN470 example (channels 88-95).
|
||||
[[regions]]
|
||||
|
||||
# Name is an use-defined identifier for this region.
|
||||
name="cn470_11"
|
||||
|
||||
# Common-name refers to the common-name of this region as defined by
|
||||
# the LoRa Alliance.
|
||||
common_name="CN470"
|
||||
|
||||
|
||||
# Gateway configuration.
|
||||
[regions.gateway]
|
||||
|
||||
# Force gateways as private.
|
||||
#
|
||||
# If enabled, gateways can only be used by devices under the same tenant.
|
||||
force_gws_private=false
|
||||
|
||||
|
||||
# Gateway backend configuration.
|
||||
[regions.gateway.backend]
|
||||
|
||||
# The enabled backend type.
|
||||
enabled="mqtt"
|
||||
|
||||
# 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 }}"
|
||||
|
||||
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
|
||||
server="tcp://$MQTT_BROKER_HOST:1883"
|
||||
|
||||
# Connect with the given username (optional)
|
||||
username=""
|
||||
|
||||
# Connect with the given password (optional)
|
||||
password=""
|
||||
|
||||
# Quality of service level
|
||||
#
|
||||
# 0: at most once
|
||||
# 1: at least once
|
||||
# 2: exactly once
|
||||
#
|
||||
# Note: an increase of this value will decrease the performance.
|
||||
# For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels
|
||||
qos=0
|
||||
|
||||
# Clean session
|
||||
#
|
||||
# Set the "clean session" flag in the connect message when this client
|
||||
# connects to an MQTT broker. By setting this flag you are indicating
|
||||
# that no messages saved by the broker for this client should be delivered.
|
||||
clean_session=false
|
||||
|
||||
# Client ID
|
||||
#
|
||||
# Set the client id to be used by this client when connecting to the MQTT
|
||||
# broker. A client id must be no longer than 23 characters. If left blank,
|
||||
# a random id will be generated by ChirpStack.
|
||||
client_id=""
|
||||
|
||||
# CA certificate file (optional)
|
||||
#
|
||||
# Use this when setting up a secure connection (when server uses ssl://...)
|
||||
# but the certificate used by the server is not trusted by any CA certificate
|
||||
# on the server (e.g. when self generated).
|
||||
ca_cert=""
|
||||
|
||||
# TLS certificate file (optional)
|
||||
tls_cert=""
|
||||
|
||||
# TLS key file (optional)
|
||||
tls_key=""
|
||||
|
||||
|
||||
# Gateway channel configuration.
|
||||
#
|
||||
# Note: this configuration is only used in case the gateway is using the
|
||||
# ChirpStack Concentratord daemon. In any other case, this configuration
|
||||
# is ignored.
|
||||
[[regions.gateway.channels]]
|
||||
frequency=487900000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=488100000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=488300000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=488500000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=488700000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=488900000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=489100000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=489300000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
|
||||
# Region specific network configuration.
|
||||
[regions.network]
|
||||
|
||||
# Installation margin (dB) used by the ADR engine.
|
||||
#
|
||||
# A higher number means that the network-server will keep more margin,
|
||||
# resulting in a lower data-rate but decreasing the chance that the
|
||||
# device gets disconnected because it is unable to reach one of the
|
||||
# surrounded gateways.
|
||||
installation_margin=10
|
||||
|
||||
# RX window (Class-A).
|
||||
#
|
||||
# Set this to:
|
||||
# 0: RX1 / RX2
|
||||
# 1: RX1 only
|
||||
# 2: RX2 only
|
||||
rx_window=0
|
||||
|
||||
# RX1 delay (1 - 15 seconds).
|
||||
rx1_delay=1
|
||||
|
||||
# RX1 data-rate offset
|
||||
rx1_dr_offset=0
|
||||
|
||||
# RX2 data-rate
|
||||
rx2_dr=0
|
||||
|
||||
# RX2 frequency (Hz)
|
||||
rx2_frequency=505300000
|
||||
|
||||
# Prefer RX2 on RX1 data-rate less than.
|
||||
#
|
||||
# Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate
|
||||
# is smaller than the configured value, then the Network Server will
|
||||
# first try to schedule the downlink for RX2, failing that (e.g. the gateway
|
||||
# has already a payload scheduled at the RX2 timing) it will try RX1.
|
||||
rx2_prefer_on_rx1_dr_lt=0
|
||||
|
||||
# Prefer RX2 on link budget.
|
||||
#
|
||||
# When the link-budget is better for RX2 than for RX1, the Network Server will first
|
||||
# try to schedule the downlink in RX2, failing that it will try RX1.
|
||||
rx2_prefer_on_link_budget=false
|
||||
|
||||
# Downlink TX Power (dBm)
|
||||
#
|
||||
# When set to -1, the downlink TX Power from the configured band will
|
||||
# be used.
|
||||
#
|
||||
# Please consult the LoRaWAN Regional Parameters and local regulations
|
||||
# for valid and legal options. Note that the configured TX Power must be
|
||||
# supported by your gateway(s).
|
||||
downlink_tx_power=-1
|
||||
|
||||
# ADR is disabled.
|
||||
adr_disabled=false
|
||||
|
||||
# Minimum data-rate.
|
||||
min_dr=0
|
||||
|
||||
# Maximum data-rate.
|
||||
max_dr=5
|
||||
|
||||
# Enabled uplink channels.
|
||||
#
|
||||
# Use this when ony a sub-set of the by default enabled channels are being
|
||||
# used. For example when only using the first 8 channels of the US band.
|
||||
# Note: when left blank / empty array, all channels will be enabled.
|
||||
enabled_uplink_channels=[88, 89, 90, 91, 92, 93, 94, 95]
|
||||
|
||||
|
||||
# Rejoin-request configuration (LoRaWAN 1.1)
|
||||
[regions.network.rejoin_request]
|
||||
|
||||
# Request devices to periodically send rejoin-requests.
|
||||
enabled=false
|
||||
|
||||
# The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4)
|
||||
# uplink messages. Valid values are 0 to 15.
|
||||
max_count_n=0
|
||||
|
||||
# The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10)
|
||||
# seconds. Valid values are 0 to 15.
|
||||
#
|
||||
# 0 = roughly 17 minutes
|
||||
# 15 = about 1 year
|
||||
max_time_n=0
|
||||
|
||||
|
||||
# Class-B configuration.
|
||||
[regions.network.class_b]
|
||||
|
||||
# Ping-slot data-rate.
|
||||
ping_slot_dr=0
|
||||
|
||||
# Ping-slot frequency (Hz)
|
||||
#
|
||||
# set this to 0 to use the default frequency plan for the configured region
|
||||
# (which could be frequency hopping).
|
||||
ping_slot_frequency=0
|
237
chirpstack/configuration/region_cn470_2.toml
Normal file
237
chirpstack/configuration/region_cn470_2.toml
Normal file
@ -0,0 +1,237 @@
|
||||
# This file contains an example CN470 example (channels 16-23).
|
||||
[[regions]]
|
||||
|
||||
# Name is an use-defined identifier for this region.
|
||||
name="cn470_2"
|
||||
|
||||
# Common-name refers to the common-name of this region as defined by
|
||||
# the LoRa Alliance.
|
||||
common_name="CN470"
|
||||
|
||||
|
||||
# Gateway configuration.
|
||||
[regions.gateway]
|
||||
|
||||
# Force gateways as private.
|
||||
#
|
||||
# If enabled, gateways can only be used by devices under the same tenant.
|
||||
force_gws_private=false
|
||||
|
||||
|
||||
# Gateway backend configuration.
|
||||
[regions.gateway.backend]
|
||||
|
||||
# The enabled backend type.
|
||||
enabled="mqtt"
|
||||
|
||||
# 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 }}"
|
||||
|
||||
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
|
||||
server="tcp://$MQTT_BROKER_HOST:1883"
|
||||
|
||||
# Connect with the given username (optional)
|
||||
username=""
|
||||
|
||||
# Connect with the given password (optional)
|
||||
password=""
|
||||
|
||||
# Quality of service level
|
||||
#
|
||||
# 0: at most once
|
||||
# 1: at least once
|
||||
# 2: exactly once
|
||||
#
|
||||
# Note: an increase of this value will decrease the performance.
|
||||
# For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels
|
||||
qos=0
|
||||
|
||||
# Clean session
|
||||
#
|
||||
# Set the "clean session" flag in the connect message when this client
|
||||
# connects to an MQTT broker. By setting this flag you are indicating
|
||||
# that no messages saved by the broker for this client should be delivered.
|
||||
clean_session=false
|
||||
|
||||
# Client ID
|
||||
#
|
||||
# Set the client id to be used by this client when connecting to the MQTT
|
||||
# broker. A client id must be no longer than 23 characters. If left blank,
|
||||
# a random id will be generated by ChirpStack.
|
||||
client_id=""
|
||||
|
||||
# CA certificate file (optional)
|
||||
#
|
||||
# Use this when setting up a secure connection (when server uses ssl://...)
|
||||
# but the certificate used by the server is not trusted by any CA certificate
|
||||
# on the server (e.g. when self generated).
|
||||
ca_cert=""
|
||||
|
||||
# TLS certificate file (optional)
|
||||
tls_cert=""
|
||||
|
||||
# TLS key file (optional)
|
||||
tls_key=""
|
||||
|
||||
|
||||
# Gateway channel configuration.
|
||||
#
|
||||
# Note: this configuration is only used in case the gateway is using the
|
||||
# ChirpStack Concentratord daemon. In any other case, this configuration
|
||||
# is ignored.
|
||||
[[regions.gateway.channels]]
|
||||
frequency=473500000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=473700000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=473900000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=474100000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=474300000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=474500000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=474700000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=474900000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
|
||||
# Region specific network configuration.
|
||||
[regions.network]
|
||||
|
||||
# Installation margin (dB) used by the ADR engine.
|
||||
#
|
||||
# A higher number means that the network-server will keep more margin,
|
||||
# resulting in a lower data-rate but decreasing the chance that the
|
||||
# device gets disconnected because it is unable to reach one of the
|
||||
# surrounded gateways.
|
||||
installation_margin=10
|
||||
|
||||
# RX window (Class-A).
|
||||
#
|
||||
# Set this to:
|
||||
# 0: RX1 / RX2
|
||||
# 1: RX1 only
|
||||
# 2: RX2 only
|
||||
rx_window=0
|
||||
|
||||
# RX1 delay (1 - 15 seconds).
|
||||
rx1_delay=1
|
||||
|
||||
# RX1 data-rate offset
|
||||
rx1_dr_offset=0
|
||||
|
||||
# RX2 data-rate
|
||||
rx2_dr=0
|
||||
|
||||
# RX2 frequency (Hz)
|
||||
rx2_frequency=505300000
|
||||
|
||||
# Prefer RX2 on RX1 data-rate less than.
|
||||
#
|
||||
# Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate
|
||||
# is smaller than the configured value, then the Network Server will
|
||||
# first try to schedule the downlink for RX2, failing that (e.g. the gateway
|
||||
# has already a payload scheduled at the RX2 timing) it will try RX1.
|
||||
rx2_prefer_on_rx1_dr_lt=0
|
||||
|
||||
# Prefer RX2 on link budget.
|
||||
#
|
||||
# When the link-budget is better for RX2 than for RX1, the Network Server will first
|
||||
# try to schedule the downlink in RX2, failing that it will try RX1.
|
||||
rx2_prefer_on_link_budget=false
|
||||
|
||||
# Downlink TX Power (dBm)
|
||||
#
|
||||
# When set to -1, the downlink TX Power from the configured band will
|
||||
# be used.
|
||||
#
|
||||
# Please consult the LoRaWAN Regional Parameters and local regulations
|
||||
# for valid and legal options. Note that the configured TX Power must be
|
||||
# supported by your gateway(s).
|
||||
downlink_tx_power=-1
|
||||
|
||||
# ADR is disabled.
|
||||
adr_disabled=false
|
||||
|
||||
# Minimum data-rate.
|
||||
min_dr=0
|
||||
|
||||
# Maximum data-rate.
|
||||
max_dr=5
|
||||
|
||||
# Enabled uplink channels.
|
||||
#
|
||||
# Use this when ony a sub-set of the by default enabled channels are being
|
||||
# used. For example when only using the first 8 channels of the US band.
|
||||
# Note: when left blank / empty array, all channels will be enabled.
|
||||
enabled_uplink_channels=[16, 17, 18, 19, 20, 21, 22, 23]
|
||||
|
||||
|
||||
# Rejoin-request configuration (LoRaWAN 1.1)
|
||||
[regions.network.rejoin_request]
|
||||
|
||||
# Request devices to periodically send rejoin-requests.
|
||||
enabled=false
|
||||
|
||||
# The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4)
|
||||
# uplink messages. Valid values are 0 to 15.
|
||||
max_count_n=0
|
||||
|
||||
# The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10)
|
||||
# seconds. Valid values are 0 to 15.
|
||||
#
|
||||
# 0 = roughly 17 minutes
|
||||
# 15 = about 1 year
|
||||
max_time_n=0
|
||||
|
||||
|
||||
# Class-B configuration.
|
||||
[regions.network.class_b]
|
||||
|
||||
# Ping-slot data-rate.
|
||||
ping_slot_dr=0
|
||||
|
||||
# Ping-slot frequency (Hz)
|
||||
#
|
||||
# set this to 0 to use the default frequency plan for the configured region
|
||||
# (which could be frequency hopping).
|
||||
ping_slot_frequency=0
|
237
chirpstack/configuration/region_cn470_3.toml
Normal file
237
chirpstack/configuration/region_cn470_3.toml
Normal file
@ -0,0 +1,237 @@
|
||||
# This file contains an example CN470 example (channels 24-31).
|
||||
[[regions]]
|
||||
|
||||
# Name is an use-defined identifier for this region.
|
||||
name="cn470_3"
|
||||
|
||||
# Common-name refers to the common-name of this region as defined by
|
||||
# the LoRa Alliance.
|
||||
common_name="CN470"
|
||||
|
||||
|
||||
# Gateway configuration.
|
||||
[regions.gateway]
|
||||
|
||||
# Force gateways as private.
|
||||
#
|
||||
# If enabled, gateways can only be used by devices under the same tenant.
|
||||
force_gws_private=false
|
||||
|
||||
|
||||
# Gateway backend configuration.
|
||||
[regions.gateway.backend]
|
||||
|
||||
# The enabled backend type.
|
||||
enabled="mqtt"
|
||||
|
||||
# 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 }}"
|
||||
|
||||
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
|
||||
server="tcp://$MQTT_BROKER_HOST:1883"
|
||||
|
||||
# Connect with the given username (optional)
|
||||
username=""
|
||||
|
||||
# Connect with the given password (optional)
|
||||
password=""
|
||||
|
||||
# Quality of service level
|
||||
#
|
||||
# 0: at most once
|
||||
# 1: at least once
|
||||
# 2: exactly once
|
||||
#
|
||||
# Note: an increase of this value will decrease the performance.
|
||||
# For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels
|
||||
qos=0
|
||||
|
||||
# Clean session
|
||||
#
|
||||
# Set the "clean session" flag in the connect message when this client
|
||||
# connects to an MQTT broker. By setting this flag you are indicating
|
||||
# that no messages saved by the broker for this client should be delivered.
|
||||
clean_session=false
|
||||
|
||||
# Client ID
|
||||
#
|
||||
# Set the client id to be used by this client when connecting to the MQTT
|
||||
# broker. A client id must be no longer than 23 characters. If left blank,
|
||||
# a random id will be generated by ChirpStack.
|
||||
client_id=""
|
||||
|
||||
# CA certificate file (optional)
|
||||
#
|
||||
# Use this when setting up a secure connection (when server uses ssl://...)
|
||||
# but the certificate used by the server is not trusted by any CA certificate
|
||||
# on the server (e.g. when self generated).
|
||||
ca_cert=""
|
||||
|
||||
# TLS certificate file (optional)
|
||||
tls_cert=""
|
||||
|
||||
# TLS key file (optional)
|
||||
tls_key=""
|
||||
|
||||
|
||||
# Gateway channel configuration.
|
||||
#
|
||||
# Note: this configuration is only used in case the gateway is using the
|
||||
# ChirpStack Concentratord daemon. In any other case, this configuration
|
||||
# is ignored.
|
||||
[[regions.gateway.channels]]
|
||||
frequency=475100000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=475300000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=475500000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=475700000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=475900000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=476100000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=476300000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=476500000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
|
||||
# Region specific network configuration.
|
||||
[regions.network]
|
||||
|
||||
# Installation margin (dB) used by the ADR engine.
|
||||
#
|
||||
# A higher number means that the network-server will keep more margin,
|
||||
# resulting in a lower data-rate but decreasing the chance that the
|
||||
# device gets disconnected because it is unable to reach one of the
|
||||
# surrounded gateways.
|
||||
installation_margin=10
|
||||
|
||||
# RX window (Class-A).
|
||||
#
|
||||
# Set this to:
|
||||
# 0: RX1 / RX2
|
||||
# 1: RX1 only
|
||||
# 2: RX2 only
|
||||
rx_window=0
|
||||
|
||||
# RX1 delay (1 - 15 seconds).
|
||||
rx1_delay=1
|
||||
|
||||
# RX1 data-rate offset
|
||||
rx1_dr_offset=0
|
||||
|
||||
# RX2 data-rate
|
||||
rx2_dr=0
|
||||
|
||||
# RX2 frequency (Hz)
|
||||
rx2_frequency=505300000
|
||||
|
||||
# Prefer RX2 on RX1 data-rate less than.
|
||||
#
|
||||
# Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate
|
||||
# is smaller than the configured value, then the Network Server will
|
||||
# first try to schedule the downlink for RX2, failing that (e.g. the gateway
|
||||
# has already a payload scheduled at the RX2 timing) it will try RX1.
|
||||
rx2_prefer_on_rx1_dr_lt=0
|
||||
|
||||
# Prefer RX2 on link budget.
|
||||
#
|
||||
# When the link-budget is better for RX2 than for RX1, the Network Server will first
|
||||
# try to schedule the downlink in RX2, failing that it will try RX1.
|
||||
rx2_prefer_on_link_budget=false
|
||||
|
||||
# Downlink TX Power (dBm)
|
||||
#
|
||||
# When set to -1, the downlink TX Power from the configured band will
|
||||
# be used.
|
||||
#
|
||||
# Please consult the LoRaWAN Regional Parameters and local regulations
|
||||
# for valid and legal options. Note that the configured TX Power must be
|
||||
# supported by your gateway(s).
|
||||
downlink_tx_power=-1
|
||||
|
||||
# ADR is disabled.
|
||||
adr_disabled=false
|
||||
|
||||
# Minimum data-rate.
|
||||
min_dr=0
|
||||
|
||||
# Maximum data-rate.
|
||||
max_dr=5
|
||||
|
||||
# Enabled uplink channels.
|
||||
#
|
||||
# Use this when ony a sub-set of the by default enabled channels are being
|
||||
# used. For example when only using the first 8 channels of the US band.
|
||||
# Note: when left blank / empty array, all channels will be enabled.
|
||||
enabled_uplink_channels=[24, 25, 26, 27, 28, 29, 30, 31]
|
||||
|
||||
|
||||
# Rejoin-request configuration (LoRaWAN 1.1)
|
||||
[regions.network.rejoin_request]
|
||||
|
||||
# Request devices to periodically send rejoin-requests.
|
||||
enabled=false
|
||||
|
||||
# The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4)
|
||||
# uplink messages. Valid values are 0 to 15.
|
||||
max_count_n=0
|
||||
|
||||
# The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10)
|
||||
# seconds. Valid values are 0 to 15.
|
||||
#
|
||||
# 0 = roughly 17 minutes
|
||||
# 15 = about 1 year
|
||||
max_time_n=0
|
||||
|
||||
|
||||
# Class-B configuration.
|
||||
[regions.network.class_b]
|
||||
|
||||
# Ping-slot data-rate.
|
||||
ping_slot_dr=0
|
||||
|
||||
# Ping-slot frequency (Hz)
|
||||
#
|
||||
# set this to 0 to use the default frequency plan for the configured region
|
||||
# (which could be frequency hopping).
|
||||
ping_slot_frequency=0
|
237
chirpstack/configuration/region_cn470_4.toml
Normal file
237
chirpstack/configuration/region_cn470_4.toml
Normal file
@ -0,0 +1,237 @@
|
||||
# This file contains an example CN470 example (channels 32-39).
|
||||
[[regions]]
|
||||
|
||||
# Name is an use-defined identifier for this region.
|
||||
name="cn470_4"
|
||||
|
||||
# Common-name refers to the common-name of this region as defined by
|
||||
# the LoRa Alliance.
|
||||
common_name="CN470"
|
||||
|
||||
|
||||
# Gateway configuration.
|
||||
[regions.gateway]
|
||||
|
||||
# Force gateways as private.
|
||||
#
|
||||
# If enabled, gateways can only be used by devices under the same tenant.
|
||||
force_gws_private=false
|
||||
|
||||
|
||||
# Gateway backend configuration.
|
||||
[regions.gateway.backend]
|
||||
|
||||
# The enabled backend type.
|
||||
enabled="mqtt"
|
||||
|
||||
# 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 }}"
|
||||
|
||||
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
|
||||
server="tcp://$MQTT_BROKER_HOST:1883"
|
||||
|
||||
# Connect with the given username (optional)
|
||||
username=""
|
||||
|
||||
# Connect with the given password (optional)
|
||||
password=""
|
||||
|
||||
# Quality of service level
|
||||
#
|
||||
# 0: at most once
|
||||
# 1: at least once
|
||||
# 2: exactly once
|
||||
#
|
||||
# Note: an increase of this value will decrease the performance.
|
||||
# For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels
|
||||
qos=0
|
||||
|
||||
# Clean session
|
||||
#
|
||||
# Set the "clean session" flag in the connect message when this client
|
||||
# connects to an MQTT broker. By setting this flag you are indicating
|
||||
# that no messages saved by the broker for this client should be delivered.
|
||||
clean_session=false
|
||||
|
||||
# Client ID
|
||||
#
|
||||
# Set the client id to be used by this client when connecting to the MQTT
|
||||
# broker. A client id must be no longer than 23 characters. If left blank,
|
||||
# a random id will be generated by ChirpStack.
|
||||
client_id=""
|
||||
|
||||
# CA certificate file (optional)
|
||||
#
|
||||
# Use this when setting up a secure connection (when server uses ssl://...)
|
||||
# but the certificate used by the server is not trusted by any CA certificate
|
||||
# on the server (e.g. when self generated).
|
||||
ca_cert=""
|
||||
|
||||
# TLS certificate file (optional)
|
||||
tls_cert=""
|
||||
|
||||
# TLS key file (optional)
|
||||
tls_key=""
|
||||
|
||||
|
||||
# Gateway channel configuration.
|
||||
#
|
||||
# Note: this configuration is only used in case the gateway is using the
|
||||
# ChirpStack Concentratord daemon. In any other case, this configuration
|
||||
# is ignored.
|
||||
[[regions.gateway.channels]]
|
||||
frequency=476700000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=476900000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=477100000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=477300000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=477500000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=477700000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=477900000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=478100000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
|
||||
# Region specific network configuration.
|
||||
[regions.network]
|
||||
|
||||
# Installation margin (dB) used by the ADR engine.
|
||||
#
|
||||
# A higher number means that the network-server will keep more margin,
|
||||
# resulting in a lower data-rate but decreasing the chance that the
|
||||
# device gets disconnected because it is unable to reach one of the
|
||||
# surrounded gateways.
|
||||
installation_margin=10
|
||||
|
||||
# RX window (Class-A).
|
||||
#
|
||||
# Set this to:
|
||||
# 0: RX1 / RX2
|
||||
# 1: RX1 only
|
||||
# 2: RX2 only
|
||||
rx_window=0
|
||||
|
||||
# RX1 delay (1 - 15 seconds).
|
||||
rx1_delay=1
|
||||
|
||||
# RX1 data-rate offset
|
||||
rx1_dr_offset=0
|
||||
|
||||
# RX2 data-rate
|
||||
rx2_dr=0
|
||||
|
||||
# RX2 frequency (Hz)
|
||||
rx2_frequency=505300000
|
||||
|
||||
# Prefer RX2 on RX1 data-rate less than.
|
||||
#
|
||||
# Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate
|
||||
# is smaller than the configured value, then the Network Server will
|
||||
# first try to schedule the downlink for RX2, failing that (e.g. the gateway
|
||||
# has already a payload scheduled at the RX2 timing) it will try RX1.
|
||||
rx2_prefer_on_rx1_dr_lt=0
|
||||
|
||||
# Prefer RX2 on link budget.
|
||||
#
|
||||
# When the link-budget is better for RX2 than for RX1, the Network Server will first
|
||||
# try to schedule the downlink in RX2, failing that it will try RX1.
|
||||
rx2_prefer_on_link_budget=false
|
||||
|
||||
# Downlink TX Power (dBm)
|
||||
#
|
||||
# When set to -1, the downlink TX Power from the configured band will
|
||||
# be used.
|
||||
#
|
||||
# Please consult the LoRaWAN Regional Parameters and local regulations
|
||||
# for valid and legal options. Note that the configured TX Power must be
|
||||
# supported by your gateway(s).
|
||||
downlink_tx_power=-1
|
||||
|
||||
# ADR is disabled.
|
||||
adr_disabled=false
|
||||
|
||||
# Minimum data-rate.
|
||||
min_dr=0
|
||||
|
||||
# Maximum data-rate.
|
||||
max_dr=5
|
||||
|
||||
# Enabled uplink channels.
|
||||
#
|
||||
# Use this when ony a sub-set of the by default enabled channels are being
|
||||
# used. For example when only using the first 8 channels of the US band.
|
||||
# Note: when left blank / empty array, all channels will be enabled.
|
||||
enabled_uplink_channels=[32, 33, 34, 35, 36, 37, 38, 39]
|
||||
|
||||
|
||||
# Rejoin-request configuration (LoRaWAN 1.1)
|
||||
[regions.network.rejoin_request]
|
||||
|
||||
# Request devices to periodically send rejoin-requests.
|
||||
enabled=false
|
||||
|
||||
# The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4)
|
||||
# uplink messages. Valid values are 0 to 15.
|
||||
max_count_n=0
|
||||
|
||||
# The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10)
|
||||
# seconds. Valid values are 0 to 15.
|
||||
#
|
||||
# 0 = roughly 17 minutes
|
||||
# 15 = about 1 year
|
||||
max_time_n=0
|
||||
|
||||
|
||||
# Class-B configuration.
|
||||
[regions.network.class_b]
|
||||
|
||||
# Ping-slot data-rate.
|
||||
ping_slot_dr=0
|
||||
|
||||
# Ping-slot frequency (Hz)
|
||||
#
|
||||
# set this to 0 to use the default frequency plan for the configured region
|
||||
# (which could be frequency hopping).
|
||||
ping_slot_frequency=0
|
237
chirpstack/configuration/region_cn470_5.toml
Normal file
237
chirpstack/configuration/region_cn470_5.toml
Normal file
@ -0,0 +1,237 @@
|
||||
# This file contains an example CN470 example (channels 40-47).
|
||||
[[regions]]
|
||||
|
||||
# Name is an use-defined identifier for this region.
|
||||
name="cn470_5"
|
||||
|
||||
# Common-name refers to the common-name of this region as defined by
|
||||
# the LoRa Alliance.
|
||||
common_name="CN470"
|
||||
|
||||
|
||||
# Gateway configuration.
|
||||
[regions.gateway]
|
||||
|
||||
# Force gateways as private.
|
||||
#
|
||||
# If enabled, gateways can only be used by devices under the same tenant.
|
||||
force_gws_private=false
|
||||
|
||||
|
||||
# Gateway backend configuration.
|
||||
[regions.gateway.backend]
|
||||
|
||||
# The enabled backend type.
|
||||
enabled="mqtt"
|
||||
|
||||
# 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 }}"
|
||||
|
||||
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
|
||||
server="tcp://$MQTT_BROKER_HOST:1883"
|
||||
|
||||
# Connect with the given username (optional)
|
||||
username=""
|
||||
|
||||
# Connect with the given password (optional)
|
||||
password=""
|
||||
|
||||
# Quality of service level
|
||||
#
|
||||
# 0: at most once
|
||||
# 1: at least once
|
||||
# 2: exactly once
|
||||
#
|
||||
# Note: an increase of this value will decrease the performance.
|
||||
# For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels
|
||||
qos=0
|
||||
|
||||
# Clean session
|
||||
#
|
||||
# Set the "clean session" flag in the connect message when this client
|
||||
# connects to an MQTT broker. By setting this flag you are indicating
|
||||
# that no messages saved by the broker for this client should be delivered.
|
||||
clean_session=false
|
||||
|
||||
# Client ID
|
||||
#
|
||||
# Set the client id to be used by this client when connecting to the MQTT
|
||||
# broker. A client id must be no longer than 23 characters. If left blank,
|
||||
# a random id will be generated by ChirpStack.
|
||||
client_id=""
|
||||
|
||||
# CA certificate file (optional)
|
||||
#
|
||||
# Use this when setting up a secure connection (when server uses ssl://...)
|
||||
# but the certificate used by the server is not trusted by any CA certificate
|
||||
# on the server (e.g. when self generated).
|
||||
ca_cert=""
|
||||
|
||||
# TLS certificate file (optional)
|
||||
tls_cert=""
|
||||
|
||||
# TLS key file (optional)
|
||||
tls_key=""
|
||||
|
||||
|
||||
# Gateway channel configuration.
|
||||
#
|
||||
# Note: this configuration is only used in case the gateway is using the
|
||||
# ChirpStack Concentratord daemon. In any other case, this configuration
|
||||
# is ignored.
|
||||
[[regions.gateway.channels]]
|
||||
frequency=478300000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=478500000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=478700000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=478900000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=479100000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=479300000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=479500000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=479700000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
|
||||
# Region specific network configuration.
|
||||
[regions.network]
|
||||
|
||||
# Installation margin (dB) used by the ADR engine.
|
||||
#
|
||||
# A higher number means that the network-server will keep more margin,
|
||||
# resulting in a lower data-rate but decreasing the chance that the
|
||||
# device gets disconnected because it is unable to reach one of the
|
||||
# surrounded gateways.
|
||||
installation_margin=10
|
||||
|
||||
# RX window (Class-A).
|
||||
#
|
||||
# Set this to:
|
||||
# 0: RX1 / RX2
|
||||
# 1: RX1 only
|
||||
# 2: RX2 only
|
||||
rx_window=0
|
||||
|
||||
# RX1 delay (1 - 15 seconds).
|
||||
rx1_delay=1
|
||||
|
||||
# RX1 data-rate offset
|
||||
rx1_dr_offset=0
|
||||
|
||||
# RX2 data-rate
|
||||
rx2_dr=0
|
||||
|
||||
# RX2 frequency (Hz)
|
||||
rx2_frequency=505300000
|
||||
|
||||
# Prefer RX2 on RX1 data-rate less than.
|
||||
#
|
||||
# Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate
|
||||
# is smaller than the configured value, then the Network Server will
|
||||
# first try to schedule the downlink for RX2, failing that (e.g. the gateway
|
||||
# has already a payload scheduled at the RX2 timing) it will try RX1.
|
||||
rx2_prefer_on_rx1_dr_lt=0
|
||||
|
||||
# Prefer RX2 on link budget.
|
||||
#
|
||||
# When the link-budget is better for RX2 than for RX1, the Network Server will first
|
||||
# try to schedule the downlink in RX2, failing that it will try RX1.
|
||||
rx2_prefer_on_link_budget=false
|
||||
|
||||
# Downlink TX Power (dBm)
|
||||
#
|
||||
# When set to -1, the downlink TX Power from the configured band will
|
||||
# be used.
|
||||
#
|
||||
# Please consult the LoRaWAN Regional Parameters and local regulations
|
||||
# for valid and legal options. Note that the configured TX Power must be
|
||||
# supported by your gateway(s).
|
||||
downlink_tx_power=-1
|
||||
|
||||
# ADR is disabled.
|
||||
adr_disabled=false
|
||||
|
||||
# Minimum data-rate.
|
||||
min_dr=0
|
||||
|
||||
# Maximum data-rate.
|
||||
max_dr=5
|
||||
|
||||
# Enabled uplink channels.
|
||||
#
|
||||
# Use this when ony a sub-set of the by default enabled channels are being
|
||||
# used. For example when only using the first 8 channels of the US band.
|
||||
# Note: when left blank / empty array, all channels will be enabled.
|
||||
enabled_uplink_channels=[40, 41, 42, 43, 44, 45, 46, 47]
|
||||
|
||||
|
||||
# Rejoin-request configuration (LoRaWAN 1.1)
|
||||
[regions.network.rejoin_request]
|
||||
|
||||
# Request devices to periodically send rejoin-requests.
|
||||
enabled=false
|
||||
|
||||
# The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4)
|
||||
# uplink messages. Valid values are 0 to 15.
|
||||
max_count_n=0
|
||||
|
||||
# The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10)
|
||||
# seconds. Valid values are 0 to 15.
|
||||
#
|
||||
# 0 = roughly 17 minutes
|
||||
# 15 = about 1 year
|
||||
max_time_n=0
|
||||
|
||||
|
||||
# Class-B configuration.
|
||||
[regions.network.class_b]
|
||||
|
||||
# Ping-slot data-rate.
|
||||
ping_slot_dr=0
|
||||
|
||||
# Ping-slot frequency (Hz)
|
||||
#
|
||||
# set this to 0 to use the default frequency plan for the configured region
|
||||
# (which could be frequency hopping).
|
||||
ping_slot_frequency=0
|
237
chirpstack/configuration/region_cn470_6.toml
Normal file
237
chirpstack/configuration/region_cn470_6.toml
Normal file
@ -0,0 +1,237 @@
|
||||
# This file contains an example CN470 example (channels 48-55).
|
||||
[[regions]]
|
||||
|
||||
# Name is an use-defined identifier for this region.
|
||||
name="cn470_6"
|
||||
|
||||
# Common-name refers to the common-name of this region as defined by
|
||||
# the LoRa Alliance.
|
||||
common_name="CN470"
|
||||
|
||||
|
||||
# Gateway configuration.
|
||||
[regions.gateway]
|
||||
|
||||
# Force gateways as private.
|
||||
#
|
||||
# If enabled, gateways can only be used by devices under the same tenant.
|
||||
force_gws_private=false
|
||||
|
||||
|
||||
# Gateway backend configuration.
|
||||
[regions.gateway.backend]
|
||||
|
||||
# The enabled backend type.
|
||||
enabled="mqtt"
|
||||
|
||||
# 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 }}"
|
||||
|
||||
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
|
||||
server="tcp://$MQTT_BROKER_HOST:1883"
|
||||
|
||||
# Connect with the given username (optional)
|
||||
username=""
|
||||
|
||||
# Connect with the given password (optional)
|
||||
password=""
|
||||
|
||||
# Quality of service level
|
||||
#
|
||||
# 0: at most once
|
||||
# 1: at least once
|
||||
# 2: exactly once
|
||||
#
|
||||
# Note: an increase of this value will decrease the performance.
|
||||
# For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels
|
||||
qos=0
|
||||
|
||||
# Clean session
|
||||
#
|
||||
# Set the "clean session" flag in the connect message when this client
|
||||
# connects to an MQTT broker. By setting this flag you are indicating
|
||||
# that no messages saved by the broker for this client should be delivered.
|
||||
clean_session=false
|
||||
|
||||
# Client ID
|
||||
#
|
||||
# Set the client id to be used by this client when connecting to the MQTT
|
||||
# broker. A client id must be no longer than 23 characters. If left blank,
|
||||
# a random id will be generated by ChirpStack.
|
||||
client_id=""
|
||||
|
||||
# CA certificate file (optional)
|
||||
#
|
||||
# Use this when setting up a secure connection (when server uses ssl://...)
|
||||
# but the certificate used by the server is not trusted by any CA certificate
|
||||
# on the server (e.g. when self generated).
|
||||
ca_cert=""
|
||||
|
||||
# TLS certificate file (optional)
|
||||
tls_cert=""
|
||||
|
||||
# TLS key file (optional)
|
||||
tls_key=""
|
||||
|
||||
|
||||
# Gateway channel configuration.
|
||||
#
|
||||
# Note: this configuration is only used in case the gateway is using the
|
||||
# ChirpStack Concentratord daemon. In any other case, this configuration
|
||||
# is ignored.
|
||||
[[regions.gateway.channels]]
|
||||
frequency=479900000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=480100000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=480300000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=480500000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=480700000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=480900000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=481100000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=481300000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
|
||||
# Region specific network configuration.
|
||||
[regions.network]
|
||||
|
||||
# Installation margin (dB) used by the ADR engine.
|
||||
#
|
||||
# A higher number means that the network-server will keep more margin,
|
||||
# resulting in a lower data-rate but decreasing the chance that the
|
||||
# device gets disconnected because it is unable to reach one of the
|
||||
# surrounded gateways.
|
||||
installation_margin=10
|
||||
|
||||
# RX window (Class-A).
|
||||
#
|
||||
# Set this to:
|
||||
# 0: RX1 / RX2
|
||||
# 1: RX1 only
|
||||
# 2: RX2 only
|
||||
rx_window=0
|
||||
|
||||
# RX1 delay (1 - 15 seconds).
|
||||
rx1_delay=1
|
||||
|
||||
# RX1 data-rate offset
|
||||
rx1_dr_offset=0
|
||||
|
||||
# RX2 data-rate
|
||||
rx2_dr=0
|
||||
|
||||
# RX2 frequency (Hz)
|
||||
rx2_frequency=505300000
|
||||
|
||||
# Prefer RX2 on RX1 data-rate less than.
|
||||
#
|
||||
# Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate
|
||||
# is smaller than the configured value, then the Network Server will
|
||||
# first try to schedule the downlink for RX2, failing that (e.g. the gateway
|
||||
# has already a payload scheduled at the RX2 timing) it will try RX1.
|
||||
rx2_prefer_on_rx1_dr_lt=0
|
||||
|
||||
# Prefer RX2 on link budget.
|
||||
#
|
||||
# When the link-budget is better for RX2 than for RX1, the Network Server will first
|
||||
# try to schedule the downlink in RX2, failing that it will try RX1.
|
||||
rx2_prefer_on_link_budget=false
|
||||
|
||||
# Downlink TX Power (dBm)
|
||||
#
|
||||
# When set to -1, the downlink TX Power from the configured band will
|
||||
# be used.
|
||||
#
|
||||
# Please consult the LoRaWAN Regional Parameters and local regulations
|
||||
# for valid and legal options. Note that the configured TX Power must be
|
||||
# supported by your gateway(s).
|
||||
downlink_tx_power=-1
|
||||
|
||||
# ADR is disabled.
|
||||
adr_disabled=false
|
||||
|
||||
# Minimum data-rate.
|
||||
min_dr=0
|
||||
|
||||
# Maximum data-rate.
|
||||
max_dr=5
|
||||
|
||||
# Enabled uplink channels.
|
||||
#
|
||||
# Use this when ony a sub-set of the by default enabled channels are being
|
||||
# used. For example when only using the first 8 channels of the US band.
|
||||
# Note: when left blank / empty array, all channels will be enabled.
|
||||
enabled_uplink_channels=[48, 49, 50, 51, 52, 53, 54, 55]
|
||||
|
||||
|
||||
# Rejoin-request configuration (LoRaWAN 1.1)
|
||||
[regions.network.rejoin_request]
|
||||
|
||||
# Request devices to periodically send rejoin-requests.
|
||||
enabled=false
|
||||
|
||||
# The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4)
|
||||
# uplink messages. Valid values are 0 to 15.
|
||||
max_count_n=0
|
||||
|
||||
# The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10)
|
||||
# seconds. Valid values are 0 to 15.
|
||||
#
|
||||
# 0 = roughly 17 minutes
|
||||
# 15 = about 1 year
|
||||
max_time_n=0
|
||||
|
||||
|
||||
# Class-B configuration.
|
||||
[regions.network.class_b]
|
||||
|
||||
# Ping-slot data-rate.
|
||||
ping_slot_dr=0
|
||||
|
||||
# Ping-slot frequency (Hz)
|
||||
#
|
||||
# set this to 0 to use the default frequency plan for the configured region
|
||||
# (which could be frequency hopping).
|
||||
ping_slot_frequency=0
|
237
chirpstack/configuration/region_cn470_7.toml
Normal file
237
chirpstack/configuration/region_cn470_7.toml
Normal file
@ -0,0 +1,237 @@
|
||||
# This file contains an example CN470 example (channels 56-63).
|
||||
[[regions]]
|
||||
|
||||
# Name is an use-defined identifier for this region.
|
||||
name="cn470_7"
|
||||
|
||||
# Common-name refers to the common-name of this region as defined by
|
||||
# the LoRa Alliance.
|
||||
common_name="CN470"
|
||||
|
||||
|
||||
# Gateway configuration.
|
||||
[regions.gateway]
|
||||
|
||||
# Force gateways as private.
|
||||
#
|
||||
# If enabled, gateways can only be used by devices under the same tenant.
|
||||
force_gws_private=false
|
||||
|
||||
|
||||
# Gateway backend configuration.
|
||||
[regions.gateway.backend]
|
||||
|
||||
# The enabled backend type.
|
||||
enabled="mqtt"
|
||||
|
||||
# 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 }}"
|
||||
|
||||
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
|
||||
server="tcp://$MQTT_BROKER_HOST:1883"
|
||||
|
||||
# Connect with the given username (optional)
|
||||
username=""
|
||||
|
||||
# Connect with the given password (optional)
|
||||
password=""
|
||||
|
||||
# Quality of service level
|
||||
#
|
||||
# 0: at most once
|
||||
# 1: at least once
|
||||
# 2: exactly once
|
||||
#
|
||||
# Note: an increase of this value will decrease the performance.
|
||||
# For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels
|
||||
qos=0
|
||||
|
||||
# Clean session
|
||||
#
|
||||
# Set the "clean session" flag in the connect message when this client
|
||||
# connects to an MQTT broker. By setting this flag you are indicating
|
||||
# that no messages saved by the broker for this client should be delivered.
|
||||
clean_session=false
|
||||
|
||||
# Client ID
|
||||
#
|
||||
# Set the client id to be used by this client when connecting to the MQTT
|
||||
# broker. A client id must be no longer than 23 characters. If left blank,
|
||||
# a random id will be generated by ChirpStack.
|
||||
client_id=""
|
||||
|
||||
# CA certificate file (optional)
|
||||
#
|
||||
# Use this when setting up a secure connection (when server uses ssl://...)
|
||||
# but the certificate used by the server is not trusted by any CA certificate
|
||||
# on the server (e.g. when self generated).
|
||||
ca_cert=""
|
||||
|
||||
# TLS certificate file (optional)
|
||||
tls_cert=""
|
||||
|
||||
# TLS key file (optional)
|
||||
tls_key=""
|
||||
|
||||
|
||||
# Gateway channel configuration.
|
||||
#
|
||||
# Note: this configuration is only used in case the gateway is using the
|
||||
# ChirpStack Concentratord daemon. In any other case, this configuration
|
||||
# is ignored.
|
||||
[[regions.gateway.channels]]
|
||||
frequency=481500000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=481700000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=481900000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=482100000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=482300000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=482500000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=482700000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=482900000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
|
||||
# Region specific network configuration.
|
||||
[regions.network]
|
||||
|
||||
# Installation margin (dB) used by the ADR engine.
|
||||
#
|
||||
# A higher number means that the network-server will keep more margin,
|
||||
# resulting in a lower data-rate but decreasing the chance that the
|
||||
# device gets disconnected because it is unable to reach one of the
|
||||
# surrounded gateways.
|
||||
installation_margin=10
|
||||
|
||||
# RX window (Class-A).
|
||||
#
|
||||
# Set this to:
|
||||
# 0: RX1 / RX2
|
||||
# 1: RX1 only
|
||||
# 2: RX2 only
|
||||
rx_window=0
|
||||
|
||||
# RX1 delay (1 - 15 seconds).
|
||||
rx1_delay=1
|
||||
|
||||
# RX1 data-rate offset
|
||||
rx1_dr_offset=0
|
||||
|
||||
# RX2 data-rate
|
||||
rx2_dr=0
|
||||
|
||||
# RX2 frequency (Hz)
|
||||
rx2_frequency=505300000
|
||||
|
||||
# Prefer RX2 on RX1 data-rate less than.
|
||||
#
|
||||
# Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate
|
||||
# is smaller than the configured value, then the Network Server will
|
||||
# first try to schedule the downlink for RX2, failing that (e.g. the gateway
|
||||
# has already a payload scheduled at the RX2 timing) it will try RX1.
|
||||
rx2_prefer_on_rx1_dr_lt=0
|
||||
|
||||
# Prefer RX2 on link budget.
|
||||
#
|
||||
# When the link-budget is better for RX2 than for RX1, the Network Server will first
|
||||
# try to schedule the downlink in RX2, failing that it will try RX1.
|
||||
rx2_prefer_on_link_budget=false
|
||||
|
||||
# Downlink TX Power (dBm)
|
||||
#
|
||||
# When set to -1, the downlink TX Power from the configured band will
|
||||
# be used.
|
||||
#
|
||||
# Please consult the LoRaWAN Regional Parameters and local regulations
|
||||
# for valid and legal options. Note that the configured TX Power must be
|
||||
# supported by your gateway(s).
|
||||
downlink_tx_power=-1
|
||||
|
||||
# ADR is disabled.
|
||||
adr_disabled=false
|
||||
|
||||
# Minimum data-rate.
|
||||
min_dr=0
|
||||
|
||||
# Maximum data-rate.
|
||||
max_dr=5
|
||||
|
||||
# Enabled uplink channels.
|
||||
#
|
||||
# Use this when ony a sub-set of the by default enabled channels are being
|
||||
# used. For example when only using the first 8 channels of the US band.
|
||||
# Note: when left blank / empty array, all channels will be enabled.
|
||||
enabled_uplink_channels=[56, 57, 58, 59, 60, 61, 62, 63]
|
||||
|
||||
|
||||
# Rejoin-request configuration (LoRaWAN 1.1)
|
||||
[regions.network.rejoin_request]
|
||||
|
||||
# Request devices to periodically send rejoin-requests.
|
||||
enabled=false
|
||||
|
||||
# The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4)
|
||||
# uplink messages. Valid values are 0 to 15.
|
||||
max_count_n=0
|
||||
|
||||
# The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10)
|
||||
# seconds. Valid values are 0 to 15.
|
||||
#
|
||||
# 0 = roughly 17 minutes
|
||||
# 15 = about 1 year
|
||||
max_time_n=0
|
||||
|
||||
|
||||
# Class-B configuration.
|
||||
[regions.network.class_b]
|
||||
|
||||
# Ping-slot data-rate.
|
||||
ping_slot_dr=0
|
||||
|
||||
# Ping-slot frequency (Hz)
|
||||
#
|
||||
# set this to 0 to use the default frequency plan for the configured region
|
||||
# (which could be frequency hopping).
|
||||
ping_slot_frequency=0
|
237
chirpstack/configuration/region_cn470_8.toml
Normal file
237
chirpstack/configuration/region_cn470_8.toml
Normal file
@ -0,0 +1,237 @@
|
||||
# This file contains an example CN470 example (channels 64-71).
|
||||
[[regions]]
|
||||
|
||||
# Name is an use-defined identifier for this region.
|
||||
name="cn470_8"
|
||||
|
||||
# Common-name refers to the common-name of this region as defined by
|
||||
# the LoRa Alliance.
|
||||
common_name="CN470"
|
||||
|
||||
|
||||
# Gateway configuration.
|
||||
[regions.gateway]
|
||||
|
||||
# Force gateways as private.
|
||||
#
|
||||
# If enabled, gateways can only be used by devices under the same tenant.
|
||||
force_gws_private=false
|
||||
|
||||
|
||||
# Gateway backend configuration.
|
||||
[regions.gateway.backend]
|
||||
|
||||
# The enabled backend type.
|
||||
enabled="mqtt"
|
||||
|
||||
# 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 }}"
|
||||
|
||||
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
|
||||
server="tcp://$MQTT_BROKER_HOST:1883"
|
||||
|
||||
# Connect with the given username (optional)
|
||||
username=""
|
||||
|
||||
# Connect with the given password (optional)
|
||||
password=""
|
||||
|
||||
# Quality of service level
|
||||
#
|
||||
# 0: at most once
|
||||
# 1: at least once
|
||||
# 2: exactly once
|
||||
#
|
||||
# Note: an increase of this value will decrease the performance.
|
||||
# For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels
|
||||
qos=0
|
||||
|
||||
# Clean session
|
||||
#
|
||||
# Set the "clean session" flag in the connect message when this client
|
||||
# connects to an MQTT broker. By setting this flag you are indicating
|
||||
# that no messages saved by the broker for this client should be delivered.
|
||||
clean_session=false
|
||||
|
||||
# Client ID
|
||||
#
|
||||
# Set the client id to be used by this client when connecting to the MQTT
|
||||
# broker. A client id must be no longer than 23 characters. If left blank,
|
||||
# a random id will be generated by ChirpStack.
|
||||
client_id=""
|
||||
|
||||
# CA certificate file (optional)
|
||||
#
|
||||
# Use this when setting up a secure connection (when server uses ssl://...)
|
||||
# but the certificate used by the server is not trusted by any CA certificate
|
||||
# on the server (e.g. when self generated).
|
||||
ca_cert=""
|
||||
|
||||
# TLS certificate file (optional)
|
||||
tls_cert=""
|
||||
|
||||
# TLS key file (optional)
|
||||
tls_key=""
|
||||
|
||||
|
||||
# Gateway channel configuration.
|
||||
#
|
||||
# Note: this configuration is only used in case the gateway is using the
|
||||
# ChirpStack Concentratord daemon. In any other case, this configuration
|
||||
# is ignored.
|
||||
[[regions.gateway.channels]]
|
||||
frequency=483100000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=483300000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=483500000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=483700000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=483900000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=484100000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=484300000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=484500000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
|
||||
# Region specific network configuration.
|
||||
[regions.network]
|
||||
|
||||
# Installation margin (dB) used by the ADR engine.
|
||||
#
|
||||
# A higher number means that the network-server will keep more margin,
|
||||
# resulting in a lower data-rate but decreasing the chance that the
|
||||
# device gets disconnected because it is unable to reach one of the
|
||||
# surrounded gateways.
|
||||
installation_margin=10
|
||||
|
||||
# RX window (Class-A).
|
||||
#
|
||||
# Set this to:
|
||||
# 0: RX1 / RX2
|
||||
# 1: RX1 only
|
||||
# 2: RX2 only
|
||||
rx_window=0
|
||||
|
||||
# RX1 delay (1 - 15 seconds).
|
||||
rx1_delay=1
|
||||
|
||||
# RX1 data-rate offset
|
||||
rx1_dr_offset=0
|
||||
|
||||
# RX2 data-rate
|
||||
rx2_dr=0
|
||||
|
||||
# RX2 frequency (Hz)
|
||||
rx2_frequency=505300000
|
||||
|
||||
# Prefer RX2 on RX1 data-rate less than.
|
||||
#
|
||||
# Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate
|
||||
# is smaller than the configured value, then the Network Server will
|
||||
# first try to schedule the downlink for RX2, failing that (e.g. the gateway
|
||||
# has already a payload scheduled at the RX2 timing) it will try RX1.
|
||||
rx2_prefer_on_rx1_dr_lt=0
|
||||
|
||||
# Prefer RX2 on link budget.
|
||||
#
|
||||
# When the link-budget is better for RX2 than for RX1, the Network Server will first
|
||||
# try to schedule the downlink in RX2, failing that it will try RX1.
|
||||
rx2_prefer_on_link_budget=false
|
||||
|
||||
# Downlink TX Power (dBm)
|
||||
#
|
||||
# When set to -1, the downlink TX Power from the configured band will
|
||||
# be used.
|
||||
#
|
||||
# Please consult the LoRaWAN Regional Parameters and local regulations
|
||||
# for valid and legal options. Note that the configured TX Power must be
|
||||
# supported by your gateway(s).
|
||||
downlink_tx_power=-1
|
||||
|
||||
# ADR is disabled.
|
||||
adr_disabled=false
|
||||
|
||||
# Minimum data-rate.
|
||||
min_dr=0
|
||||
|
||||
# Maximum data-rate.
|
||||
max_dr=5
|
||||
|
||||
# Enabled uplink channels.
|
||||
#
|
||||
# Use this when ony a sub-set of the by default enabled channels are being
|
||||
# used. For example when only using the first 8 channels of the US band.
|
||||
# Note: when left blank / empty array, all channels will be enabled.
|
||||
enabled_uplink_channels=[64, 65, 66, 67, 68, 69, 70, 71]
|
||||
|
||||
|
||||
# Rejoin-request configuration (LoRaWAN 1.1)
|
||||
[regions.network.rejoin_request]
|
||||
|
||||
# Request devices to periodically send rejoin-requests.
|
||||
enabled=false
|
||||
|
||||
# The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4)
|
||||
# uplink messages. Valid values are 0 to 15.
|
||||
max_count_n=0
|
||||
|
||||
# The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10)
|
||||
# seconds. Valid values are 0 to 15.
|
||||
#
|
||||
# 0 = roughly 17 minutes
|
||||
# 15 = about 1 year
|
||||
max_time_n=0
|
||||
|
||||
|
||||
# Class-B configuration.
|
||||
[regions.network.class_b]
|
||||
|
||||
# Ping-slot data-rate.
|
||||
ping_slot_dr=0
|
||||
|
||||
# Ping-slot frequency (Hz)
|
||||
#
|
||||
# set this to 0 to use the default frequency plan for the configured region
|
||||
# (which could be frequency hopping).
|
||||
ping_slot_frequency=0
|
237
chirpstack/configuration/region_cn470_9.toml
Normal file
237
chirpstack/configuration/region_cn470_9.toml
Normal file
@ -0,0 +1,237 @@
|
||||
# This file contains an example CN470 example (channels 72-79).
|
||||
[[regions]]
|
||||
|
||||
# Name is an use-defined identifier for this region.
|
||||
name="cn470_9"
|
||||
|
||||
# Common-name refers to the common-name of this region as defined by
|
||||
# the LoRa Alliance.
|
||||
common_name="CN470"
|
||||
|
||||
|
||||
# Gateway configuration.
|
||||
[regions.gateway]
|
||||
|
||||
# Force gateways as private.
|
||||
#
|
||||
# If enabled, gateways can only be used by devices under the same tenant.
|
||||
force_gws_private=false
|
||||
|
||||
|
||||
# Gateway backend configuration.
|
||||
[regions.gateway.backend]
|
||||
|
||||
# The enabled backend type.
|
||||
enabled="mqtt"
|
||||
|
||||
# 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 }}"
|
||||
|
||||
# MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws)
|
||||
server="tcp://$MQTT_BROKER_HOST:1883"
|
||||
|
||||
# Connect with the given username (optional)
|
||||
username=""
|
||||
|
||||
# Connect with the given password (optional)
|
||||
password=""
|
||||
|
||||
# Quality of service level
|
||||
#
|
||||
# 0: at most once
|
||||
# 1: at least once
|
||||
# 2: exactly once
|
||||
#
|
||||
# Note: an increase of this value will decrease the performance.
|
||||
# For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels
|
||||
qos=0
|
||||
|
||||
# Clean session
|
||||
#
|
||||
# Set the "clean session" flag in the connect message when this client
|
||||
# connects to an MQTT broker. By setting this flag you are indicating
|
||||
# that no messages saved by the broker for this client should be delivered.
|
||||
clean_session=false
|
||||
|
||||
# Client ID
|
||||
#
|
||||
# Set the client id to be used by this client when connecting to the MQTT
|
||||
# broker. A client id must be no longer than 23 characters. If left blank,
|
||||
# a random id will be generated by ChirpStack.
|
||||
client_id=""
|
||||
|
||||
# CA certificate file (optional)
|
||||
#
|
||||
# Use this when setting up a secure connection (when server uses ssl://...)
|
||||
# but the certificate used by the server is not trusted by any CA certificate
|
||||
# on the server (e.g. when self generated).
|
||||
ca_cert=""
|
||||
|
||||
# TLS certificate file (optional)
|
||||
tls_cert=""
|
||||
|
||||
# TLS key file (optional)
|
||||
tls_key=""
|
||||
|
||||
|
||||
# Gateway channel configuration.
|
||||
#
|
||||
# Note: this configuration is only used in case the gateway is using the
|
||||
# ChirpStack Concentratord daemon. In any other case, this configuration
|
||||
# is ignored.
|
||||
[[regions.gateway.channels]]
|
||||
frequency=484700000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=484900000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=485100000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=485300000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=485500000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=485700000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=485900000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
[[regions.gateway.channels]]
|
||||
frequency=486100000
|
||||
bandwidth=125000
|
||||
modulation="LORA"
|
||||
spreading_factors=[7, 8, 9, 10, 11, 12]
|
||||
|
||||
|
||||
# Region specific network configuration.
|
||||
[regions.network]
|
||||
|
||||
# Installation margin (dB) used by the ADR engine.
|
||||
#
|
||||
# A higher number means that the network-server will keep more margin,
|
||||
# resulting in a lower data-rate but decreasing the chance that the
|
||||
# device gets disconnected because it is unable to reach one of the
|
||||
# surrounded gateways.
|
||||
installation_margin=10
|
||||
|
||||
# RX window (Class-A).
|
||||
#
|
||||
# Set this to:
|
||||
# 0: RX1 / RX2
|
||||
# 1: RX1 only
|
||||
# 2: RX2 only
|
||||
rx_window=0
|
||||
|
||||
# RX1 delay (1 - 15 seconds).
|
||||
rx1_delay=1
|
||||
|
||||
# RX1 data-rate offset
|
||||
rx1_dr_offset=0
|
||||
|
||||
# RX2 data-rate
|
||||
rx2_dr=0
|
||||
|
||||
# RX2 frequency (Hz)
|
||||
rx2_frequency=505300000
|
||||
|
||||
# Prefer RX2 on RX1 data-rate less than.
|
||||
#
|
||||
# Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate
|
||||
# is smaller than the configured value, then the Network Server will
|
||||
# first try to schedule the downlink for RX2, failing that (e.g. the gateway
|
||||
# has already a payload scheduled at the RX2 timing) it will try RX1.
|
||||
rx2_prefer_on_rx1_dr_lt=0
|
||||
|
||||
# Prefer RX2 on link budget.
|
||||
#
|
||||
# When the link-budget is better for RX2 than for RX1, the Network Server will first
|
||||
# try to schedule the downlink in RX2, failing that it will try RX1.
|
||||
rx2_prefer_on_link_budget=false
|
||||
|
||||
# Downlink TX Power (dBm)
|
||||
#
|
||||
# When set to -1, the downlink TX Power from the configured band will
|
||||
# be used.
|
||||
#
|
||||
# Please consult the LoRaWAN Regional Parameters and local regulations
|
||||
# for valid and legal options. Note that the configured TX Power must be
|
||||
# supported by your gateway(s).
|
||||
downlink_tx_power=-1
|
||||
|
||||
# ADR is disabled.
|
||||
adr_disabled=false
|
||||
|
||||
# Minimum data-rate.
|
||||
min_dr=0
|
||||
|
||||
# Maximum data-rate.
|
||||
max_dr=5
|
||||
|
||||
# Enabled uplink channels.
|
||||
#
|
||||
# Use this when ony a sub-set of the by default enabled channels are being
|
||||
# used. For example when only using the first 8 channels of the US band.
|
||||
# Note: when left blank / empty array, all channels will be enabled.
|
||||
enabled_uplink_channels=[72, 73, 74, 75, 76, 77, 78, 79]
|
||||
|
||||
|
||||
# Rejoin-request configuration (LoRaWAN 1.1)
|
||||
[regions.network.rejoin_request]
|
||||
|
||||
# Request devices to periodically send rejoin-requests.
|
||||
enabled=false
|
||||
|
||||
# The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4)
|
||||
# uplink messages. Valid values are 0 to 15.
|
||||
max_count_n=0
|
||||
|
||||
# The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10)
|
||||
# seconds. Valid values are 0 to 15.
|
||||
#
|
||||
# 0 = roughly 17 minutes
|
||||
# 15 = about 1 year
|
||||
max_time_n=0
|
||||
|
||||
|
||||
# Class-B configuration.
|
||||
[regions.network.class_b]
|
||||
|
||||
# Ping-slot data-rate.
|
||||
ping_slot_dr=0
|
||||
|
||||
# Ping-slot frequency (Hz)
|
||||
#
|
||||
# set this to 0 to use the default frequency plan for the configured region
|
||||
# (which could be frequency hopping).
|
||||
ping_slot_frequency=0
|
@ -172,8 +172,13 @@ impl TenantService for Tenant {
|
||||
}
|
||||
}
|
||||
AuthID::Key(_) => {
|
||||
// Nothing to do as the validator function already validated that the
|
||||
// Nothing else to do as the validator function already validated that the
|
||||
// API key must be a global admin key.
|
||||
|
||||
if !req.user_id.is_empty() {
|
||||
let user_id = Uuid::from_str(&req.user_id).map_err(|e| e.status())?;
|
||||
filters.user_id = Some(user_id);
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
// this should never happen
|
||||
@ -492,6 +497,7 @@ pub mod test {
|
||||
search: "update".into(),
|
||||
offset: 0,
|
||||
limit: 10,
|
||||
user_id: "".into(),
|
||||
};
|
||||
let mut list_req = Request::new(list_req);
|
||||
list_req.extensions_mut().insert(AuthID::User(u.id.clone()));
|
||||
|
@ -170,7 +170,11 @@ pub async fn encode(
|
||||
}
|
||||
}
|
||||
|
||||
let v: Vec<u8> = res.get("bytes")?;
|
||||
// Directly into u8 can result into the following error:
|
||||
// Error converting from js 'float' into type 'i32'
|
||||
let v: Vec<f64> = res.get("bytes")?;
|
||||
let v: Vec<u8> = v.iter().map(|v| *v as u8).collect();
|
||||
|
||||
Ok(v)
|
||||
})
|
||||
}
|
||||
|
@ -89,52 +89,10 @@ pub async fn struct_to_binary(
|
||||
Ok(match codec {
|
||||
Codec::NONE => Vec::new(),
|
||||
Codec::CAYENNE_LPP => cayenne_lpp::encode(obj).context("CayenneLpp encode")?,
|
||||
Codec::JS => js::encode(f_port, variables, encoder_config, obj)
|
||||
.await
|
||||
.context("JavaScript encoder")?,
|
||||
Codec::JS => js::encode(f_port, variables, encoder_config, obj).await?,
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
pub fn get_data_keys(s: &pbjson_types::Struct) -> Vec<String> {
|
||||
let mut out: Vec<String> = Vec::new();
|
||||
|
||||
for (k, v) in &s.fields {
|
||||
out.extend_from_slice(&_get_data_keys(k, v));
|
||||
}
|
||||
|
||||
out
|
||||
}
|
||||
|
||||
fn _get_data_keys(prefix: &str, v: &pbjson_types::Value) -> Vec<String> {
|
||||
match &v.kind {
|
||||
None => vec![prefix.to_string()],
|
||||
Some(v) => match v {
|
||||
pbjson_types::value::Kind::NullValue(_)
|
||||
| pbjson_types::value::Kind::NumberValue(_)
|
||||
| pbjson_types::value::Kind::StringValue(_)
|
||||
| pbjson_types::value::Kind::BoolValue(_) => {
|
||||
vec![prefix.to_string()]
|
||||
}
|
||||
pbjson_types::value::Kind::StructValue(v) => {
|
||||
let mut out: Vec<String> = Vec::new();
|
||||
for (k, v) in &v.fields {
|
||||
out.extend_from_slice(&_get_data_keys(&format!("{}_{}", prefix, k), v));
|
||||
}
|
||||
out
|
||||
}
|
||||
pbjson_types::value::Kind::ListValue(v) => {
|
||||
let mut out: Vec<String> = Vec::new();
|
||||
for (i, v) in v.values.iter().enumerate() {
|
||||
out.extend_from_slice(&_get_data_keys(&format!("{}_{}", prefix, i), v));
|
||||
}
|
||||
out
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
pub fn get_measurements(s: &pbjson_types::Struct) -> HashMap<String, pbjson_types::value::Kind> {
|
||||
let mut out: HashMap<String, pbjson_types::value::Kind> = HashMap::new();
|
||||
|
||||
|
@ -142,16 +142,16 @@ impl Data {
|
||||
ctx.update_device_queue_item().await?;
|
||||
ctx.save_downlink_frame().await?;
|
||||
if ctx._is_roaming() {
|
||||
ctx.save_device_session().await?;
|
||||
ctx.send_downlink_frame_passive_roaming().await?;
|
||||
ctx.handle_passive_roaming_tx_ack().await?;
|
||||
} else {
|
||||
// Some mac-commands set their state (e.g. last requested) to the device-session.
|
||||
ctx.save_device_session().await?;
|
||||
ctx.send_downlink_frame().await?;
|
||||
}
|
||||
}
|
||||
|
||||
// Some mac-commands set their state (e.g. last requested) to the device-session.
|
||||
ctx.save_device_session().await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@ -389,6 +389,8 @@ impl Data {
|
||||
self._set_rx_parameters().await?;
|
||||
self._set_tx_parameters().await?;
|
||||
|
||||
self.mac_commands = filter_mac_commands(&self.device_session, &self.mac_commands);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@ -820,6 +822,7 @@ impl Data {
|
||||
// Note: this must come before ADR!
|
||||
async fn _request_channel_mask_reconfiguration(&mut self) -> Result<()> {
|
||||
trace!("Requesting channel-mask reconfiguration");
|
||||
|
||||
let enabled_uplink_channel_indices: Vec<usize> = self
|
||||
.device_session
|
||||
.enabled_uplink_channel_indices
|
||||
@ -1421,3 +1424,233 @@ impl Data {
|
||||
Ok(false)
|
||||
}
|
||||
}
|
||||
|
||||
fn filter_mac_commands(
|
||||
device_session: &internal::DeviceSession,
|
||||
mac_commands: &[lrwn::MACCommandSet],
|
||||
) -> Vec<lrwn::MACCommandSet> {
|
||||
let incompatible_macs: HashMap<lrwn::CID, Vec<lrwn::CID>> = [
|
||||
(lrwn::CID::NewChannelReq, vec![lrwn::CID::LinkADRReq]),
|
||||
(lrwn::CID::LinkADRReq, vec![lrwn::CID::NewChannelReq]),
|
||||
]
|
||||
.iter()
|
||||
.cloned()
|
||||
.collect();
|
||||
|
||||
let mut filtered_mac_commands: Vec<lrwn::MACCommandSet> = Vec::new();
|
||||
|
||||
'outer: for mac_command_set in mac_commands {
|
||||
for mac_command in &**mac_command_set {
|
||||
// Check if it doesn't exceed the max error error count.
|
||||
if device_session
|
||||
.mac_command_error_count
|
||||
.get(&(mac_command.cid().byte() as u32))
|
||||
.cloned()
|
||||
.unwrap_or_default()
|
||||
> 1
|
||||
{
|
||||
continue 'outer;
|
||||
}
|
||||
|
||||
// Check if there aren't any conflicting mac-commands.
|
||||
if let Some(incompatible_cids) = incompatible_macs.get(&mac_command.cid()) {
|
||||
for mac_command_set in &filtered_mac_commands {
|
||||
for mac_command in &**mac_command_set {
|
||||
if incompatible_cids.contains(&mac_command.cid()) {
|
||||
continue 'outer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
filtered_mac_commands.push(mac_command_set.clone());
|
||||
}
|
||||
|
||||
filtered_mac_commands
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
|
||||
struct Test {
|
||||
device_session: internal::DeviceSession,
|
||||
mac_commands: Vec<lrwn::MACCommandSet>,
|
||||
expected_mac_commands: Vec<lrwn::MACCommandSet>,
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_filter_mac_commands() {
|
||||
let tests = vec![
|
||||
// No mac-commands set.
|
||||
Test {
|
||||
device_session: internal::DeviceSession {
|
||||
..Default::default()
|
||||
},
|
||||
mac_commands: Vec::new(),
|
||||
expected_mac_commands: Vec::new(),
|
||||
},
|
||||
// One LinkADRReq, no errors.
|
||||
Test {
|
||||
device_session: internal::DeviceSession {
|
||||
mac_command_error_count: [(lrwn::CID::LinkADRReq.byte() as u32, 0)]
|
||||
.iter()
|
||||
.cloned()
|
||||
.collect(),
|
||||
..Default::default()
|
||||
},
|
||||
mac_commands: vec![lrwn::MACCommandSet::new(vec![
|
||||
lrwn::MACCommand::LinkADRReq(lrwn::LinkADRReqPayload {
|
||||
dr: 0,
|
||||
tx_power: 0,
|
||||
ch_mask: lrwn::ChMask::new([false; 16]),
|
||||
redundancy: lrwn::Redundancy {
|
||||
ch_mask_cntl: 0,
|
||||
nb_rep: 0,
|
||||
},
|
||||
}),
|
||||
])],
|
||||
expected_mac_commands: vec![lrwn::MACCommandSet::new(vec![
|
||||
lrwn::MACCommand::LinkADRReq(lrwn::LinkADRReqPayload {
|
||||
dr: 0,
|
||||
tx_power: 0,
|
||||
ch_mask: lrwn::ChMask::new([false; 16]),
|
||||
redundancy: lrwn::Redundancy {
|
||||
ch_mask_cntl: 0,
|
||||
nb_rep: 0,
|
||||
},
|
||||
}),
|
||||
])],
|
||||
},
|
||||
// One LinkADRReq, 0 errors (HashMap contains the CID, but count = 0).
|
||||
Test {
|
||||
device_session: internal::DeviceSession {
|
||||
mac_command_error_count: [(lrwn::CID::LinkADRReq.byte() as u32, 0)]
|
||||
.iter()
|
||||
.cloned()
|
||||
.collect(),
|
||||
..Default::default()
|
||||
},
|
||||
mac_commands: vec![lrwn::MACCommandSet::new(vec![
|
||||
lrwn::MACCommand::LinkADRReq(lrwn::LinkADRReqPayload {
|
||||
dr: 0,
|
||||
tx_power: 0,
|
||||
ch_mask: lrwn::ChMask::new([false; 16]),
|
||||
redundancy: lrwn::Redundancy {
|
||||
ch_mask_cntl: 0,
|
||||
nb_rep: 0,
|
||||
},
|
||||
}),
|
||||
])],
|
||||
expected_mac_commands: vec![lrwn::MACCommandSet::new(vec![
|
||||
lrwn::MACCommand::LinkADRReq(lrwn::LinkADRReqPayload {
|
||||
dr: 0,
|
||||
tx_power: 0,
|
||||
ch_mask: lrwn::ChMask::new([false; 16]),
|
||||
redundancy: lrwn::Redundancy {
|
||||
ch_mask_cntl: 0,
|
||||
nb_rep: 0,
|
||||
},
|
||||
}),
|
||||
])],
|
||||
},
|
||||
// One LinkADRReq, exceeding error count.
|
||||
Test {
|
||||
device_session: internal::DeviceSession {
|
||||
mac_command_error_count: [(lrwn::CID::LinkADRReq.byte() as u32, 2)]
|
||||
.iter()
|
||||
.cloned()
|
||||
.collect(),
|
||||
..Default::default()
|
||||
},
|
||||
mac_commands: vec![lrwn::MACCommandSet::new(vec![
|
||||
lrwn::MACCommand::LinkADRReq(lrwn::LinkADRReqPayload {
|
||||
dr: 0,
|
||||
tx_power: 0,
|
||||
ch_mask: lrwn::ChMask::new([false; 16]),
|
||||
redundancy: lrwn::Redundancy {
|
||||
ch_mask_cntl: 0,
|
||||
nb_rep: 0,
|
||||
},
|
||||
}),
|
||||
])],
|
||||
expected_mac_commands: Vec::new(),
|
||||
},
|
||||
// NewChannelReq + LinkADRReq
|
||||
Test {
|
||||
device_session: Default::default(),
|
||||
mac_commands: vec![
|
||||
lrwn::MACCommandSet::new(vec![lrwn::MACCommand::NewChannelReq(
|
||||
lrwn::NewChannelReqPayload {
|
||||
ch_index: 3,
|
||||
freq: 867100000,
|
||||
min_dr: 0,
|
||||
max_dr: 5,
|
||||
},
|
||||
)]),
|
||||
lrwn::MACCommandSet::new(vec![lrwn::MACCommand::LinkADRReq(
|
||||
lrwn::LinkADRReqPayload {
|
||||
dr: 0,
|
||||
tx_power: 0,
|
||||
ch_mask: lrwn::ChMask::new([false; 16]),
|
||||
redundancy: lrwn::Redundancy {
|
||||
ch_mask_cntl: 0,
|
||||
nb_rep: 0,
|
||||
},
|
||||
},
|
||||
)]),
|
||||
],
|
||||
expected_mac_commands: vec![lrwn::MACCommandSet::new(vec![
|
||||
lrwn::MACCommand::NewChannelReq(lrwn::NewChannelReqPayload {
|
||||
ch_index: 3,
|
||||
freq: 867100000,
|
||||
min_dr: 0,
|
||||
max_dr: 5,
|
||||
}),
|
||||
])],
|
||||
},
|
||||
// LinkADRReq + NewChannelReq (this order should never happen)
|
||||
Test {
|
||||
device_session: Default::default(),
|
||||
mac_commands: vec![
|
||||
lrwn::MACCommandSet::new(vec![lrwn::MACCommand::LinkADRReq(
|
||||
lrwn::LinkADRReqPayload {
|
||||
dr: 0,
|
||||
tx_power: 0,
|
||||
ch_mask: lrwn::ChMask::new([false; 16]),
|
||||
redundancy: lrwn::Redundancy {
|
||||
ch_mask_cntl: 0,
|
||||
nb_rep: 0,
|
||||
},
|
||||
},
|
||||
)]),
|
||||
lrwn::MACCommandSet::new(vec![lrwn::MACCommand::NewChannelReq(
|
||||
lrwn::NewChannelReqPayload {
|
||||
ch_index: 3,
|
||||
freq: 867100000,
|
||||
min_dr: 0,
|
||||
max_dr: 5,
|
||||
},
|
||||
)]),
|
||||
],
|
||||
expected_mac_commands: vec![lrwn::MACCommandSet::new(vec![
|
||||
lrwn::MACCommand::LinkADRReq(lrwn::LinkADRReqPayload {
|
||||
dr: 0,
|
||||
tx_power: 0,
|
||||
ch_mask: lrwn::ChMask::new([false; 16]),
|
||||
redundancy: lrwn::Redundancy {
|
||||
ch_mask_cntl: 0,
|
||||
nb_rep: 0,
|
||||
},
|
||||
}),
|
||||
])],
|
||||
},
|
||||
];
|
||||
|
||||
for test in &tests {
|
||||
let out = filter_mac_commands(&test.device_session, &test.mac_commands);
|
||||
assert_eq!(test.expected_mac_commands, out);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ impl TxAck {
|
||||
ctx.decode_phy_payload()?;
|
||||
|
||||
if ctx.is_error() {
|
||||
if ctx.is_application_payload() {
|
||||
if ctx.is_application_payload() || ctx.is_mac_only_downlink() {
|
||||
ctx.get_device().await?;
|
||||
ctx.get_device_profile().await?;
|
||||
ctx.get_application().await?;
|
||||
|
@ -157,7 +157,7 @@ impl<'a> MqttBackend<'a> {
|
||||
|
||||
if !conf.ca_cert.is_empty() {
|
||||
ssl_opts_b
|
||||
.ca_path(&conf.ca_cert)
|
||||
.trust_store(&conf.ca_cert)
|
||||
.context("Failed to set gateway ca_cert")?;
|
||||
}
|
||||
|
||||
|
@ -62,6 +62,10 @@ pub async fn setup() -> Result<()> {
|
||||
.await
|
||||
.context("Setup AMQP integration")?,
|
||||
)),
|
||||
"kafka" => integrations.push(Box::new(
|
||||
kafka::Integration::new(&conf.integration.kafka)
|
||||
.context("Setup Kafka integration")?,
|
||||
)),
|
||||
_ => {
|
||||
return Err(anyhow!("Unexpected integration: {}", name));
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ use std::io::Cursor;
|
||||
use anyhow::{Context, Result};
|
||||
use prost::Message;
|
||||
use tokio::task;
|
||||
use tracing::{info, trace, warn};
|
||||
use tracing::{error, info, trace};
|
||||
|
||||
use super::error::Error;
|
||||
use super::{get_redis_conn, redis_key};
|
||||
@ -324,16 +324,40 @@ async fn get_dev_euis_for_dev_addr(dev_addr: DevAddr) -> Result<Vec<EUI64>> {
|
||||
.await?
|
||||
}
|
||||
|
||||
async fn remove_dev_eui_from_dev_addr_set(dev_addr: DevAddr, dev_eui: EUI64) -> Result<()> {
|
||||
task::spawn_blocking({
|
||||
let dev_addr = dev_addr;
|
||||
let dev_eui = dev_eui;
|
||||
move || -> Result<()> {
|
||||
let key = redis_key(format!("devaddr:{{{}}}", dev_addr));
|
||||
let mut c = get_redis_conn()?;
|
||||
redis::cmd("SREM")
|
||||
.arg(key)
|
||||
.arg(&dev_eui.to_be_bytes())
|
||||
.query(&mut *c)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
})
|
||||
.await?
|
||||
}
|
||||
|
||||
async fn get_for_dev_addr(dev_addr: DevAddr) -> Result<Vec<internal::DeviceSession>> {
|
||||
trace!(dev_addr = %dev_addr, "Getting device-session for DevAddr");
|
||||
let dev_euis = get_dev_euis_for_dev_addr(dev_addr).await?;
|
||||
|
||||
let mut out = Vec::new();
|
||||
for dev_eui in &dev_euis {
|
||||
let ds = match get(dev_eui).await {
|
||||
for dev_eui in dev_euis {
|
||||
let ds = match get(&dev_eui).await {
|
||||
Ok(v) => v,
|
||||
Err(e) => {
|
||||
warn!(dev_addr = %dev_addr, dev_eui = %dev_eui, error = %e, "Get device-session for DevAddr error");
|
||||
if let Error::NotFound(_) = e {
|
||||
if let Err(e) = remove_dev_eui_from_dev_addr_set(dev_addr, dev_eui).await {
|
||||
error!(dev_addr = %dev_addr, dev_eui = %dev_eui, error = %e, "Remove DevEUI from DevAddr->DevEUI set error");
|
||||
}
|
||||
} else {
|
||||
error!(dev_addr = %dev_addr, dev_eui = %dev_eui, error = %e, "Get device-session for DevEUI error");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
};
|
||||
@ -667,4 +691,49 @@ pub mod test {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_get_for_dev_addr() {
|
||||
let _guard = test::prepare().await;
|
||||
|
||||
let dev_eui_1 = EUI64::from_be_bytes([1, 1, 1, 1, 1, 1, 1, 1]);
|
||||
let dev_eui_2 = EUI64::from_be_bytes([2, 2, 2, 2, 2, 2, 2, 2]);
|
||||
let dev_addr = DevAddr::from_be_bytes([1, 2, 3, 4]);
|
||||
|
||||
let ds_1 = internal::DeviceSession {
|
||||
dev_addr: dev_addr.to_vec(),
|
||||
dev_eui: dev_eui_1.to_vec(),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
let ds_2 = internal::DeviceSession {
|
||||
dev_addr: dev_addr.to_vec(),
|
||||
dev_eui: dev_eui_2.to_vec(),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
save(&ds_1).await.unwrap();
|
||||
save(&ds_2).await.unwrap();
|
||||
|
||||
let dss = get_for_dev_addr(dev_addr).await.unwrap();
|
||||
assert_eq!(2, dss.len());
|
||||
|
||||
let dev_euis = get_dev_euis_for_dev_addr(dev_addr).await.unwrap();
|
||||
assert_eq!(2, dev_euis.len());
|
||||
|
||||
// At this point there is still a 'dangling' pointer from DevAddr->DevEUI.
|
||||
delete(&dev_eui_2).await.unwrap();
|
||||
let dev_euis = get_dev_euis_for_dev_addr(dev_addr).await.unwrap();
|
||||
assert_eq!(2, dev_euis.len());
|
||||
|
||||
// This should only return one device-session.
|
||||
let dss = get_for_dev_addr(dev_addr).await.unwrap();
|
||||
assert_eq!(1, dss.len());
|
||||
assert_eq!(dev_eui_1.to_vec(), dss[0].dev_eui);
|
||||
|
||||
// 'dangling' DevAddr->DevEUI pointers have been cleaned up.
|
||||
let dev_euis = get_dev_euis_for_dev_addr(dev_addr).await.unwrap();
|
||||
assert_eq!(1, dev_euis.len());
|
||||
assert_eq!(dev_eui_1, dev_euis[0]);
|
||||
}
|
||||
}
|
||||
|
@ -429,6 +429,18 @@ pub mod test {
|
||||
let t_get = get(&t.id).await.unwrap();
|
||||
assert_eq!(t, t_get);
|
||||
|
||||
// add tenant user for filter by user_id test
|
||||
let user = create_user().await;
|
||||
|
||||
let tu = TenantUser {
|
||||
tenant_id: t.id,
|
||||
user_id: user.id,
|
||||
is_admin: true,
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
add_user(tu).await.unwrap();
|
||||
|
||||
// get_count and list
|
||||
let tests = vec![
|
||||
FilterTest {
|
||||
@ -481,6 +493,16 @@ pub mod test {
|
||||
limit: 10,
|
||||
offset: 10,
|
||||
},
|
||||
FilterTest {
|
||||
filter: Filters {
|
||||
user_id: Some(user.id),
|
||||
search: None,
|
||||
},
|
||||
ts: vec![&t],
|
||||
count: 1,
|
||||
limit: 10,
|
||||
offset: 0,
|
||||
},
|
||||
];
|
||||
for tst in tests {
|
||||
let count = get_count(&tst.filter).await.unwrap() as usize;
|
||||
|
@ -3,7 +3,7 @@ name = "lrwn"
|
||||
description = "Library for encoding / decoding LoRaWAN frames."
|
||||
homepage = "https://www.chirpstack.io"
|
||||
license = "MIT"
|
||||
version = "4.0.0-rc.3"
|
||||
version = "4.0.0"
|
||||
authors = ["Orne Brocaar <info@brocaar.com>"]
|
||||
edition = "2018"
|
||||
repository = "https://github.com/chirpstack/chirpstack"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "chirpstack-ui",
|
||||
"version": "4.0.0-rc.3",
|
||||
"version": "4.0.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@ant-design/colors": "^6.0.0",
|
||||
@ -68,7 +68,7 @@
|
||||
"not dead",
|
||||
"not op_mini all"
|
||||
],
|
||||
"proxy": "http://127.0.0.1:8080/",
|
||||
"proxy": "http://chirpstack:8080/",
|
||||
"devDependencies": {
|
||||
"husky": "^7.0.4",
|
||||
"prettier": "^2.6.2"
|
||||
|
@ -17,10 +17,13 @@ interface IProps {
|
||||
class MetricChart extends Component<IProps> {
|
||||
render() {
|
||||
let unit: TimeUnit = "hour";
|
||||
let tooltipFormat = "LT";
|
||||
if (this.props.aggregation === Aggregation.DAY) {
|
||||
unit = "day";
|
||||
tooltipFormat = "MMM Do";
|
||||
} else if (this.props.aggregation === Aggregation.MONTH) {
|
||||
unit = "month";
|
||||
tooltipFormat = "MMM YYYY";
|
||||
}
|
||||
|
||||
const animation: false = false;
|
||||
@ -41,6 +44,7 @@ class MetricChart extends Component<IProps> {
|
||||
type: "time" as const,
|
||||
time: {
|
||||
unit: unit,
|
||||
tooltipFormat: tooltipFormat,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -34,7 +34,7 @@ class CreateDeviceProfileTemplate extends Component<RouteComponentProps> {
|
||||
// - data = Object representing the decoded payload.
|
||||
function decodeUplink(input) {
|
||||
return {
|
||||
object: {
|
||||
data: {
|
||||
temp: 22.5
|
||||
}
|
||||
};
|
||||
@ -50,7 +50,7 @@ function decodeUplink(input) {
|
||||
// - bytes = Byte array containing the downlink payload.
|
||||
function encodeDownlink(input) {
|
||||
return {
|
||||
data: [225, 230, 255, 0]
|
||||
bytes: [225, 230, 255, 0]
|
||||
};
|
||||
}
|
||||
`;
|
||||
|
@ -59,7 +59,7 @@ function decodeUplink(input) {
|
||||
// - bytes = Byte array containing the downlink payload.
|
||||
function encodeDownlink(input) {
|
||||
return {
|
||||
data: [225, 230, 255, 0]
|
||||
bytes: [225, 230, 255, 0]
|
||||
};
|
||||
}
|
||||
`;
|
||||
|
@ -469,6 +469,7 @@ class DeviceProfileForm extends Component<IProps, IState> {
|
||||
<Select.Option value={Region.AS923_3}>AS923-3</Select.Option>
|
||||
<Select.Option value={Region.AS923_4}>AS923-4</Select.Option>
|
||||
<Select.Option value={Region.AU915}>AU915</Select.Option>
|
||||
<Select.Option value={Region.CN470}>CN470</Select.Option>
|
||||
<Select.Option value={Region.CN779}>CN779</Select.Option>
|
||||
<Select.Option value={Region.EU433}>EU433</Select.Option>
|
||||
<Select.Option value={Region.EU868}>EU868</Select.Option>
|
||||
|
@ -1881,7 +1881,7 @@
|
||||
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
|
||||
|
||||
"@chirpstack/chirpstack-api-grpc-web@file:../api/grpc-web":
|
||||
version "4.0.0-rc.2"
|
||||
version "4.0.0-rc.4"
|
||||
dependencies:
|
||||
"@types/google-protobuf" "^3.15.2"
|
||||
google-protobuf "^3.17.3"
|
||||
|
Reference in New Issue
Block a user