fff-wireless: Provide device-specific WiFi settings and set TX power

Like the network.* files, this introduces wifi.* files to set
device-specific settings.

In contrast to the former, the wifi.* settings are only run during
firstboot and only if there is a file present.

In this patch, we set the antenna gain values for the devices not
treated correctly in OpenWRT.

Side conditions:
- The script requires 50-fff-boardname and 60-fff-wireless
  beforehand, so I chose 62 as number.
- The wifi command is not necessary, since after firstboot
  configurehood will run "wifi" in any case

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
- Changed to base on the ubnt board names
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
Adrian Schmutzler 2018-03-03 19:40:35 +01:00
parent 0447d0c709
commit 1e5f4f1319
10 changed files with 29 additions and 2 deletions

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-wireless
PKG_VERSION:=0.0.2
PKG_VERSION:=6
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
@ -13,7 +13,7 @@ define Package/$(PKG_NAME)
CATEGORY:=Freifunk
TITLE:= Freifunk-Franken wireless configuration
URL:=http://www.freifunk-franken.de
DEPENDS:=+@ATH_USER_REGD +wireless-tools
DEPENDS:=+@ATH_USER_REGD +wireless-tools +fff-boardname
endef
define Package/$(PKG_NAME)/description

View File

@ -0,0 +1,9 @@
#!/bin/sh
# Copyright 2018 Adrian Schmutzler
# License GPLv3
BOARD="$(uci get board.model.name)"
if [ -s "/etc/wifi.$BOARD" ] ; then
. "/etc/wifi.$BOARD"
fi

View File

@ -0,0 +1,2 @@
uci -q set wireless.radio0.antenna_gain=3
uci -q commit wireless

View File

@ -0,0 +1,2 @@
uci -q set wireless.radio0.antenna_gain=9
uci -q commit wireless

View File

@ -0,0 +1,2 @@
uci -q set wireless.radio0.antenna_gain=9
uci -q commit wireless

View File

@ -0,0 +1,2 @@
uci -q set wireless.radio0.antenna_gain=11
uci -q commit wireless

View File

@ -0,0 +1,2 @@
uci -q set wireless.radio0.antenna_gain=12
uci -q commit wireless

View File

@ -0,0 +1,2 @@
uci -q set wireless.radio0.antenna_gain=18
uci -q commit wireless

View File

@ -0,0 +1,3 @@
# No support for Unifi AP Pro!
uci -q set wireless.radio0.antenna_gain=3
uci -q commit wireless

View File

@ -0,0 +1,3 @@
uci -q set wireless.radio0.antenna_gain=4
uci -q set wireless.radio1.antenna_gain=3
uci -q commit wireless