From 5450c88226a97dc31bd516ed6dc5b4efb4887a5a Mon Sep 17 00:00:00 2001 From: Yorick Smilda Date: Thu, 23 Feb 2023 11:44:42 +0100 Subject: [PATCH] Convert existing plans to new structure --- README.md | 4 +- docs/frequency-plans.md | 55 +++- docs/images/end-device/AS_920_923.svg | 271 ++++++++++++++++ docs/images/end-device/AS_920_923_LBT.svg | 271 ++++++++++++++++ docs/images/end-device/EU_433.svg | 258 +++++++++++++++ .../end-device/EU_863_870_ROAMING_DRAFT.svg | 210 ++++++++++++ docs/images/end-device/US_902_928_FSB_1.svg | 170 ++++++++++ docs/images/gateway/AS_920_923.svg | 306 ++++++++++++++++++ docs/images/gateway/AS_920_923_LBT.svg | 306 ++++++++++++++++++ docs/images/gateway/EU_433.svg | 297 +++++++++++++++++ end-device/AS_920_923.yml | 43 +++ end-device/EU_433.yml | 43 +++ end-device/EU_863_870_ROAMING_DRAFT.yml | 31 ++ end-device/US_902_928_FSB_1.yml | 36 +++ end-device/modifiers/disable_dwell_time.yml | 4 + .../modifiers/enable_dwell_time_400ms.yml | 4 + end-device/modifiers/lbt_80_over_128.yml | 4 + end-device/schema.json | 2 +- frequency-plans.yml | 74 +++++ gateway/AS_920_923.yml | 66 ++++ gateway/EU_433.yml | 64 ++++ gateway/modifiers/disable_dwell_time.yml | 4 + gateway/modifiers/enable_dwell_time_400ms.yml | 4 + gateway/modifiers/lbt_80_over_128.yml | 4 + gateway/schema.json | 2 +- internal/docs/end-device.go | 3 + internal/docs/frequency-plans.md.tmpl | 4 +- internal/model/end-device-frequency-plan.go | 24 +- internal/model/gateway-frequency-plan.go | 18 +- internal/model/model.go | 18 +- ...equency-plans-description-schema.json.tmpl | 2 + ...requency-plans-end-device-schema.json.tmpl | 2 +- .../frequency-plans-gateway-schema.json.tmpl | 2 +- schema.json | 14 +- 34 files changed, 2569 insertions(+), 51 deletions(-) create mode 100644 docs/images/end-device/AS_920_923.svg create mode 100644 docs/images/end-device/AS_920_923_LBT.svg create mode 100644 docs/images/end-device/EU_433.svg create mode 100644 docs/images/end-device/EU_863_870_ROAMING_DRAFT.svg create mode 100644 docs/images/end-device/US_902_928_FSB_1.svg create mode 100644 docs/images/gateway/AS_920_923.svg create mode 100644 docs/images/gateway/AS_920_923_LBT.svg create mode 100644 docs/images/gateway/EU_433.svg create mode 100644 end-device/AS_920_923.yml create mode 100644 end-device/EU_433.yml create mode 100644 end-device/EU_863_870_ROAMING_DRAFT.yml create mode 100644 end-device/US_902_928_FSB_1.yml create mode 100644 end-device/modifiers/disable_dwell_time.yml create mode 100644 end-device/modifiers/enable_dwell_time_400ms.yml create mode 100644 end-device/modifiers/lbt_80_over_128.yml create mode 100644 gateway/AS_920_923.yml create mode 100644 gateway/EU_433.yml create mode 100644 gateway/modifiers/disable_dwell_time.yml create mode 100644 gateway/modifiers/enable_dwell_time_400ms.yml create mode 100644 gateway/modifiers/lbt_80_over_128.yml diff --git a/README.md b/README.md index 9380d28..0d78d5a 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ sub-bands: max-eirp: 16.15 # Maximum EIRP for this sub-band (optional; takes precedence over frequency plan's max-eirp) channels: # List of channels (zero indexed) - uplink-frequency: 868100000 # Uplink frequency (Hz) - downlink-frequency: 868100000 # Downlink frequency (Hz) (optional) + downlink-frequency: 868100000 # Downlink frequency (Hz) min-data-rate: SF7BW125 # Minimum data rate max-data-rate: SF11BW125 # Maximum data rate radio: 0 # Radio index (see below) @@ -159,6 +159,8 @@ There are json schemas available for all configuration files. These define files } ``` +Make sure to run `go run . -schema -docs` after changes or additions to the frequency plans. This ensures that the schemas and documentation stay up to date. + ### Local Regulations When submitting a new frequency plan or making changes to an existing frequency plan, please make sure that the band is allowed to be used in the concerning region and that settings respect regional regulations. When submitting a pull request for a new region, please upload or link to a document that describes the local regulations. diff --git a/docs/frequency-plans.md b/docs/frequency-plans.md index d20bfaa..38e6416 100644 --- a/docs/frequency-plans.md +++ b/docs/frequency-plans.md @@ -9,18 +9,67 @@ ![EU_863_870](images/end-device/EU_863_870.svg) ## `EU_863_870_TTN`: Europe 863-870 MHz -Based on [EU_863_870](##EU_863_870) and modified by [rx2_default_data_rata_3.yml](../end-device/modifiers/rx2_default_data_rata_3.yml) - +Based on [EU_863_870](##EU_863_870) and modified by [rx2_default_data_rata_3.yml](../end-device/modifiers/rx2_default_data_rata_3.yml) >> TTN Community Network frequency plan for Europe, using SF9 for RX2 ![EU_863_870_TTN](images/end-device/EU_863_870_TTN.svg) -# Gateway frequency plans +## [`EU_863_870_ROAMING_DRAFT`](../end-device/EU_863_870_ROAMING_DRAFT.yml): Europe 863-870 MHz, 6 channels for roaming (Draft) + +>> European 6 channel plan used by major operators to support LoRaWAN Passive Roaming + +![EU_863_870_ROAMING_DRAFT](images/end-device/EU_863_870_ROAMING_DRAFT.svg) + +## [`EU_433`](../end-device/EU_433.yml): Europe 433 MHz (ITU region 1) + +>> Default frequency plan for worldwide 433MHz + +![EU_433](images/end-device/EU_433.svg) + +## [`US_902_928_FSB_1`](../end-device/US_902_928_FSB_1.yml): United States 902-928 MHz, FSB 1 + +>> Default frequency plan for the United States and Canada, using sub-band 1 + +![US_902_928_FSB_1](images/end-device/US_902_928_FSB_1.svg) + +## [`AS_920_923`](../end-device/AS_920_923.yml): Asia 920-923 MHz + +>> TTN Community Network frequency plan for Asian countries, using frequencies ≤ 923 MHz + +![AS_920_923](images/end-device/AS_920_923.svg) + +## `AS_920_923_LBT`: Asia 920-923 MHz with LBT +Based on [AS_920_923](##AS_920_923) and modified by [lbt_80_over_128.yml](../end-device/modifiers/lbt_80_over_128.yml) +>> TTN Community Network frequency plan for Asian countries, using frequencies ≤ 923 MHz with listen-before-talk + +![AS_920_923_LBT](images/end-device/AS_920_923_LBT.svg) + +# Gateway frequency plans ## [`EU_863_870`](../gateway/EU_863_870.yml): Europe 863-870 MHz >> Default frequency plan for Europe ![EU_863_870](images/gateway/EU_863_870.svg) + +## [`EU_433`](../gateway/EU_433.yml): Europe 433 MHz (ITU region 1) + +>> Default frequency plan for worldwide 433MHz + +![EU_433](images/gateway/EU_433.svg) + +## [`AS_920_923`](../gateway/AS_920_923.yml): Asia 920-923 MHz + +>> TTN Community Network frequency plan for Asian countries, using frequencies ≤ 923 MHz + +![AS_920_923](images/gateway/AS_920_923.svg) + +## `AS_920_923_LBT`: Asia 920-923 MHz with LBT +Based on AS_920_923 and modified by [lbt_80_over_128.yml](../gateway/modifiers/lbt_80_over_128.yml) + + +>> TTN Community Network frequency plan for Asian countries, using frequencies ≤ 923 MHz with listen-before-talk + +![AS_920_923_LBT](images/gateway/AS_920_923_LBT.svg) diff --git a/docs/images/end-device/AS_920_923.svg b/docs/images/end-device/AS_920_923.svg new file mode 100644 index 0000000..3153466 --- /dev/null +++ b/docs/images/end-device/AS_920_923.svg @@ -0,0 +1,271 @@ +\n921.8922922.2922.4922.6922.8923923.2923.4DownlinkRadioUplinkStd/FSK0.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.00923.2923.2923.4923.4922.2922.2922.4922.4922.6922.6922.8922.8923923922922921.8 (FSK)AS_920_923 \ No newline at end of file diff --git a/docs/images/end-device/AS_920_923_LBT.svg b/docs/images/end-device/AS_920_923_LBT.svg new file mode 100644 index 0000000..9d13638 --- /dev/null +++ b/docs/images/end-device/AS_920_923_LBT.svg @@ -0,0 +1,271 @@ +\n921.8922922.2922.4922.6922.8923923.2923.4DownlinkRadioUplinkStd/FSK0.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.00923.2923.2923.4923.4922.2922.2922.4922.4922.6922.6922.8922.8923923922922921.8 (FSK)AS_920_923_LBT \ No newline at end of file diff --git a/docs/images/end-device/EU_433.svg b/docs/images/end-device/EU_433.svg new file mode 100644 index 0000000..b6c86e7 --- /dev/null +++ b/docs/images/end-device/EU_433.svg @@ -0,0 +1,258 @@ +\n433.175433.375433.575433.775433.975434.175434.375434.575DownlinkRadioUplinkStd/FSK0.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.00433.175433.175433.375433.375433.575433.575433.775433.775433.975433.975434.175434.175434.375434.375434.575434.575EU_433 \ No newline at end of file diff --git a/docs/images/end-device/EU_863_870_ROAMING_DRAFT.svg b/docs/images/end-device/EU_863_870_ROAMING_DRAFT.svg new file mode 100644 index 0000000..1c4a6b6 --- /dev/null +++ b/docs/images/end-device/EU_863_870_ROAMING_DRAFT.svg @@ -0,0 +1,210 @@ +\n867.1867.3867.9868.1868.3868.5DownlinkRadioUplinkStd/FSK0.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.00868.1868.1868.3868.3868.5868.5867.1867.1867.3867.3867.9867.9EU_863_870_ROAMING_DRAFT \ No newline at end of file diff --git a/docs/images/end-device/US_902_928_FSB_1.svg b/docs/images/end-device/US_902_928_FSB_1.svg new file mode 100644 index 0000000..f176b3a --- /dev/null +++ b/docs/images/end-device/US_902_928_FSB_1.svg @@ -0,0 +1,170 @@ +\n902.3902.5902.7902.9903.1903.3903.5903.7DownlinkRadioUplinkStd/FSK0.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.00902.3902.5902.7902.9903.1903.3903.5903.7US_902_928_FSB_1 \ No newline at end of file diff --git a/docs/images/gateway/AS_920_923.svg b/docs/images/gateway/AS_920_923.svg new file mode 100644 index 0000000..e769514 --- /dev/null +++ b/docs/images/gateway/AS_920_923.svg @@ -0,0 +1,306 @@ +\n921.638921.8922922.1922.2922.4922.538922.562922.6922.8923923.2923.4923.462DownlinkRadioUplinkStd/FSK0.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.00923.2923.2923.4923.4922.2922.2922.4922.4922.6922.6922.8922.8923923922922922.1 (Std)921.8 (FSK)Radio 0: 923Radio 1: 922.1AS_920_923 \ No newline at end of file diff --git a/docs/images/gateway/AS_920_923_LBT.svg b/docs/images/gateway/AS_920_923_LBT.svg new file mode 100644 index 0000000..e4763d8 --- /dev/null +++ b/docs/images/gateway/AS_920_923_LBT.svg @@ -0,0 +1,306 @@ +\n921.638921.8922922.1922.2922.4922.538922.562922.6922.8923923.2923.4923.462DownlinkRadioUplinkStd/FSK0.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.00923.2923.2923.4923.4922.2922.2922.4922.4922.6922.6922.8922.8923923922922922.1 (Std)921.8 (FSK)Radio 0: 923Radio 1: 922.1AS_920_923_LBT \ No newline at end of file diff --git a/docs/images/gateway/EU_433.svg b/docs/images/gateway/EU_433.svg new file mode 100644 index 0000000..e3c54ad --- /dev/null +++ b/docs/images/gateway/EU_433.svg @@ -0,0 +1,297 @@ +\n433.012433.175433.375433.475433.575433.775433.812433.938433.975434.075434.175434.275434.375434.575434.738DownlinkRadioUplinkStd/FSK0.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.000.00433.175433.175433.375433.375433.575433.575433.775433.775433.975433.975434.175434.175434.375434.375434.575434.575434.075 (Std)Radio 0: 433.475Radio 1: 434.275EU_433 \ No newline at end of file diff --git a/end-device/AS_920_923.yml b/end-device/AS_920_923.yml new file mode 100644 index 0000000..bd3236d --- /dev/null +++ b/end-device/AS_920_923.yml @@ -0,0 +1,43 @@ +band-id: AS_923 +sub-bands: +- min-frequency: 922000000 + max-frequency: 923400000 +channels: +- uplink-frequency: 923200000 + downlink-frequency: 923200000 + min-data-rate: 0 + max-data-rate: 5 +- uplink-frequency: 923400000 + downlink-frequency: 923400000 + min-data-rate: 0 + max-data-rate: 5 +- uplink-frequency: 922200000 + downlink-frequency: 922200000 + min-data-rate: 0 + max-data-rate: 5 +- uplink-frequency: 922400000 + downlink-frequency: 922400000 + min-data-rate: 0 + max-data-rate: 5 +- uplink-frequency: 922600000 + downlink-frequency: 922600000 + min-data-rate: 0 + max-data-rate: 5 +- uplink-frequency: 922800000 + downlink-frequency: 922800000 + min-data-rate: 0 + max-data-rate: 5 +- uplink-frequency: 923000000 + downlink-frequency: 923000000 + min-data-rate: 0 + max-data-rate: 5 +- uplink-frequency: 922000000 + downlink-frequency: 922000000 + min-data-rate: 0 + max-data-rate: 5 +lora-standard-channel: + frequency: 922100000 + data-rate: 6 +fsk-channel: + frequency: 921800000 + data-rate: 7 diff --git a/end-device/EU_433.yml b/end-device/EU_433.yml new file mode 100644 index 0000000..5b5aaa3 --- /dev/null +++ b/end-device/EU_433.yml @@ -0,0 +1,43 @@ +band-id: EU_433 +sub-bands: +- min-frequency: 433050000 + max-frequency: 434790000 + duty-cycle: 0.1 # NOTE: ETSI EN300220 limit is 10%; LoRaWAN limit for end-devices is 1% + max-eirp: 12.15 +channels: +- uplink-frequency: 433175000 + downlink-frequency: 433175000 + min-data-rate: 0 + max-data-rate: 5 +- uplink-frequency: 433375000 + downlink-frequency: 433375000 + min-data-rate: 0 + max-data-rate: 5 +- uplink-frequency: 433575000 + downlink-frequency: 433575000 + min-data-rate: 0 + max-data-rate: 5 +- uplink-frequency: 433775000 + downlink-frequency: 433775000 + min-data-rate: 0 + max-data-rate: 5 +- uplink-frequency: 433975000 + downlink-frequency: 433975000 + min-data-rate: 0 + max-data-rate: 5 +- uplink-frequency: 434175000 + downlink-frequency: 434175000 + min-data-rate: 0 + max-data-rate: 5 +- uplink-frequency: 434375000 + downlink-frequency: 434375000 + min-data-rate: 0 + max-data-rate: 5 +- uplink-frequency: 434575000 + downlink-frequency: 434575000 + min-data-rate: 0 + max-data-rate: 5 +lora-standard-channel: + frequency: 434075000 + data-rate: 6 + diff --git a/end-device/EU_863_870_ROAMING_DRAFT.yml b/end-device/EU_863_870_ROAMING_DRAFT.yml new file mode 100644 index 0000000..e097000 --- /dev/null +++ b/end-device/EU_863_870_ROAMING_DRAFT.yml @@ -0,0 +1,31 @@ + +band-id: EU_863_870 +sub-bands: + - min-frequency: 867100000 + max-frequency: 868500000 +channels: +- uplink-frequency: 868100000 + downlink-frequency: 868100000 + min-data-rate: 0 + max-data-rate: 5 +- uplink-frequency: 868300000 + downlink-frequency: 868300000 + min-data-rate: 0 + max-data-rate: 5 +- uplink-frequency: 868500000 + downlink-frequency: 868500000 + min-data-rate: 0 + max-data-rate: 5 +- uplink-frequency: 867100000 + downlink-frequency: 867100000 + min-data-rate: 0 + max-data-rate: 5 +- uplink-frequency: 867300000 + downlink-frequency: 867300000 + min-data-rate: 0 + max-data-rate: 5 +- uplink-frequency: 867900000 + downlink-frequency: 867900000 + min-data-rate: 0 + max-data-rate: 5 + diff --git a/end-device/US_902_928_FSB_1.yml b/end-device/US_902_928_FSB_1.yml new file mode 100644 index 0000000..a2faff0 --- /dev/null +++ b/end-device/US_902_928_FSB_1.yml @@ -0,0 +1,36 @@ +band-id: US_902_928 +sub-bands: + - min-frequency: 902300000 + max-frequency: 903700000 +channels: +- uplink-frequency: 902300000 + min-data-rate: 0 + max-data-rate: 3 +- uplink-frequency: 902500000 + min-data-rate: 0 + max-data-rate: 3 +- uplink-frequency: 902700000 + min-data-rate: 0 + max-data-rate: 3 +- uplink-frequency: 902900000 + min-data-rate: 0 + max-data-rate: 3 +- uplink-frequency: 903100000 + min-data-rate: 0 + max-data-rate: 3 +- uplink-frequency: 903300000 + min-data-rate: 0 + max-data-rate: 3 +- uplink-frequency: 903500000 + min-data-rate: 0 + max-data-rate: 3 +- uplink-frequency: 903700000 + min-data-rate: 0 + max-data-rate: 3 +lora-standard-channel: + frequency: 903000000 + data-rate: 12 +dwell-time: + uplinks: true + downlinks: false + duration: 400ms diff --git a/end-device/modifiers/disable_dwell_time.yml b/end-device/modifiers/disable_dwell_time.yml new file mode 100644 index 0000000..4debef4 --- /dev/null +++ b/end-device/modifiers/disable_dwell_time.yml @@ -0,0 +1,4 @@ +dwell-time: + uplinks: false + downlinks: false + duration: 0ms \ No newline at end of file diff --git a/end-device/modifiers/enable_dwell_time_400ms.yml b/end-device/modifiers/enable_dwell_time_400ms.yml new file mode 100644 index 0000000..291fe42 --- /dev/null +++ b/end-device/modifiers/enable_dwell_time_400ms.yml @@ -0,0 +1,4 @@ +dwell-time: + uplinks: true + downlinks: true + duration: 400ms \ No newline at end of file diff --git a/end-device/modifiers/lbt_80_over_128.yml b/end-device/modifiers/lbt_80_over_128.yml new file mode 100644 index 0000000..e1d43b8 --- /dev/null +++ b/end-device/modifiers/lbt_80_over_128.yml @@ -0,0 +1,4 @@ +listen-before-talk: + rssi-offset: -4 + rssi-target: -80 + scan-time: 128000 \ No newline at end of file diff --git a/end-device/schema.json b/end-device/schema.json index 205e457..9e493f7 100644 --- a/end-device/schema.json +++ b/end-device/schema.json @@ -48,7 +48,7 @@ }, "downlink-frequency": { "type": "integer", - "description": "Downlink frequency [Hz] (optional)" + "description": "Downlink frequency [Hz]" }, "min-data-rate": { "type": "integer", diff --git a/frequency-plans.yml b/frequency-plans.yml index fbce7d6..8aeb7d4 100644 --- a/frequency-plans.yml +++ b/frequency-plans.yml @@ -18,6 +18,52 @@ end-device-descriptions: modifiers: [rx2_default_data_rata_3.yml] endorsed: true +- id: EU_863_870_ROAMING_DRAFT + band-id: EU_863_870 + name: Europe 863-870 MHz, 6 channels for roaming (Draft) + description: European 6 channel plan used by major operators to support LoRaWAN Passive Roaming + base-frequency: 868 + country-codes: [al, ad, ao, at, bh, be, ba, bw, bg, cg, hr, cy, cz, dk, ee, sz, fi, fr, gr, hu, is, ie, it, lv, ls, li, lt, lu, mg, mw, mt, mu, md, me, mz, na, nl, mk, ph, pl, pt, ro, ru, sa, rs, sc, sk, si, za, es, se, ch, tz, tr, ae, gb, va, zm, zw] + file: EU_863_870_ROAMING_DRAFT.yml + endorsed: false + +- id: EU_433 + band-id: EU_433 + name: Europe 433 MHz (ITU region 1) + description: Default frequency plan for worldwide 433MHz + base-frequency: 433 + country-codes: [worldwide] + file: EU_433.yml + endorsed: true + +- id: US_902_928_FSB_1 + band-id: US_902_928 + name: United States 902-928 MHz, FSB 1 + description: Default frequency plan for the United States and Canada, using sub-band 1 + base-frequency: 915 + country-codes: [ca, cr, ec, gy, mx, pa, pr, us] + file: US_902_928_FSB_1.yml + endorsed: true + +- id: AS_920_923 + band-id: AS_923 + name: Asia 920-923 MHz + description: TTN Community Network frequency plan for Asian countries, using frequencies ≤ 923 MHz + base-frequency: 915 + country-codes: [my, sg] + file: AS_920_923.yml + endorsed: true + +- id: AS_920_923_LBT + band-id: AS_923 + base-id: AS_920_923 + name: Asia 920-923 MHz with LBT + description: TTN Community Network frequency plan for Asian countries, using frequencies ≤ 923 MHz with listen-before-talk + base-frequency: 915 + country-codes: [jp, my, sg] + modifiers: [lbt_80_over_128.yml] + endorsed: false + gateway-descriptions: - id: EU_863_870 band-id: EU_863_870 @@ -27,3 +73,31 @@ gateway-descriptions: country-codes: [al, ad, ao, at, bh, be, ba, bw, bg, cg, hr, cy, cz, dk, ee, sz, fi, fr, gr, hu, is, ie, it, lv, ls, li, lt, lu, mg, mw, mt, mu, md, me, mz, na, nl, mk, ph, pl, pt, ro, ru, sa, rs, sc, sk, si, za, es, se, ch, tz, tr, ae, gb, va, zm, zw] file: EU_863_870.yml endorsed: false + +- id: EU_433 + band-id: EU_433 + name: Europe 433 MHz (ITU region 1) + description: Default frequency plan for worldwide 433MHz + base-frequency: 433 + country-codes: [worldwide] + file: EU_433.yml + endorsed: true + +- id: AS_920_923 + band-id: AS_923 + name: Asia 920-923 MHz + description: TTN Community Network frequency plan for Asian countries, using frequencies ≤ 923 MHz + base-frequency: 915 + country-codes: [my, sg] + file: AS_920_923.yml + endorsed: true + +- id: AS_920_923_LBT + band-id: AS_923 + base-id: AS_920_923 + name: Asia 920-923 MHz with LBT + description: TTN Community Network frequency plan for Asian countries, using frequencies ≤ 923 MHz with listen-before-talk + base-frequency: 915 + country-codes: [jp, my, sg] + modifiers: [lbt_80_over_128.yml] + endorsed: false diff --git a/gateway/AS_920_923.yml b/gateway/AS_920_923.yml new file mode 100644 index 0000000..6a11d90 --- /dev/null +++ b/gateway/AS_920_923.yml @@ -0,0 +1,66 @@ +band-id: AS_923 +sub-bands: +- min-frequency: 922000000 + max-frequency: 923400000 +channels: +- uplink-frequency: 923200000 + downlink-frequency: 923200000 + min-data-rate: SF7BW125 + max-data-rate: SF12BW125 + radio: 0 +- uplink-frequency: 923400000 + downlink-frequency: 923400000 + min-data-rate: SF7BW125 + max-data-rate: SF12BW125 + radio: 0 +- uplink-frequency: 922200000 + downlink-frequency: 922200000 + min-data-rate: SF7BW125 + max-data-rate: SF12BW125 + radio: 1 +- uplink-frequency: 922400000 + downlink-frequency: 922400000 + min-data-rate: SF7BW125 + max-data-rate: SF12BW125 + radio: 1 +- uplink-frequency: 922600000 + downlink-frequency: 922600000 + min-data-rate: SF7BW125 + max-data-rate: SF12BW125 + radio: 0 +- uplink-frequency: 922800000 + downlink-frequency: 922800000 + min-data-rate: SF7BW125 + max-data-rate: SF12BW125 + radio: 0 +- uplink-frequency: 923000000 + downlink-frequency: 923000000 + min-data-rate: SF7BW125 + max-data-rate: SF12BW125 + radio: 0 +- uplink-frequency: 922000000 + downlink-frequency: 922000000 + min-data-rate: SF7BW125 + max-data-rate: SF12BW125 + radio: 1 +lora-standard-channel: + frequency: 922100000 + data-rate: SF7BW250 + radio: 1 +fsk-channel: + frequency: 921800000 + data-rate: FSK50 + radio: 1 +radios: +- enable: true + chip-type: SX1257 + frequency: 923000000 + rssi-offset: -166 + tx: + min-frequency: 920000000 + max-frequency: 923400000 +- enable: true + chip-type: SX1257 + frequency: 922100000 + rssi-offset: -166 +clock-source: 1 diff --git a/gateway/EU_433.yml b/gateway/EU_433.yml new file mode 100644 index 0000000..9790f28 --- /dev/null +++ b/gateway/EU_433.yml @@ -0,0 +1,64 @@ +band-id: EU_433 +sub-bands: +- min-frequency: 433050000 + max-frequency: 434790000 + duty-cycle: 0.1 # NOTE: ETSI EN300220 limit is 10%; LoRaWAN limit for end-devices is 1% + max-eirp: 12.15 +channels: +- uplink-frequency: 433175000 + downlink-frequency: 433175000 + min-data-rate: SF7BW125 + max-data-rate: SF12BW125 + radio: 0 +- uplink-frequency: 433375000 + downlink-frequency: 433375000 + min-data-rate: SF7BW125 + max-data-rate: SF12BW125 + radio: 0 +- uplink-frequency: 433575000 + downlink-frequency: 433575000 + min-data-rate: SF7BW125 + max-data-rate: SF12BW125 + radio: 0 +- uplink-frequency: 433775000 + downlink-frequency: 433775000 + min-data-rate: SF7BW125 + max-data-rate: SF12BW125 + radio: 0 +- uplink-frequency: 433975000 + downlink-frequency: 433975000 + min-data-rate: SF7BW125 + max-data-rate: SF12BW125 + radio: 1 +- uplink-frequency: 434175000 + downlink-frequency: 434175000 + min-data-rate: SF7BW125 + max-data-rate: SF12BW125 + radio: 1 +- uplink-frequency: 434375000 + downlink-frequency: 434375000 + min-data-rate: SF7BW125 + max-data-rate: SF12BW125 + radio: 1 +- uplink-frequency: 434575000 + downlink-frequency: 434575000 + min-data-rate: SF7BW125 + max-data-rate: SF12BW125 + radio: 1 +lora-standard-channel: + frequency: 434075000 + data-rate: SF7BW250 + radio: 1 +radios: +- enable: true + chip-type: SX1255 + frequency: 433475000 + rssi-offset: -176 + tx: + min-frequency: 433050000 + max-frequency: 434790000 +- enable: true + chip-type: SX1255 + frequency: 434275000 + rssi-offset: -176 +clock-source: 1 diff --git a/gateway/modifiers/disable_dwell_time.yml b/gateway/modifiers/disable_dwell_time.yml new file mode 100644 index 0000000..4debef4 --- /dev/null +++ b/gateway/modifiers/disable_dwell_time.yml @@ -0,0 +1,4 @@ +dwell-time: + uplinks: false + downlinks: false + duration: 0ms \ No newline at end of file diff --git a/gateway/modifiers/enable_dwell_time_400ms.yml b/gateway/modifiers/enable_dwell_time_400ms.yml new file mode 100644 index 0000000..291fe42 --- /dev/null +++ b/gateway/modifiers/enable_dwell_time_400ms.yml @@ -0,0 +1,4 @@ +dwell-time: + uplinks: true + downlinks: true + duration: 400ms \ No newline at end of file diff --git a/gateway/modifiers/lbt_80_over_128.yml b/gateway/modifiers/lbt_80_over_128.yml new file mode 100644 index 0000000..e1d43b8 --- /dev/null +++ b/gateway/modifiers/lbt_80_over_128.yml @@ -0,0 +1,4 @@ +listen-before-talk: + rssi-offset: -4 + rssi-target: -80 + scan-time: 128000 \ No newline at end of file diff --git a/gateway/schema.json b/gateway/schema.json index a16ba53..c171887 100644 --- a/gateway/schema.json +++ b/gateway/schema.json @@ -48,7 +48,7 @@ }, "downlink-frequency": { "type": "integer", - "description": "Downlink frequency [Hz] (optional)" + "description": "Downlink frequency [Hz]" }, "min-data-rate": { "type": "string", diff --git a/internal/docs/end-device.go b/internal/docs/end-device.go index 393b074..07f4807 100644 --- a/internal/docs/end-device.go +++ b/internal/docs/end-device.go @@ -41,6 +41,9 @@ func renderEndDevice(id string, plan model.FrequencyPlanEndDevice) error { Label: formatFrequency(freq), }) + if ch.DownlinkFrequency == nil { + continue + } freq = float64(*ch.DownlinkFrequency) start, end = freq-62500, freq+62500 frequencies[freq] = formatFrequency(freq) diff --git a/internal/docs/frequency-plans.md.tmpl b/internal/docs/frequency-plans.md.tmpl index 98c48cb..0d415ca 100644 --- a/internal/docs/frequency-plans.md.tmpl +++ b/internal/docs/frequency-plans.md.tmpl @@ -4,8 +4,7 @@ {{- range .EndDeviceDescriptions }} {{ if .BaseID }} ## `{{ .ID }}`: {{ .Name }} -Based on [{{ .BaseID }}](##{{ .BaseID }}) and modified by {{ range .Modifiers }}[{{ . }}](../end-device/modifiers/{{ . }}){{ end }} -{{ else }} +Based on [{{ .BaseID }}](##{{ .BaseID }}) and modified by {{ range .Modifiers }}[{{ . }}](../end-device/modifiers/{{ . }}){{ end }}{{ else }} ## [`{{ .ID }}`](../end-device/{{ .File }}): {{ .Name }}{{ end }} >> {{ .Description }} @@ -14,7 +13,6 @@ Based on [{{ .BaseID }}](##{{ .BaseID }}) and modified by {{ range .Modifiers }} # Gateway frequency plans {{- range .GatewayDescriptions }} - {{ if .BaseID }} ## `{{ .ID }}`: {{ .Name }} Based on {{ .BaseID }} and modified by {{ range .Modifiers }}[{{ . }}](../gateway/modifiers/{{ . }}){{ end }} diff --git a/internal/model/end-device-frequency-plan.go b/internal/model/end-device-frequency-plan.go index e30f635..07af927 100644 --- a/internal/model/end-device-frequency-plan.go +++ b/internal/model/end-device-frequency-plan.go @@ -93,18 +93,18 @@ func (f FrequencyPlanEndDevice) Validate() error { func (f FrequencyPlanEndDevice) Modify(modifier FrequencyPlanEndDeviceModifier) FrequencyPlanEndDevice { modified := f - set(modifier.SubBands, modified.SubBands) - set(modifier.Channels, modified.Channels) - setPointer(modifier.LoRaStandardChannel, modified.LoRaStandardChannel) - setPointer(modifier.FSKChannel, modified.FSKChannel) - setPointer(modifier.TimeOffAir, modified.TimeOffAir) - setPointer(modifier.DwellTime, modified.DwellTime) - setPointer(modifier.ListenBeforeTalk, modified.ListenBeforeTalk) - setPointer(modifier.PingSlot, modified.PingSlot) - setPointer(modifier.PingSlotDefaultDataRate, modified.PingSlotDefaultDataRate) - setPointer(modifier.RX2Channel, modified.RX2Channel) - setPointer(modifier.RX2DefaultDataRate, modified.RX2DefaultDataRate) - setPointer(modifier.MaxEIRP, modified.MaxEIRP) + set(modifier.SubBands, &modified.SubBands) + set(modifier.Channels, &modified.Channels) + set(modifier.LoRaStandardChannel, modified.LoRaStandardChannel) + set(modifier.FSKChannel, modified.FSKChannel) + set(modifier.TimeOffAir, modified.TimeOffAir) + set(modifier.DwellTime, modified.DwellTime) + set(modifier.ListenBeforeTalk, modified.ListenBeforeTalk) + set(modifier.PingSlot, modified.PingSlot) + set(modifier.PingSlotDefaultDataRate, modified.PingSlotDefaultDataRate) + set(modifier.RX2Channel, modified.RX2Channel) + set(modifier.RX2DefaultDataRate, modified.RX2DefaultDataRate) + set(modifier.MaxEIRP, modified.MaxEIRP) return modified } diff --git a/internal/model/gateway-frequency-plan.go b/internal/model/gateway-frequency-plan.go index 8fda494..f333fa9 100644 --- a/internal/model/gateway-frequency-plan.go +++ b/internal/model/gateway-frequency-plan.go @@ -70,15 +70,15 @@ func (f FrequencyPlanGateway) Validate() error { func (f FrequencyPlanGateway) Modify(modifier FrequencyPlanGatewayModifier) FrequencyPlanGateway { modified := f - set(modifier.SubBands, modified.SubBands) - set(modifier.Channels, modified.Channels) - set(modifier.Radios, modified.Radios) - set(modifier.ClockSource, modified.ClockSource) - setPointer(modifier.LoRaStandardChannel, modified.LoRaStandardChannel) - setPointer(modifier.FSKChannel, modified.FSKChannel) - setPointer(modifier.TimeOffAir, modified.TimeOffAir) - setPointer(modifier.DwellTime, modified.DwellTime) - setPointer(modifier.MaxEIRP, modified.MaxEIRP) + set(modifier.SubBands, &modified.SubBands) + set(modifier.Channels, &modified.Channels) + set(modifier.Radios, &modified.Radios) + set(modifier.ClockSource, &modified.ClockSource) + set(modifier.LoRaStandardChannel, modified.LoRaStandardChannel) + set(modifier.FSKChannel, modified.FSKChannel) + set(modifier.TimeOffAir, modified.TimeOffAir) + set(modifier.DwellTime, modified.DwellTime) + set(modifier.MaxEIRP, modified.MaxEIRP) return modified } diff --git a/internal/model/model.go b/internal/model/model.go index 0546380..e5ef00b 100644 --- a/internal/model/model.go +++ b/internal/model/model.go @@ -140,7 +140,7 @@ func (d DwellTime) Validate() error { type ListenBeforeTalk struct { RSSIOffset *int `yaml:"rssi-offset,omitempty"` - RSSITarget *int `yaml:"rssi-targer,omitempty"` + RSSITarget *int `yaml:"rssi-target,omitempty"` ScanTime *int `yaml:"scan-time,omitempty"` } @@ -240,17 +240,9 @@ func validateFrequencyRange(frequency int, min, max int) error { return nil } -func set[T any](modifier *T, base T) { - if modifier != nil { - base = *modifier - } -} - -func setPointer[T any](modifier *T, base *T) { - if modifier != nil { - if base == nil { - base = new(T) - } - *base = *modifier +func set[T any](modifier *T, base *T) { + if modifier == nil { + return } + *base = *modifier } diff --git a/internal/schema/frequency-plans-description-schema.json.tmpl b/internal/schema/frequency-plans-description-schema.json.tmpl index 517a93f..ba2e366 100644 --- a/internal/schema/frequency-plans-description-schema.json.tmpl +++ b/internal/schema/frequency-plans-description-schema.json.tmpl @@ -90,6 +90,7 @@ "items": { "type": "string", "enum": [ + "worldwide", "af", "ax", "al", @@ -417,6 +418,7 @@ "items": { "type": "string", "enum": [ + "worldwide", "af", "ax", "al", diff --git a/internal/schema/frequency-plans-end-device-schema.json.tmpl b/internal/schema/frequency-plans-end-device-schema.json.tmpl index e198c03..807380b 100644 --- a/internal/schema/frequency-plans-end-device-schema.json.tmpl +++ b/internal/schema/frequency-plans-end-device-schema.json.tmpl @@ -48,7 +48,7 @@ }, "downlink-frequency": { "type": "integer", - "description": "Downlink frequency [Hz] (optional)" + "description": "Downlink frequency [Hz]" }, "min-data-rate": { "type": "integer", diff --git a/internal/schema/frequency-plans-gateway-schema.json.tmpl b/internal/schema/frequency-plans-gateway-schema.json.tmpl index ab1fb52..1faeb9b 100644 --- a/internal/schema/frequency-plans-gateway-schema.json.tmpl +++ b/internal/schema/frequency-plans-gateway-schema.json.tmpl @@ -48,7 +48,7 @@ }, "downlink-frequency": { "type": "integer", - "description": "Downlink frequency [Hz] (optional)" + "description": "Downlink frequency [Hz]" }, "min-data-rate": { "type": "string", diff --git a/schema.json b/schema.json index 06c3ee6..aff0b51 100644 --- a/schema.json +++ b/schema.json @@ -62,19 +62,19 @@ "file": { "type": "string", "description": "File of the frequency plan definition.", - "enum": ["EU_863_870.yml"] + "enum": ["AS_920_923.yml","EU_433.yml","EU_863_870.yml","EU_863_870_ROAMING_DRAFT.yml","US_902_928_FSB_1.yml"] }, "base-id": { "type": "string", "description": "ID that this frequency plan extends (refers to id of another frequency plan).", - "enum" : ["EU_863_870","EU_863_870_TTN"] + "enum" : ["AS_920_923","AS_920_923_LBT","EU_433","EU_863_870","EU_863_870_ROAMING_DRAFT","EU_863_870_TTN","US_902_928_FSB_1"] }, "modifiers": { "type": "array", "uniqueItems": true, "items": { "type": "string", - "enum":["rx2_default_data_rata_3.yml"], + "enum":["disable_dwell_time.yml","enable_dwell_time_400ms.yml","lbt_80_over_128.yml","rx2_default_data_rata_3.yml"], "description": "Modifier addressed by filename." }, "description": "List of files containing the modifiers used to extend the `base-id` end-device." @@ -90,6 +90,7 @@ "items": { "type": "string", "enum": [ + "worldwide", "af", "ax", "al", @@ -389,19 +390,19 @@ "file": { "type": "string", "description": "File of the frequency plan definition.", - "enum": ["EU_863_870.yml"] + "enum": ["AS_920_923.yml","EU_433.yml","EU_863_870.yml"] }, "base-id": { "type": "string", "description": "ID that this frequency plan extends (refers to id of another frequency plan).", - "enum" : ["EU_863_870","EU_863_870_TTN"] + "enum" : ["AS_920_923","AS_920_923_LBT","EU_433","EU_863_870","EU_863_870_ROAMING_DRAFT","EU_863_870_TTN","US_902_928_FSB_1"] }, "modifiers": { "type": "array", "uniqueItems": true, "items": { "type": "string", - "enum":[], + "enum":["disable_dwell_time.yml","enable_dwell_time_400ms.yml","lbt_80_over_128.yml"], "description": "Modifier addressed by filename." }, "description": "List of files containing the modifiers used to extend the `base-id` end-device." @@ -417,6 +418,7 @@ "items": { "type": "string", "enum": [ + "worldwide", "af", "ax", "al",