From 5e63c5efe07387dd5ecd5594a9eaad319b66f68a Mon Sep 17 00:00:00 2001 From: Orne Brocaar Date: Thu, 12 Oct 2023 15:36:11 +0100 Subject: [PATCH] Make it explicit that tx power is in EIRP + fixes. Historically, the tx power was defined as ERP. The Semtech UDP Packet Forwarder protocol was never explicit if the "powe" field was in ERP or EIRP. However, as the antenna gain in the Semtech UDP Packet Forwarder is documented as dBi and is deducted from the "powe" field, this means that "powe" is in EIRP. This commit corrects all values to EIRP, to make sure that if the antenna gain is properly configured (which should be), that the correct rf_power is used by the gateway. --- api/proto/gw/gw.proto | 4 ++-- chirpstack/configuration/region_as923.toml | 2 +- chirpstack/configuration/region_as923_2.toml | 2 +- chirpstack/configuration/region_as923_3.toml | 2 +- chirpstack/configuration/region_as923_4.toml | 2 +- chirpstack/configuration/region_au915_0.toml | 2 +- chirpstack/configuration/region_au915_1.toml | 2 +- chirpstack/configuration/region_au915_2.toml | 2 +- chirpstack/configuration/region_au915_3.toml | 2 +- chirpstack/configuration/region_au915_4.toml | 2 +- chirpstack/configuration/region_au915_5.toml | 2 +- chirpstack/configuration/region_au915_6.toml | 2 +- chirpstack/configuration/region_au915_7.toml | 2 +- chirpstack/configuration/region_cn470_0.toml | 2 +- chirpstack/configuration/region_cn470_1.toml | 2 +- chirpstack/configuration/region_cn470_10.toml | 2 +- chirpstack/configuration/region_cn470_11.toml | 2 +- chirpstack/configuration/region_cn470_2.toml | 2 +- chirpstack/configuration/region_cn470_3.toml | 2 +- chirpstack/configuration/region_cn470_4.toml | 2 +- chirpstack/configuration/region_cn470_5.toml | 2 +- chirpstack/configuration/region_cn470_6.toml | 2 +- chirpstack/configuration/region_cn470_7.toml | 2 +- chirpstack/configuration/region_cn470_8.toml | 2 +- chirpstack/configuration/region_cn470_9.toml | 2 +- chirpstack/configuration/region_cn779.toml | 2 +- chirpstack/configuration/region_eu433.toml | 2 +- chirpstack/configuration/region_eu868.toml | 2 +- chirpstack/configuration/region_in865.toml | 2 +- chirpstack/configuration/region_ism2400.toml | 2 +- chirpstack/configuration/region_kr920.toml | 2 +- chirpstack/configuration/region_ru864.toml | 2 +- chirpstack/configuration/region_us915_0.toml | 2 +- chirpstack/configuration/region_us915_1.toml | 2 +- chirpstack/configuration/region_us915_2.toml | 2 +- chirpstack/configuration/region_us915_3.toml | 2 +- chirpstack/configuration/region_us915_4.toml | 2 +- chirpstack/configuration/region_us915_5.toml | 2 +- chirpstack/configuration/region_us915_6.toml | 2 +- chirpstack/configuration/region_us915_7.toml | 2 +- chirpstack/src/downlink/data.rs | 24 +++++++++++++------ chirpstack/src/downlink/data_fns.rs | 4 ++-- chirpstack/src/downlink/join.rs | 16 +++++++++---- chirpstack/src/downlink/multicast.rs | 2 +- chirpstack/src/downlink/roaming.rs | 4 ++-- lrwn/src/region/as923.rs | 4 ++-- lrwn/src/region/au915.rs | 4 ++-- lrwn/src/region/cn470.rs | 4 ++-- lrwn/src/region/cn779.rs | 4 ++-- lrwn/src/region/eu433.rs | 4 ++-- lrwn/src/region/eu868.rs | 10 ++++---- lrwn/src/region/in865.rs | 4 ++-- lrwn/src/region/ism2400.rs | 2 +- lrwn/src/region/kr920.rs | 2 +- lrwn/src/region/mod.rs | 2 +- lrwn/src/region/ru864.rs | 4 ++-- lrwn/src/region/us915.rs | 4 ++-- 57 files changed, 98 insertions(+), 82 deletions(-) diff --git a/api/proto/gw/gw.proto b/api/proto/gw/gw.proto index 334461d1..3e39682e 100644 --- a/api/proto/gw/gw.proto +++ b/api/proto/gw/gw.proto @@ -368,7 +368,7 @@ message DownlinkTxInfoLegacy { // TX frequency (in Hz). uint32 frequency = 5; - // TX power (in dBm). + // TX power (in dBm EIRP). int32 power = 6; // Modulation. @@ -411,7 +411,7 @@ message DownlinkTxInfo { // TX frequency (in Hz). uint32 frequency = 1; - // TX power (in dBm). + // TX power (in dBm EIRP). int32 power = 2; // Modulation. diff --git a/chirpstack/configuration/region_as923.toml b/chirpstack/configuration/region_as923.toml index 0992c004..a1995d2f 100644 --- a/chirpstack/configuration/region_as923.toml +++ b/chirpstack/configuration/region_as923.toml @@ -153,7 +153,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_as923_2.toml b/chirpstack/configuration/region_as923_2.toml index 04f865e1..18672d1a 100644 --- a/chirpstack/configuration/region_as923_2.toml +++ b/chirpstack/configuration/region_as923_2.toml @@ -153,7 +153,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_as923_3.toml b/chirpstack/configuration/region_as923_3.toml index 7792267d..753a8f74 100644 --- a/chirpstack/configuration/region_as923_3.toml +++ b/chirpstack/configuration/region_as923_3.toml @@ -153,7 +153,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_as923_4.toml b/chirpstack/configuration/region_as923_4.toml index d8a17f7a..b7b125ec 100644 --- a/chirpstack/configuration/region_as923_4.toml +++ b/chirpstack/configuration/region_as923_4.toml @@ -153,7 +153,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_au915_0.toml b/chirpstack/configuration/region_au915_0.toml index 29f903bb..5bb19ee6 100644 --- a/chirpstack/configuration/region_au915_0.toml +++ b/chirpstack/configuration/region_au915_0.toml @@ -195,7 +195,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_au915_1.toml b/chirpstack/configuration/region_au915_1.toml index 6d2e31d6..7bb24e58 100644 --- a/chirpstack/configuration/region_au915_1.toml +++ b/chirpstack/configuration/region_au915_1.toml @@ -195,7 +195,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_au915_2.toml b/chirpstack/configuration/region_au915_2.toml index 26bbf41d..8cd37b87 100644 --- a/chirpstack/configuration/region_au915_2.toml +++ b/chirpstack/configuration/region_au915_2.toml @@ -195,7 +195,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_au915_3.toml b/chirpstack/configuration/region_au915_3.toml index c1098c7b..26481e53 100644 --- a/chirpstack/configuration/region_au915_3.toml +++ b/chirpstack/configuration/region_au915_3.toml @@ -195,7 +195,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_au915_4.toml b/chirpstack/configuration/region_au915_4.toml index ec51fef9..901c7325 100644 --- a/chirpstack/configuration/region_au915_4.toml +++ b/chirpstack/configuration/region_au915_4.toml @@ -195,7 +195,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_au915_5.toml b/chirpstack/configuration/region_au915_5.toml index 59b5f404..34a554c4 100644 --- a/chirpstack/configuration/region_au915_5.toml +++ b/chirpstack/configuration/region_au915_5.toml @@ -195,7 +195,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_au915_6.toml b/chirpstack/configuration/region_au915_6.toml index 21813443..00d53e53 100644 --- a/chirpstack/configuration/region_au915_6.toml +++ b/chirpstack/configuration/region_au915_6.toml @@ -195,7 +195,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_au915_7.toml b/chirpstack/configuration/region_au915_7.toml index 09c5dbab..eb7cabed 100644 --- a/chirpstack/configuration/region_au915_7.toml +++ b/chirpstack/configuration/region_au915_7.toml @@ -195,7 +195,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_cn470_0.toml b/chirpstack/configuration/region_cn470_0.toml index 5686f6ee..e3762916 100644 --- a/chirpstack/configuration/region_cn470_0.toml +++ b/chirpstack/configuration/region_cn470_0.toml @@ -189,7 +189,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_cn470_1.toml b/chirpstack/configuration/region_cn470_1.toml index 277b900f..82c987c7 100644 --- a/chirpstack/configuration/region_cn470_1.toml +++ b/chirpstack/configuration/region_cn470_1.toml @@ -189,7 +189,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_cn470_10.toml b/chirpstack/configuration/region_cn470_10.toml index bd02dd10..c4d9eebd 100644 --- a/chirpstack/configuration/region_cn470_10.toml +++ b/chirpstack/configuration/region_cn470_10.toml @@ -189,7 +189,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_cn470_11.toml b/chirpstack/configuration/region_cn470_11.toml index fb043c6a..30c42d9d 100644 --- a/chirpstack/configuration/region_cn470_11.toml +++ b/chirpstack/configuration/region_cn470_11.toml @@ -189,7 +189,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_cn470_2.toml b/chirpstack/configuration/region_cn470_2.toml index bc308251..1b120787 100644 --- a/chirpstack/configuration/region_cn470_2.toml +++ b/chirpstack/configuration/region_cn470_2.toml @@ -189,7 +189,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_cn470_3.toml b/chirpstack/configuration/region_cn470_3.toml index 6efc24d7..3d647498 100644 --- a/chirpstack/configuration/region_cn470_3.toml +++ b/chirpstack/configuration/region_cn470_3.toml @@ -189,7 +189,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_cn470_4.toml b/chirpstack/configuration/region_cn470_4.toml index 17f46b85..4aef0325 100644 --- a/chirpstack/configuration/region_cn470_4.toml +++ b/chirpstack/configuration/region_cn470_4.toml @@ -189,7 +189,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_cn470_5.toml b/chirpstack/configuration/region_cn470_5.toml index 75256fd9..ff8f2d52 100644 --- a/chirpstack/configuration/region_cn470_5.toml +++ b/chirpstack/configuration/region_cn470_5.toml @@ -189,7 +189,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_cn470_6.toml b/chirpstack/configuration/region_cn470_6.toml index b1d66930..b7be5b86 100644 --- a/chirpstack/configuration/region_cn470_6.toml +++ b/chirpstack/configuration/region_cn470_6.toml @@ -189,7 +189,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_cn470_7.toml b/chirpstack/configuration/region_cn470_7.toml index 70937cf8..f9389cbf 100644 --- a/chirpstack/configuration/region_cn470_7.toml +++ b/chirpstack/configuration/region_cn470_7.toml @@ -189,7 +189,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_cn470_8.toml b/chirpstack/configuration/region_cn470_8.toml index 8fcf3b03..7264a0dd 100644 --- a/chirpstack/configuration/region_cn470_8.toml +++ b/chirpstack/configuration/region_cn470_8.toml @@ -189,7 +189,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_cn470_9.toml b/chirpstack/configuration/region_cn470_9.toml index 87973f70..6aba0870 100644 --- a/chirpstack/configuration/region_cn470_9.toml +++ b/chirpstack/configuration/region_cn470_9.toml @@ -189,7 +189,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_cn779.toml b/chirpstack/configuration/region_cn779.toml index 94aa1635..2817d26e 100644 --- a/chirpstack/configuration/region_cn779.toml +++ b/chirpstack/configuration/region_cn779.toml @@ -159,7 +159,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_eu433.toml b/chirpstack/configuration/region_eu433.toml index c471542c..bb9ba416 100644 --- a/chirpstack/configuration/region_eu433.toml +++ b/chirpstack/configuration/region_eu433.toml @@ -159,7 +159,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_eu868.toml b/chirpstack/configuration/region_eu868.toml index c87f268a..fd0add5a 100644 --- a/chirpstack/configuration/region_eu868.toml +++ b/chirpstack/configuration/region_eu868.toml @@ -201,7 +201,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_in865.toml b/chirpstack/configuration/region_in865.toml index 6b0930b2..75f29795 100644 --- a/chirpstack/configuration/region_in865.toml +++ b/chirpstack/configuration/region_in865.toml @@ -159,7 +159,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_ism2400.toml b/chirpstack/configuration/region_ism2400.toml index 9b37d2db..a85bbbed 100644 --- a/chirpstack/configuration/region_ism2400.toml +++ b/chirpstack/configuration/region_ism2400.toml @@ -159,7 +159,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_kr920.toml b/chirpstack/configuration/region_kr920.toml index c20a9dbb..e4233ce0 100644 --- a/chirpstack/configuration/region_kr920.toml +++ b/chirpstack/configuration/region_kr920.toml @@ -159,7 +159,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_ru864.toml b/chirpstack/configuration/region_ru864.toml index 071be02e..62814da2 100644 --- a/chirpstack/configuration/region_ru864.toml +++ b/chirpstack/configuration/region_ru864.toml @@ -153,7 +153,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_us915_0.toml b/chirpstack/configuration/region_us915_0.toml index 0bca96fd..787ddc91 100644 --- a/chirpstack/configuration/region_us915_0.toml +++ b/chirpstack/configuration/region_us915_0.toml @@ -195,7 +195,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_us915_1.toml b/chirpstack/configuration/region_us915_1.toml index 2ed6b3fe..295a3662 100644 --- a/chirpstack/configuration/region_us915_1.toml +++ b/chirpstack/configuration/region_us915_1.toml @@ -195,7 +195,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_us915_2.toml b/chirpstack/configuration/region_us915_2.toml index 7d906cd6..97d1b875 100644 --- a/chirpstack/configuration/region_us915_2.toml +++ b/chirpstack/configuration/region_us915_2.toml @@ -195,7 +195,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_us915_3.toml b/chirpstack/configuration/region_us915_3.toml index 708e810b..c2d7ea21 100644 --- a/chirpstack/configuration/region_us915_3.toml +++ b/chirpstack/configuration/region_us915_3.toml @@ -195,7 +195,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_us915_4.toml b/chirpstack/configuration/region_us915_4.toml index bd0ac39c..53e81880 100644 --- a/chirpstack/configuration/region_us915_4.toml +++ b/chirpstack/configuration/region_us915_4.toml @@ -195,7 +195,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_us915_5.toml b/chirpstack/configuration/region_us915_5.toml index 3d27aaf6..109d070a 100644 --- a/chirpstack/configuration/region_us915_5.toml +++ b/chirpstack/configuration/region_us915_5.toml @@ -195,7 +195,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_us915_6.toml b/chirpstack/configuration/region_us915_6.toml index d02d935c..b8524291 100644 --- a/chirpstack/configuration/region_us915_6.toml +++ b/chirpstack/configuration/region_us915_6.toml @@ -195,7 +195,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/configuration/region_us915_7.toml b/chirpstack/configuration/region_us915_7.toml index f563ce3f..965858ce 100644 --- a/chirpstack/configuration/region_us915_7.toml +++ b/chirpstack/configuration/region_us915_7.toml @@ -195,7 +195,7 @@ # try to schedule the downlink in RX2, failing that it will try RX1. rx2_prefer_on_link_budget=false - # Downlink TX Power (dBm) + # Downlink TX Power (in dBm EIRP) # # When set to -1, the downlink TX Power from the configured band will # be used. diff --git a/chirpstack/src/downlink/data.rs b/chirpstack/src/downlink/data.rs index ab4afd8b..41101f98 100644 --- a/chirpstack/src/downlink/data.rs +++ b/chirpstack/src/downlink/data.rs @@ -2046,7 +2046,9 @@ impl Data { if self.network_conf.downlink_tx_power != -1 { tx_info.power = self.network_conf.downlink_tx_power; } else { - tx_info.power = self.region_conf.get_downlink_tx_power(tx_info.frequency) as i32; + tx_info.power = self + .region_conf + .get_downlink_tx_power_eirp(tx_info.frequency) as i32; } // set timestamp @@ -2111,7 +2113,9 @@ impl Data { if self.network_conf.downlink_tx_power != -1 { tx_info.power = self.network_conf.downlink_tx_power; } else { - tx_info.power = self.region_conf.get_downlink_tx_power(tx_info.frequency) as i32; + tx_info.power = self + .region_conf + .get_downlink_tx_power_eirp(tx_info.frequency) as i32; } // set timestamp @@ -2189,7 +2193,9 @@ impl Data { if self.network_conf.downlink_tx_power != -1 { tx_info.power = self.network_conf.downlink_tx_power; } else { - tx_info.power = self.region_conf.get_downlink_tx_power(tx_info.frequency) as i32; + tx_info.power = self + .region_conf + .get_downlink_tx_power_eirp(tx_info.frequency) as i32; } // set timestamp @@ -2257,7 +2263,9 @@ impl Data { if self.network_conf.downlink_tx_power != -1 { tx_info.power = self.network_conf.downlink_tx_power; } else { - tx_info.power = self.region_conf.get_downlink_tx_power(tx_info.frequency) as i32; + tx_info.power = self + .region_conf + .get_downlink_tx_power_eirp(tx_info.frequency) as i32; } // set timestamp @@ -2338,7 +2346,9 @@ impl Data { if self.network_conf.downlink_tx_power != -1 { tx_info.power = self.network_conf.downlink_tx_power; } else { - tx_info.power = self.region_conf.get_downlink_tx_power(tx_info.frequency) as i32; + tx_info.power = self + .region_conf + .get_downlink_tx_power_eirp(tx_info.frequency) as i32; } // set timing @@ -2448,7 +2458,7 @@ impl Data { let tx_power_rx1 = if self.network_conf.downlink_tx_power != -1 { self.network_conf.downlink_tx_power } else { - self.region_conf.get_downlink_tx_power( + self.region_conf.get_downlink_tx_power_eirp( self.region_conf.get_rx1_frequency_for_uplink_frequency( self.uplink_frame_set.as_ref().unwrap().tx_info.frequency, )?, @@ -2459,7 +2469,7 @@ impl Data { self.network_conf.downlink_tx_power } else { self.region_conf - .get_downlink_tx_power(self.device_session.rx2_frequency) + .get_downlink_tx_power_eirp(self.device_session.rx2_frequency) as i32 }; diff --git a/chirpstack/src/downlink/data_fns.rs b/chirpstack/src/downlink/data_fns.rs index 57067f2a..83e56b6c 100644 --- a/chirpstack/src/downlink/data_fns.rs +++ b/chirpstack/src/downlink/data_fns.rs @@ -93,7 +93,7 @@ impl Data { ..Default::default() }; - tx_info.power = region_conf.get_downlink_tx_power(tx_info.frequency) as i32; + tx_info.power = region_conf.get_downlink_tx_power_eirp(tx_info.frequency) as i32; let rx1_dr = region_conf.get_data_rate(self.dl_meta_data.data_rate_1.unwrap())?; helpers::set_tx_info_data_rate(&mut tx_info, &rx1_dr)?; @@ -125,7 +125,7 @@ impl Data { ..Default::default() }; - tx_info.power = region_conf.get_downlink_tx_power(tx_info.frequency) as i32; + tx_info.power = region_conf.get_downlink_tx_power_eirp(tx_info.frequency) as i32; let rx2_dr = region_conf.get_data_rate(self.dl_meta_data.data_rate_2.unwrap())?; helpers::set_tx_info_data_rate(&mut tx_info, &rx2_dr)?; diff --git a/chirpstack/src/downlink/join.rs b/chirpstack/src/downlink/join.rs index 7a8db105..8fc6c099 100644 --- a/chirpstack/src/downlink/join.rs +++ b/chirpstack/src/downlink/join.rs @@ -256,7 +256,9 @@ impl JoinAccept<'_> { if self.network_conf.downlink_tx_power != -1 { tx_info.power = self.network_conf.downlink_tx_power; } else { - tx_info.power = self.region_conf.get_downlink_tx_power(tx_info.frequency) as i32; + tx_info.power = self + .region_conf + .get_downlink_tx_power_eirp(tx_info.frequency) as i32; } // Set timestamp. @@ -313,7 +315,9 @@ impl JoinAccept<'_> { if self.network_conf.downlink_tx_power != -1 { tx_info.power = self.network_conf.downlink_tx_power; } else { - tx_info.power = self.region_conf.get_downlink_tx_power(tx_info.frequency) as i32; + tx_info.power = self + .region_conf + .get_downlink_tx_power_eirp(tx_info.frequency) as i32; } // Set timestamp. @@ -365,7 +369,9 @@ impl JoinAccept<'_> { if self.network_conf.downlink_tx_power != -1 { tx_info.power = self.network_conf.downlink_tx_power; } else { - tx_info.power = self.region_conf.get_downlink_tx_power(tx_info.frequency) as i32; + tx_info.power = self + .region_conf + .get_downlink_tx_power_eirp(tx_info.frequency) as i32; } // Set timestamp. @@ -416,7 +422,9 @@ impl JoinAccept<'_> { if self.network_conf.downlink_tx_power != -1 { tx_info.power = self.network_conf.downlink_tx_power; } else { - tx_info.power = self.region_conf.get_downlink_tx_power(tx_info.frequency) as i32; + tx_info.power = self + .region_conf + .get_downlink_tx_power_eirp(tx_info.frequency) as i32; } // Set timestamp. diff --git a/chirpstack/src/downlink/multicast.rs b/chirpstack/src/downlink/multicast.rs index 2c204d16..4f518571 100644 --- a/chirpstack/src/downlink/multicast.rs +++ b/chirpstack/src/downlink/multicast.rs @@ -136,7 +136,7 @@ impl Multicast { if network_conf.downlink_tx_power != -1 { tx_info.power = network_conf.downlink_tx_power; } else { - tx_info.power = region_conf.get_downlink_tx_power(tx_info.frequency) as i32; + tx_info.power = region_conf.get_downlink_tx_power_eirp(tx_info.frequency) as i32; } match self.multicast_group_queue_item.emit_at_time_since_gps_epoch { diff --git a/chirpstack/src/downlink/roaming.rs b/chirpstack/src/downlink/roaming.rs index 8f4cc12a..db81d76e 100644 --- a/chirpstack/src/downlink/roaming.rs +++ b/chirpstack/src/downlink/roaming.rs @@ -148,7 +148,7 @@ impl PassiveRoamingDownlink { power: if self.network_conf.downlink_tx_power != -1 { self.network_conf.downlink_tx_power } else { - self.region_conf.get_downlink_tx_power(dl_freq_1) as i32 + self.region_conf.get_downlink_tx_power_eirp(dl_freq_1) as i32 }, ..Default::default() }; @@ -190,7 +190,7 @@ impl PassiveRoamingDownlink { power: if self.network_conf.downlink_tx_power != -1 { self.network_conf.downlink_tx_power } else { - self.region_conf.get_downlink_tx_power(dl_freq_2) as i32 + self.region_conf.get_downlink_tx_power_eirp(dl_freq_2) as i32 }, ..Default::default() }; diff --git a/lrwn/src/region/as923.rs b/lrwn/src/region/as923.rs index 512537e3..f569cf20 100644 --- a/lrwn/src/region/as923.rs +++ b/lrwn/src/region/as923.rs @@ -844,8 +844,8 @@ impl Region for Configuration { Ok(923400000 - self.freq_offset) } - fn get_downlink_tx_power(&self, _freq: u32) -> isize { - 14 + fn get_downlink_tx_power_eirp(&self, _frequency: u32) -> isize { + 16 } fn get_defaults(&self) -> Defaults { diff --git a/lrwn/src/region/au915.rs b/lrwn/src/region/au915.rs index 7c5bd726..71e8820b 100644 --- a/lrwn/src/region/au915.rs +++ b/lrwn/src/region/au915.rs @@ -992,8 +992,8 @@ impl Region for Configuration { Ok(self.base.downlink_channels[down_channel].frequency) } - fn get_downlink_tx_power(&self, _freq: u32) -> isize { - 27 + fn get_downlink_tx_power_eirp(&self, _frequency: u32) -> isize { + 30 } fn get_defaults(&self) -> Defaults { diff --git a/lrwn/src/region/cn470.rs b/lrwn/src/region/cn470.rs index 473f2552..e23ba19e 100644 --- a/lrwn/src/region/cn470.rs +++ b/lrwn/src/region/cn470.rs @@ -462,8 +462,8 @@ impl Region for Configuration { Ok(beacon_freqs[down_channel]) } - fn get_downlink_tx_power(&self, _freq: u32) -> isize { - 14 + fn get_downlink_tx_power_eirp(&self, _frequency: u32) -> isize { + 19 } fn get_defaults(&self) -> Defaults { diff --git a/lrwn/src/region/cn779.rs b/lrwn/src/region/cn779.rs index 00eafc64..fdbb0f57 100644 --- a/lrwn/src/region/cn779.rs +++ b/lrwn/src/region/cn779.rs @@ -440,8 +440,8 @@ impl Region for Configuration { Ok(785000000) } - fn get_downlink_tx_power(&self, _freq: u32) -> isize { - 10 + fn get_downlink_tx_power_eirp(&self, _frequency: u32) -> isize { + 12 } fn get_defaults(&self) -> Defaults { diff --git a/lrwn/src/region/eu433.rs b/lrwn/src/region/eu433.rs index f5ac4a69..f3cd7d35 100644 --- a/lrwn/src/region/eu433.rs +++ b/lrwn/src/region/eu433.rs @@ -484,8 +484,8 @@ impl Region for Configuration { Ok(434665000) } - fn get_downlink_tx_power(&self, _freq: u32) -> isize { - 10 + fn get_downlink_tx_power_eirp(&self, _frequency: u32) -> isize { + 12 } fn get_defaults(&self) -> Defaults { diff --git a/lrwn/src/region/eu868.rs b/lrwn/src/region/eu868.rs index 99a8df23..d60aa8a5 100644 --- a/lrwn/src/region/eu868.rs +++ b/lrwn/src/region/eu868.rs @@ -601,15 +601,13 @@ impl Region for Configuration { Ok(869525000) } - fn get_downlink_tx_power(&self, freq: u32) -> isize { - // NOTE: as there are currently no further boundary checks on the frequency, this check is sufficient. - // TODO: However, there should be some mechanism, that checks the frequency for compliance to regulations. + fn get_downlink_tx_power_eirp(&self, freq: u32) -> isize { if (863000000..869200000).contains(&freq) { - 14 //25mW + 16 } else if (869400000..869650000).contains(&freq) { - 27 //500mW + 29 } else { - 14 // Default case + 16 } } diff --git a/lrwn/src/region/in865.rs b/lrwn/src/region/in865.rs index 4d3bbb0d..0c4c2ff3 100644 --- a/lrwn/src/region/in865.rs +++ b/lrwn/src/region/in865.rs @@ -390,8 +390,8 @@ impl Region for Configuration { Ok(866550000) } - fn get_downlink_tx_power(&self, _freq: u32) -> isize { - 27 + fn get_downlink_tx_power_eirp(&self, _frequency: u32) -> isize { + 30 } fn get_defaults(&self) -> Defaults { diff --git a/lrwn/src/region/ism2400.rs b/lrwn/src/region/ism2400.rs index a9401dc2..76d91335 100644 --- a/lrwn/src/region/ism2400.rs +++ b/lrwn/src/region/ism2400.rs @@ -266,7 +266,7 @@ impl Region for Configuration { Ok(2424000000) } - fn get_downlink_tx_power(&self, _freq: u32) -> isize { + fn get_downlink_tx_power_eirp(&self, _frequency: u32) -> isize { 10 } diff --git a/lrwn/src/region/kr920.rs b/lrwn/src/region/kr920.rs index 157488aa..27b2f9b7 100644 --- a/lrwn/src/region/kr920.rs +++ b/lrwn/src/region/kr920.rs @@ -362,7 +362,7 @@ impl Region for Configuration { Ok(923100000) } - fn get_downlink_tx_power(&self, _freq: u32) -> isize { + fn get_downlink_tx_power_eirp(&self, _frequency: u32) -> isize { 23 } diff --git a/lrwn/src/region/mod.rs b/lrwn/src/region/mod.rs index bd4c187b..6b1d6d64 100644 --- a/lrwn/src/region/mod.rs +++ b/lrwn/src/region/mod.rs @@ -447,7 +447,7 @@ pub trait Region { /// Returns the TX power for downlink transmissions using the given frequency. /// Depending the band, it could return different values for different frequencies. - fn get_downlink_tx_power(&self, frequency: u32) -> isize; + fn get_downlink_tx_power_eirp(&self, frequency: u32) -> isize; /// Returns the defaults. fn get_defaults(&self) -> Defaults; diff --git a/lrwn/src/region/ru864.rs b/lrwn/src/region/ru864.rs index 776b3d7e..663ea990 100644 --- a/lrwn/src/region/ru864.rs +++ b/lrwn/src/region/ru864.rs @@ -340,8 +340,8 @@ impl Region for Configuration { Ok(868900000) } - fn get_downlink_tx_power(&self, _freq: u32) -> isize { - 14 + fn get_downlink_tx_power_eirp(&self, _frequency: u32) -> isize { + 16 } fn get_defaults(&self) -> Defaults { diff --git a/lrwn/src/region/us915.rs b/lrwn/src/region/us915.rs index 8298478b..14b74a9f 100644 --- a/lrwn/src/region/us915.rs +++ b/lrwn/src/region/us915.rs @@ -680,8 +680,8 @@ impl Region for Configuration { Ok(self.base.downlink_channels[down_channel].frequency) } - fn get_downlink_tx_power(&self, _freq: u32) -> isize { - 20 + fn get_downlink_tx_power_eirp(&self, _frequency: u32) -> isize { + 21 } fn get_defaults(&self) -> Defaults {