Skip to content

Commit

Permalink
Convert existing plans to new structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Yorick Smilda committed Feb 2, 2023
1 parent 152782b commit d30535b
Show file tree
Hide file tree
Showing 22 changed files with 1,372 additions and 22 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand Down
31 changes: 28 additions & 3 deletions docs/frequency-plans.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,43 @@
![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
## [`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)

## [`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)
271 changes: 271 additions & 0 deletions docs/images/end-device/AS_920_923.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
271 changes: 271 additions & 0 deletions docs/images/end-device/AS_920_923_LBT.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
306 changes: 306 additions & 0 deletions docs/images/gateway/AS_920_923.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
306 changes: 306 additions & 0 deletions docs/images/gateway/AS_920_923_LBT.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions end-device/AS_920_923.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions end-device/modifiers/disable_dwell_time.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dwell-time:
uplinks: false
downlinks: false
duration: 0ms
4 changes: 4 additions & 0 deletions end-device/modifiers/enable_dwell_time_400ms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dwell-time:
uplinks: true
downlinks: true
duration: 400ms
4 changes: 4 additions & 0 deletions end-device/modifiers/lbt_80_over_128.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
listen-before-talk:
rssi-offset: -4
rssi-target: -80
scan-time: 128000
4 changes: 2 additions & 2 deletions end-device/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
},
"downlink-frequency": {
"type": "integer",
"description": "Downlink frequency [Hz] (optional)"
"description": "Downlink frequency [Hz]"
},
"min-data-rate": {
"type": "integer",
Expand All @@ -63,7 +63,7 @@
"description": "Channel is defined by RP"
}
},
"required": ["uplink-frequency", "min-data-rate", "max-data-rate"]
"required": ["uplink-frequency", "downlink-frequency", "min-data-rate", "max-data-rate"]
}
},
"lora-standard-channel": {
Expand Down
38 changes: 38 additions & 0 deletions frequency-plans.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,25 @@ end-device-descriptions:
modifiers: [rx2_default_data_rata_3.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
Expand All @@ -27,3 +46,22 @@ 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: 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
66 changes: 66 additions & 0 deletions gateway/AS_920_923.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions gateway/modifiers/disable_dwell_time.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dwell-time:
uplinks: false
downlinks: false
duration: 0ms
4 changes: 4 additions & 0 deletions gateway/modifiers/enable_dwell_time_400ms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dwell-time:
uplinks: true
downlinks: true
duration: 400ms
4 changes: 4 additions & 0 deletions gateway/modifiers/lbt_80_over_128.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
listen-before-talk:
rssi-offset: -4
rssi-target: -80
scan-time: 128000
4 changes: 2 additions & 2 deletions gateway/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
},
"downlink-frequency": {
"type": "integer",
"description": "Downlink frequency [Hz] (optional)"
"description": "Downlink frequency [Hz]"
},
"min-data-rate": {
"type": "string",
Expand All @@ -69,7 +69,7 @@
"description": "Channel is defined by RP"
}
},
"required": ["uplink-frequency", "min-data-rate", "max-data-rate", "radio"]
"required": ["uplink-frequency", "downlink-frequency", "min-data-rate", "max-data-rate", "radio"]
}
},
"lora-standard-channel": {
Expand Down
4 changes: 1 addition & 3 deletions internal/docs/frequency-plans.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion internal/model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

Expand Down
4 changes: 2 additions & 2 deletions internal/schema/frequency-plans-end-device-schema.json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
},
"downlink-frequency": {
"type": "integer",
"description": "Downlink frequency [Hz] (optional)"
"description": "Downlink frequency [Hz]"
},
"min-data-rate": {
"type": "integer",
Expand All @@ -63,7 +63,7 @@
"description": "Channel is defined by RP"
}
},
"required": ["uplink-frequency", "min-data-rate", "max-data-rate"]
"required": ["uplink-frequency", "downlink-frequency", "min-data-rate", "max-data-rate"]
}
},
"lora-standard-channel": {
Expand Down
4 changes: 2 additions & 2 deletions internal/schema/frequency-plans-gateway-schema.json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
},
"downlink-frequency": {
"type": "integer",
"description": "Downlink frequency [Hz] (optional)"
"description": "Downlink frequency [Hz]"
},
"min-data-rate": {
"type": "string",
Expand All @@ -69,7 +69,7 @@
"description": "Channel is defined by RP"
}
},
"required": ["uplink-frequency", "min-data-rate", "max-data-rate", "radio"]
"required": ["uplink-frequency", "downlink-frequency", "min-data-rate", "max-data-rate", "radio"]
}
},
"lora-standard-channel": {
Expand Down
Loading

0 comments on commit d30535b

Please sign in to comment.