Skip to content
Snippets Groups Projects
Commit 69614065 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

Merge pull request #640 from kokel/preserve-wifi-channel

gluon-core: add preserve wifi channel feature
parents f2fc359e 388d264f
No related branches found
No related tags found
No related merge requests found
......@@ -24,3 +24,11 @@ existing configuration will also be set for the new configuration.
This allows upgrades to change from IBSS to 11s and vice-versa while retaining the
"wireless meshing is enabled/disabled" property configured by the user regardless
of the used mode.
During upgrades the wifi channel of the 2.4GHz and 5GHz radio will be restored to the channel
configured in the site.conf. If you need to preserve a user defined wifi channel during upgrades
you can configure this via the uci section ``gluon-core.wireless``::
uci set gluon-core.@wireless[0].preserve_channels='1'
Keep in mind that nodes running wifi interfaces on custom channels can't mesh with default nodes anymore!
config wireless
......@@ -10,11 +10,21 @@ if not sysconfig.gluon_version then
uci:delete_all('wireless', 'wifi-iface')
end
local function get_channel(radio, config)
if uci:get_first('gluon-core', 'wireless', 'preserve_channels') then
return uci:get('wireless', radio, 'channel') or config.channel
else
return config.channel
end
end
local function configure_radio(radio, index, config)
if config then
local channel = get_channel(radio, config)
uci:delete('wireless', radio, 'disabled')
uci:set('wireless', radio, 'channel', config.channel)
uci:set('wireless', radio, 'channel', channel)
uci:set('wireless', radio, 'htmode', 'HT20')
uci:set('wireless', radio, 'country', site.regdom)
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment