-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1329 from mweinelt/outdoor_mode
gluon-core: add outdoor channel support for 5 ghz radios
- Loading branch information
Showing
16 changed files
with
347 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
include $(TOPDIR)/rules.mk | ||
|
||
PKG_NAME:=gluon-config-mode-outdoor | ||
PKG_VERSION:=1 | ||
|
||
include ../gluon.mk | ||
|
||
define Package/gluon-config-mode-outdoor | ||
TITLE:=UI for displaying & changing the outdoor mode flag in the wizard | ||
DEPENDS:=+gluon-config-mode-core | ||
endef | ||
|
||
$(eval $(call BuildPackageGluon,gluon-config-mode-outdoor)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
msgid "" | ||
"Please enable this option in case the node is to be installed outdoors " | ||
"to comply with local frequency regulations." | ||
msgstr "" | ||
"Wenn der Knoten im Freien aufgestellt werden soll, dann aktiviere bitte " | ||
"diese Option um den örtlichen Frequenzbestimmungen zu entsprechen." | ||
|
||
msgid "Node will be installed outdoors" | ||
msgstr "Knoten wird im Außenbereich betrieben" |
7 changes: 7 additions & 0 deletions
7
package/gluon-config-mode-outdoor/i18n/gluon-config-mode-outdoor.pot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
msgid "" | ||
"Please enable this option in case the node is to be installed outdoors " | ||
"to comply with local frequency regulations." | ||
msgstr "" | ||
|
||
msgid "Node will be installed outdoors" | ||
msgstr "" |
28 changes: 28 additions & 0 deletions
28
package/gluon-config-mode-outdoor/luasrc/lib/gluon/config-mode/wizard/0250-outdoor.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
return function(form, uci) | ||
local platform_info = require 'platform_info' | ||
|
||
if not platform_info.is_outdoor_device() then | ||
-- only visible on wizard for outdoor devices | ||
return | ||
end | ||
|
||
local pkg_i18n = i18n 'gluon-config-mode-outdoor' | ||
|
||
local section = form:section(Section, nil, pkg_i18n.translate( | ||
"Please enable this option in case the node is to be installed outdoors " | ||
.. "to comply with local frequency regulations." | ||
)) | ||
|
||
local outdoor = section:option(Flag, 'outdoor', pkg_i18n.translate("Node will be installed outdoors")) | ||
outdoor.default = outdoor_mode | ||
|
||
function outdoor:write(data) | ||
if data ~= outdoor_mode then | ||
uci:set('gluon', 'wireless', 'outdoor', data) | ||
uci:save('gluon') | ||
os.execute('/lib/gluon/upgrade/200-wireless') | ||
end | ||
end | ||
|
||
return {'gluon', 'wireless'} | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/lua | ||
|
||
-- This script needs to be sorted before 200-wireless as it affects | ||
-- wireless channel selection and wireless mesh configuration. | ||
|
||
local uci = require('simple-uci').cursor() | ||
local site = require 'gluon.site' | ||
|
||
if uci:get('gluon', 'wireless', 'outdoor') ~= nil then | ||
-- don't overwrite existing configuration | ||
os.exit(0) | ||
end | ||
|
||
local sysconfig = require 'gluon.sysconfig' | ||
local platform_info = require 'platform_info' | ||
|
||
local config = site.wifi5.outdoor_preset('preset') | ||
local outdoor = false | ||
|
||
if sysconfig.gluon_version then | ||
-- don't enable the outdoor mode after an upgrade | ||
outdoor = false | ||
elseif config == 'preset' then | ||
-- enable outdoor mode through presets on new installs | ||
outdoor = platform_info.is_outdoor_device() | ||
else | ||
-- enable/disable outdoor mode unconditionally on new installs | ||
outdoor = config | ||
end | ||
|
||
uci:section('gluon', 'wireless', 'wireless', { | ||
outdoor = outdoor | ||
}) | ||
|
||
uci:save('gluon') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.