如何用hostapd配置树莓派wifi的发射功率

我想用hostapd配置树莓派发送不同功率的wifi信号

然后看了下hostapd的配置详解,找了半天,参照配置表中的

Add Power Constraint element to Beacon and Probe Response frames

This config option adds Power Constraint element when applicable and Country

element is added. Power Constraint element is required by Transmit Power

Control. This can be used only with ieee80211d=1.

Valid values are 0..255.

#local_pwr_constraint=3

向树莓派系统中hostapd.config文件中添加了
country_code=CN
ieee80211d =1
local_pwr_constraint=3

重启之后wifi正常 , 也不知道自己弄对了没,希望 路过的 懂的人 指点一二

// 安装hostapd
sudo apt-get install -y hostapd
// 配置hostapd
sudo vim /etc/hostapd/hostapd.conf
// 基本信息

无线网卡的名称

interface=wlan0

网卡对应的驱动名

driver=nl80211

无线网络的名称是Pi-wifi

ssid=Pi-wifi

无线路由器工作模式为802.11g(2.4G)

hw_mode=g

无线网卡使用的信道

channel=10

支持 802.11n

ieee80211n=1

采用WPA2配置

wpa=2

无线网络密码是123456789

wpa_passphrase=123456789

认证方式为WPA-PSK

wpa_key_mgmt=WPA-PSK

开启 WMM

wmm_enabled=1

开启 40MHz channels 和 20ns guard interval

ht_capab=[HT40][SHORT-GI-20][DSSS_CCK-40]

接受所有 MAC 地址

macaddr_acl=0

使用 WPA 认证

auth_algs=1

需连接者知道ssid

ignore_broadcast_ssid=0

使用 WPA2

wpa=2

使用预先共享的 key

wpa_key_mgmt=WPA-PSK

使用 AES, 而非 TKIP

rsn_pairwise=CCMP

// 配置hostapd为自启动模式
sudo vim /etc/default/hostapd
// 找到“#DAEMON_CONF=”,去掉#注释,补全为
DAEMON_CONF="/etc/hostapd/hostapd.conf"

// 完成配置,检查是否配置成功
sudo /usr/sbin/hostapd /etc/hostapd/hostapd.conf
// 如果最后两行出现了如下,则为正常
wlan0: interface state UNINITIALIZED->ENABLE
wlan0: AP-ENABLED

// 重启hostapd
sudo service hostapd restart