File tree Expand file tree Collapse file tree 4 files changed +25
-5
lines changed
cmd/chirpstack-gateway-bridge/cmd Expand file tree Collapse file tree 4 files changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,18 @@ type="{{ .Backend.Type }}"
95
95
# disconnected and it will unsubscribe from the gateway MQTT topic and cleanup the UDP docket.
96
96
connection_timeout_duration={{ .Backend.SemtechUDP.CleanupDuration }}
97
97
98
+ # Cache expiration
99
+ #
100
+ # ChirpStack Gateway Bridge temporarily store downlinks. If a gateway does not send any
101
+ # UDP data within the configured timeout the downlink is discarded.
102
+ cache_default_expiration={{ .Backend.SemtechUDP.CacheDefaultExpiration }}
103
+
104
+ # Cache cleanup interval
105
+ #
106
+ # ChirpStack Gateway Bridge temporarily store downlinks in a cache. The cache is cleaned in
107
+ # the configured interval.
108
+ cache_cleanup_interval={{ .Backend.SemtechUDP.CacheCleanupInterval }}
109
+
98
110
# ChirpStack Concentratord backend.
99
111
[backend.concentratord]
100
112
Original file line number Diff line number Diff line change @@ -41,6 +41,9 @@ func init() {
41
41
viper .SetDefault ("backend.semtech_udp.udp_bind" , "0.0.0.0:1700" )
42
42
viper .SetDefault ("backend.semtech_udp.cleanup_duration" , time .Minute )
43
43
44
+ viper .SetDefault ("backend.semtech_udp.cache_default_expiration" , 15 * time .Second )
45
+ viper .SetDefault ("backend.semtech_udp.cache_cleanup_interval" , 15 * time .Second )
46
+
44
47
viper .SetDefault ("backend.concentratord.crc_check" , true )
45
48
viper .SetDefault ("backend.concentratord.event_url" , "ipc:///tmp/concentratord_event" )
46
49
viper .SetDefault ("backend.concentratord.command_url" , "ipc:///tmp/concentratord_command" )
Original file line number Diff line number Diff line change @@ -72,7 +72,10 @@ func NewBackend(conf config.Config) (*Backend, error) {
72
72
},
73
73
fakeRxTime : conf .Backend .SemtechUDP .FakeRxTime ,
74
74
skipCRCCheck : conf .Backend .SemtechUDP .SkipCRCCheck ,
75
- cache : cache .New (15 * time .Second , 15 * time .Second ),
75
+ cache : cache .New (
76
+ time .Duration (conf .Backend .SemtechUDP .CacheDefaultExpiration ),
77
+ time .Duration (conf .Backend .SemtechUDP .CacheCleanupInterval ),
78
+ ),
76
79
}
77
80
78
81
go func () {
Original file line number Diff line number Diff line change @@ -21,10 +21,12 @@ type Config struct {
21
21
Type string `mapstructure:"type"`
22
22
23
23
SemtechUDP struct {
24
- UDPBind string `mapstructure:"udp_bind"`
25
- SkipCRCCheck bool `mapstructure:"skip_crc_check"`
26
- FakeRxTime bool `mapstructure:"fake_rx_time"`
27
- CleanupDuration int `mapstructure:"connection_timeout_duration"`
24
+ UDPBind string `mapstructure:"udp_bind"`
25
+ SkipCRCCheck bool `mapstructure:"skip_crc_check"`
26
+ FakeRxTime bool `mapstructure:"fake_rx_time"`
27
+ CleanupDuration int `mapstructure:"connection_timeout_duration"`
28
+ CacheDefaultExpiration int `mapstructure:"cache_default_expiration"`
29
+ CacheCleanupInterval int `mapstructure:"cache_cleanup_interval"`
28
30
} `mapstructure:"semtech_udp"`
29
31
30
32
BasicStation struct {
You can’t perform that action at this time.
0 commit comments