Raspberry Pi 4 B 型 - 外部 RT3070 WiFi 适配器 - Hostapd 崩溃

Raspberry Pi 4 B 型 - 外部 RT3070 WiFi 适配器 - Hostapd 崩溃

我正在尝试将我的 Raspberry Pi 4 Model B 与其中之一一起使用这些 ModMyPi 基于 Ralink RT3070 的芯片组USB 无线适配器作为 AP 通过hostapd.

我面临的问题如下:

  • 开始hostapd
  • AP 工作正常(DHCP/DNS/路由/等)不确定的一段时间
  • hostapd最终崩溃,日志中几乎没有有用的信息(我可以看到)来帮助说明为什么会出现这种情况。

hostapd此后重新启动似乎可以使其恢复在线状态。


USB WiFi 加密狗显示为使用以下rt2800驱动程序系列:

pi@raspberrypi:/tmp $ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 005: ID 148f:3070 Ralink Technology, Corp. RT2870/RT3070 Wireless Adapter
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

dmesg输出如下:

...
[13591.906444] usb 1-1.1: new high-speed USB device number 6 using xhci_hcd
[13592.069548] usb 1-1.1: New USB device found, idVendor=148f, idProduct=3070, bcdDevice= 1.01
[13592.069569] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[13592.069586] usb 1-1.1: Product: 802.11 n WLAN
[13592.069601] usb 1-1.1: Manufacturer: Ralink
[13592.069616] usb 1-1.1: SerialNumber: 1.0
[13592.177043] usb 1-1.1: reset high-speed USB device number 6 using xhci_hcd
[13592.318245] ieee80211 phy3: rt2x00_set_rt: Info - RT chipset 3070, rev 0201 detected
[13592.344614] ieee80211 phy3: rt2x00_set_rf: Info - RF chipset 0005 detected
[13592.344939] ieee80211 phy3: Selected rate control algorithm 'minstrel_ht'
[13592.351931] ieee80211 phy3: rt2x00lib_request_firmware: Info - Loading firmware file 'rt2870.bin'
[13592.352027] ieee80211 phy3: rt2x00lib_request_firmware: Info - Firmware detected - version: 0.36
...

加载的模块如下:

pi@raspberrypi:/tmp $ lsmod | grep rt2
rt2800usb              28672  0
rt2800lib             114688  1 rt2800usb
rt2x00usb              24576  1 rt2800usb
rt2x00lib              57344  3 rt2800lib,rt2800usb,rt2x00usb
mac80211              729088  3 rt2800lib,rt2x00lib,rt2x00usb
crc_ccitt              16384  1 rt2800lib
cfg80211              679936  3 rt2x00lib,mac80211,brcmfmac

我的hostapd配置如下:

auth_algs=1
wpa_key_mgmt=WPA-PSK
ssid=<REDACTED>
channel=7
hw_mode=g
wpa_passphrase=<REDACTED>
interface=wlan1
wpa=2
wpa_pairwise=CCMP
country_code=AU
ignore_broadcast_ssid=0
disassoc_low_ack=0
ctrl_interface=/var/run/hostapd

iwconfig显示该设备未受电源管理:

pi@raspberrypi:/tmp $ iwconfig wlan1
wlan1     IEEE 802.11  ESSID:off/any
          Mode:Managed  Access Point: Not-Associated   Tx-Power=36 dBm
          Retry short  long limit:2   RTS thr:off   Fragment thr:off
          Power Management:off

我有一个cron作业设置,每 5 分钟运行一次,iwconfig wlan1 power off看看这是否有任何影响,但似乎没有。

以下是一些您可能感兴趣的日志条目:

pi@raspberrypi:/var/log $ grep wlan1 * | grep -v CRON | grep -v dhcp | grep -v avahi | grep -v dns | grep -v "24:62:ab:fd:24:34" | grep -v "light" | grep -v "iwconfig wlan1 power off"
daemon.log:Sep 20 18:42:25 raspberrypi vnstatd[504]: Info: Interface "wlan1" disabled.
daemon.log:Sep 20 18:42:30 raspberrypi vnstatd[504]: Info: Interface "wlan1" enabled.
daemon.log.1:Sep 13 13:16:42 raspberrypi vnstatd[504]: Info: Interface "wlan1" enabled.
daemon.log.1:Sep 14 21:51:28 raspberrypi vnstatd[504]: Info: Interface "wlan1" disabled.
daemon.log.1:Sep 14 21:51:33 raspberrypi vnstatd[504]: Info: Interface "wlan1" enabled.
daemon.log.1:Sep 15 19:09:21 raspberrypi vnstatd[504]: Info: Interface "wlan1" disabled.
daemon.log.1:Sep 15 19:09:26 raspberrypi vnstatd[504]: Info: Interface "wlan1" enabled.
daemon.log.1:Sep 17 11:09:18 raspberrypi vnstatd[504]: Info: Interface "wlan1" disabled.
daemon.log.1:Sep 17 11:09:23 raspberrypi vnstatd[504]: Info: Interface "wlan1" enabled.
daemon.log.1:Sep 17 11:38:23 raspberrypi vnstatd[504]: Info: Interface "wlan1" disabled.
daemon.log.1:Sep 17 11:38:28 raspberrypi vnstatd[504]: Info: Interface "wlan1" enabled.
kern.log:Sep 20 14:08:07 raspberrypi kernel: [927055.823706] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
kern.log:Sep 20 14:29:07 raspberrypi kernel: [928315.433328] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
kern.log:Sep 20 14:38:19 raspberrypi kernel: [928867.033359] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
kern.log:Sep 20 14:55:46 raspberrypi kernel: [    8.827781] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
kern.log:Sep 20 14:56:01 raspberrypi kernel: [   23.574682] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
kern.log.1:Sep 13 13:40:12 raspberrypi kernel: [320571.239666] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
kern.log.1:Sep 13 13:57:22 raspberrypi kernel: [321601.827227] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
kern.log.1:Sep 13 20:33:56 raspberrypi kernel: [345395.775302] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
kern.log.1:Sep 13 20:47:40 raspberrypi kernel: [346220.238577] device wlan1 entered promiscuous mode
kern.log.1:Sep 13 20:47:43 raspberrypi kernel: [346222.405713] device wlan1 left promiscuous mode
kern.log.1:Sep 13 20:49:55 raspberrypi kernel: [346355.010522] device wlan1 entered promiscuous mode
kern.log.1:Sep 13 20:51:01 raspberrypi kernel: [346420.542532] device wlan1 left promiscuous mode
kern.log.1:Sep 14 18:16:09 raspberrypi kernel: [423530.404296] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
kern.log.1:Sep 17 11:38:42 raspberrypi kernel: [658886.773095] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
messages:Sep 20 14:08:07 raspberrypi kernel: [927055.823706] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
messages:Sep 20 14:29:07 raspberrypi kernel: [928315.433328] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
messages:Sep 20 14:38:19 raspberrypi kernel: [928867.033359] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
messages:Sep 20 14:55:46 raspberrypi kernel: [    8.827781] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
messages:Sep 20 14:56:01 raspberrypi kernel: [   23.574682] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
messages.1:Sep 13 13:40:12 raspberrypi kernel: [320571.239666] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
messages.1:Sep 13 13:57:22 raspberrypi kernel: [321601.827227] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
messages.1:Sep 13 20:33:56 raspberrypi kernel: [345395.775302] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
messages.1:Sep 13 20:47:40 raspberrypi kernel: [346220.238577] device wlan1 entered promiscuous mode
messages.1:Sep 13 20:47:43 raspberrypi kernel: [346222.405713] device wlan1 left promiscuous mode
messages.1:Sep 13 20:49:55 raspberrypi kernel: [346355.010522] device wlan1 entered promiscuous mode
messages.1:Sep 13 20:51:01 raspberrypi kernel: [346420.542532] device wlan1 left promiscuous mode
messages.1:Sep 14 18:16:09 raspberrypi kernel: [423530.404296] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
messages.1:Sep 17 11:38:42 raspberrypi kernel: [658886.773095] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
syslog:Sep 20 14:08:07 raspberrypi kernel: [927055.823706] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
syslog:Sep 20 14:29:07 raspberrypi kernel: [928315.433328] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
syslog:Sep 20 14:38:19 raspberrypi kernel: [928867.033359] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
syslog:Sep 20 14:55:46 raspberrypi kernel: [    8.827781] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
syslog:Sep 20 14:56:01 raspberrypi kernel: [   23.574682] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
syslog:Sep 20 18:42:25 raspberrypi vnstatd[504]: Info: Interface "wlan1" disabled.
syslog:Sep 20 18:42:30 raspberrypi vnstatd[504]: Info: Interface "wlan1" enabled.

以下是一些有趣的日志条目hostapd

Configuration file: /etc/hostapd/hostapd.conf
wlan1: AP-ENABLED 
wlan1: interface state ENABLED->DISABLED
wlan1: AP-DISABLED 
wlan1: CTRL-EVENT-TERMINATING 
nl80211: deinit ifname=wlan1 disabled_11b_rates=0
Configuration file: /etc/hostapd/hostapd.conf
wlan1: AP-ENABLED 
wlan1: interface state ENABLED->DISABLED
wlan1: AP-DISABLED 
wlan1: CTRL-EVENT-TERMINATING 
nl80211: deinit ifname=wlan1 disabled_11b_rates=0
Configuration file: /etc/hostapd/hostapd.conf
wlan1: AP-ENABLED 
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
Could not set interface wlan1 flags (UP): Input/output error
nl80211: Could not set interface 'wlan1' UP
Could not set interface wlan1 flags (UP): No such device
nl80211: Could not set interface 'wlan1' UP
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: interface state ENABLED->DISABLED
wlan1: AP-DISABLED 
wlan1: CTRL-EVENT-TERMINATING 
nl80211: deinit ifname=wlan1 disabled_11b_rates=0
Configuration file: /etc/hostapd/hostapd.conf
wlan1: AP-ENABLED 
wlan1: INTERFACE-DISABLED 
Could not set interface wlan1 flags (UP): Input/output error
nl80211: Could not set interface 'wlan1' UP
Could not set interface wlan1 flags (UP): Device or resource busy
nl80211: Could not set interface 'wlan1' UP
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: interface state ENABLED->DISABLED
wlan1: AP-DISABLED 
wlan1: CTRL-EVENT-TERMINATING 
nl80211: deinit ifname=wlan1 disabled_11b_rates=0
Configuration file: /etc/hostapd/hostapd.conf
wlan1: AP-ENABLED 
wlan1: interface state ENABLED->DISABLED
wlan1: AP-DISABLED 
wlan1: CTRL-EVENT-TERMINATING 
nl80211: deinit ifname=wlan1 disabled_11b_rates=0
Configuration file: /etc/hostapd/hostapd.conf
wlan1: AP-ENABLED 
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
Could not set interface wlan1 flags (UP): No such device
nl80211: Could not set interface 'wlan1' UP
Could not set interface wlan1 flags (UP): No such device
nl80211: Could not set interface 'wlan1' UP
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: interface state ENABLED->DISABLED
wlan1: AP-DISABLED 
wlan1: CTRL-EVENT-TERMINATING 
nl80211: deinit ifname=wlan1 disabled_11b_rates=0
Configuration file: /etc/hostapd/hostapd.conf
wlan1: AP-ENABLED 
wlan1: interface state ENABLED->DISABLED
wlan1: AP-DISABLED 
wlan1: CTRL-EVENT-TERMINATING 
nl80211: deinit ifname=wlan1 disabled_11b_rates=0
Configuration file: /etc/hostapd/hostapd.conf
wlan1: AP-ENABLED 
wlan1: interface state ENABLED->DISABLED
wlan1: AP-DISABLED 
wlan1: CTRL-EVENT-TERMINATING 
nl80211: deinit ifname=wlan1 disabled_11b_rates=0
Configuration file: /etc/hostapd/hostapd.conf
wlan1: AP-ENABLED 
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: interface state ENABLED->DISABLED
wlan1: AP-DISABLED 
wlan1: CTRL-EVENT-TERMINATING 
nl80211: deinit ifname=wlan1 disabled_11b_rates=0
Configuration file: /etc/hostapd/hostapd.conf
wlan1: AP-ENABLED 
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
Could not set interface wlan1 flags (UP): Input/output error
nl80211: Could not set interface 'wlan1' UP
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
Could not set interface wlan1 flags (UP): Input/output error
nl80211: Could not set interface 'wlan1' UP
Could not set interface wlan1 flags (UP): Input/output error
nl80211: Could not set interface 'wlan1' UP
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
Could not set interface wlan1 flags (UP): No such device
nl80211: Could not set interface 'wlan1' UP
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: interface state ENABLED->DISABLED
wlan1: AP-DISABLED 
wlan1: CTRL-EVENT-TERMINATING 
nl80211: deinit ifname=wlan1 disabled_11b_rates=0
Configuration file: /etc/hostapd/hostapd.conf
wlan1: AP-ENABLED 
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: INTERFACE-DISABLED 
wlan1: INTERFACE-ENABLED 
Failed to set beacon parameters
wlan1: interface state ENABLED->DISABLED
wlan1: AP-DISABLED 
wlan1: CTRL-EVENT-TERMINATING 
nl80211: deinit ifname=wlan1 disabled_11b_rates=0
Configuration file: /etc/hostapd/hostapd.conf
wlan1: AP-ENABLED 
wlan1: interface state ENABLED->DISABLED
wlan1: AP-DISABLED 
wlan1: CTRL-EVENT-TERMINATING 
nl80211: deinit ifname=wlan1 disabled_11b_rates=0
Configuration file: /etc/hostapd/hostapd.conf
wlan1: AP-ENABLED 

操作系统详细信息:

pi@raspberrypi:/tmp $ cat /etc/*release*
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
pi@raspberrypi:/tmp $ uname -a
Linux raspberrypi 5.4.51-v7l+ #1333 SMP Mon Aug 10 16:51:40 BST 2020 armv7l GNU/Linux

此时我想知道它是否可能是一个坏适配器,但想知道我还能做些什么来解决这个问题/解决它?


更新 21/09/20 - Hostapd 调试日志

我提取了我认为对这个问题感兴趣的内容:

1600641182.604187: nl80211: Drv Event 16 (NL80211_CMD_STOP_AP) received for wlan1
1600641182.604214: wlan1: Event INTERFACE_UNAVAILABLE (28) received
1600641182.604228: Interface wlan1 is unavailable -- stopped
1600641182.605808: RTM_NEWLINK: ifi_index=466 ifname=wlan1 operstate=2 linkmode=0 ifi_family=0 ifi_flags=0x1002 ()
1600641182.605920: nl80211: Interface down (wlan1/wlan1)
1600641182.605943: wlan1: Event INTERFACE_DISABLED (26) received
1600641182.605961: wlan1: INTERFACE-DISABLED 
1600641182.606036: VLAN: RTM_NEWLINK: ifi_index=466 ifname=wlan1 ifi_family=0 ifi_flags=0x1002 ()
1600641182.606054: VLAN: vlan_newlink(wlan1)
1600641182.724045: RTM_DELLINK: ifi_index=466 ifname=wlan1 operstate=2 linkmode=0 ifi_family=0 ifi_flags=0x1002 ()
1600641182.724069: RTM_DELLINK: Interface 'wlan1' removed - mark if_removed=1
1600641182.724083: wlan1: Event INTERFACE_STATUS (5) received
1600641182.724092: Unknown event 5
1600641182.741668: VLAN: RTM_DELLINK: ifi_index=466 ifname=wlan1 ifi_family=0 ifi_flags=0x1002 ()
1600641182.741703: VLAN: vlan_dellink(wlan1)
1600641182.759151: nl80211: Ignored event (cmd=36) for foreign interface (ifindex -1 wdev 0x0)
1600641182.759221: nl80211: Drv Event 36 (NL80211_CMD_REG_CHANGE) received for wlan1
1600641182.759230: nl80211: Regulatory domain change
1600641182.759235:  * initiator=1
1600641182.759241:  * type=0
1600641182.759247:  * alpha2=AU
1600641182.759258: wlan1: Event CHANNEL_LIST_CHANGED (27) received
1600641183.536944: RTM_NEWLINK: ifi_index=2081 ifname=wlan1 operstate=2 linkmode=0 ifi_family=0 ifi_flags=0x1002 ()
1600641183.538906: nl80211: Update ifindex for a removed interface
1600641183.539417: nl80211: Supported cipher 00-0f-ac:1
1600641183.539444: nl80211: Supported cipher 00-0f-ac:5
1600641183.539461: nl80211: Supported cipher 00-0f-ac:2
1600641183.539476: nl80211: Supported cipher 00-0f-ac:4
1600641183.539491: nl80211: Supported cipher 00-0f-ac:10
1600641183.539506: nl80211: Supported cipher 00-0f-ac:8
1600641183.539520: nl80211: Supported cipher 00-0f-ac:9
1600641183.539534: nl80211: Supported cipher 00-0f-ac:6
1600641183.539548: nl80211: Supported cipher 00-0f-ac:13
1600641183.539562: nl80211: Supported cipher 00-0f-ac:11
1600641183.539577: nl80211: Supported cipher 00-0f-ac:12
1600641183.539647: nl80211: Using driver-based off-channel TX
1600641183.539717: nl80211: interface wlan1 in phy phy4
1600641183.539737: nl80211: Set mode ifindex 2081 iftype 3 (AP)
1600641183.539849: nl80211: Unsubscribe mgmt frames handle 0x89823791 (start AP)
1600641183.540033: nl80211: Setup AP(wlan1) - device_ap_sme=0 use_monitor=0
1600641183.540125: nl80211: Subscribe to mgmt frames with AP handle 0x10abf18
1600641186.653836: Could not set interface wlan1 flags (UP): Input/output error
1600641186.653876: nl80211: Could not set interface 'wlan1' UP
1600641186.653899: nl80211: Found matching own interface, but failed to complete reinitialization
1600641186.654069: VLAN: RTM_NEWLINK: ifi_index=2081 ifname=wlan1 ifi_family=0 ifi_flags=0x1002 ()
1600641186.654087: VLAN: vlan_newlink(wlan1)
1600641186.713941: RTM_DELLINK: ifi_index=2081 ifname=wlan1 operstate=2 linkmode=0 ifi_family=0 ifi_flags=0x1002 ()
1600641186.713965: nl80211: if_removed already set - ignore RTM_DELLINK event for wlan1
1600641186.725633: VLAN: RTM_DELLINK: ifi_index=2081 ifname=wlan1 ifi_family=0 ifi_flags=0x1002 ()
1600641186.725659: VLAN: vlan_dellink(wlan1)
1600641187.584495: RTM_NEWLINK: ifi_index=2082 ifname=wlan1 operstate=2 linkmode=0 ifi_family=0 ifi_flags=0x1002 ()
1600641187.585759: nl80211: Update ifindex for a removed interface
1600641187.586447: nl80211: Supported cipher 00-0f-ac:1
1600641187.586483: nl80211: Supported cipher 00-0f-ac:5
1600641187.586500: nl80211: Supported cipher 00-0f-ac:2
1600641187.586525: nl80211: Supported cipher 00-0f-ac:4
1600641187.586540: nl80211: Supported cipher 00-0f-ac:10
1600641187.586554: nl80211: Supported cipher 00-0f-ac:8
1600641187.586569: nl80211: Supported cipher 00-0f-ac:9
1600641187.586583: nl80211: Supported cipher 00-0f-ac:6
1600641187.586597: nl80211: Supported cipher 00-0f-ac:13
1600641187.586831: nl80211: Supported cipher 00-0f-ac:11
1600641187.586855: nl80211: Supported cipher 00-0f-ac:12
1600641187.586932: nl80211: Using driver-based off-channel TX
1600641187.587157: nl80211: interface wlan1 in phy phy5
1600641187.587184: nl80211: Set mode ifindex 2082 iftype 3 (AP)
1600641187.587421: nl80211: Unsubscribe mgmt frames handle 0x89823791 (start AP)
1600641187.587643: nl80211: Setup AP(wlan1) - device_ap_sme=0 use_monitor=0
1600641187.587741: nl80211: Subscribe to mgmt frames with AP handle 0x10abf18
1600641188.364296: nl80211: Connect handle already created (nl_connect=0x10ac970)
1600641188.364502: nl80211: Mark if_removed=0 for wlan1 based on RTM_NEWLINK event
1600641188.364583: wlan1: Event INTERFACE_STATUS (5) received
1600641188.364658: Unknown event 5
1600641188.364744: RTM_NEWLINK: ifi_index=2082 ifname=wlan1 operstate=0 linkmode=0 ifi_family=0 ifi_flags=0x1043 ([UP][RUNNING])
1600641188.364868: nl80211: Interface up (wlan1/wlan1)
1600641188.364980: wlan1: Event INTERFACE_ENABLED (25) received
1600641188.365049: wlan1: INTERFACE-ENABLED 
1600641188.365174: wpa_driver_nl80211_set_key: ifindex=2082 (wlan1) alg=3 addr=0x119324 key_idx=1 set_tx=1 seq_len=0 key_len=16
1600641188.365257: nl80211: KEY_DATA - hexdump(len=16): [REMOVED]
1600641188.365339:    broadcast key
1600641188.365571: nl80211: Set beacon (beacon_set=0)
1600641188.365975: nl80211: ifindex=2082
1600641188.366043: nl80211: beacon_int=100
1600641188.366112: nl80211: beacon_rate=0
1600641188.366186: nl80211: rate_type=0
1600641188.366261: nl80211: dtim_period=2
1600641188.366333: nl80211: ssid - hexdump_ascii(len=7):
     47 2d 57 41 47 4f 4e                              <REDACTED>         
1600641188.366503:   * beacon_int=100
1600641188.366581:   * dtim_period=2
1600641188.366657: nl80211: hidden SSID not in use
1600641188.366735: nl80211: privacy=1
1600641188.366810: nl80211: auth_algs=0x1
1600641188.366882: nl80211: wpa_version=0x2
1600641188.366961: nl80211: key_mgmt_suites=0x2
1600641188.367043: nl80211: pairwise_ciphers=0x10
1600641188.367126: nl80211: group_cipher=0x10
1600641188.367200: nl80211: beacon_ies - hexdump(len=10): 7f 08 00 00 00 02 00 00 00 40
1600641188.367281: nl80211: proberesp_ies - hexdump(len=10): 7f 08 00 00 00 02 00 00 00 40
1600641188.367368: nl80211: assocresp_ies - hexdump(len=10): 7f 08 00 00 00 02 00 00 00 40
1600641188.367517: nl80211: Beacon set failed: -22 (Invalid argument)
1600641188.367590: Failed to set beacon parameters
1600641188.367733: RTM_NEWLINK: ifi_index=2082 ifname=wlan1 operstate=2 linkmode=0 ifi_family=0 ifi_flags=0x1003 ([UP])
1600641188.367894: VLAN: RTM_NEWLINK: ifi_index=2082 ifname=wlan1 ifi_family=0 ifi_flags=0x1002 ()
1600641188.367971: VLAN: vlan_newlink(wlan1)
1600641188.368087: VLAN: RTM_NEWLINK: ifi_index=2082 ifname=wlan1 ifi_family=0 ifi_flags=0x1043 ([UP][RUNNING])
1600641188.368156: VLAN: vlan_newlink(wlan1)
1600641188.368274: VLAN: RTM_NEWLINK: ifi_index=2082 ifname=wlan1 ifi_family=0 ifi_flags=0x1003 ([UP])
1600641188.368340: VLAN: vlan_newlink(wlan1)
1600641188.398935: RTM_NEWLINK: ifi_index=2082 ifname=wlan1 operstate=2 linkmode=0 ifi_family=0 ifi_flags=0x1003 ([UP])
1600641188.399082: VLAN: RTM_NEWLINK: ifi_index=2082 ifname=wlan1 ifi_family=0 ifi_flags=0x1003 ([UP])
1600641188.399135: VLAN: vlan_newlink(wlan1)
1600641195.734325: Unknown Microsoft information element ignored (type=8 len=8)
1600641195.734536: Ignore Probe Request due to DS Params mismatch: chan=7 != ds.chan=1
1600642515.763249: nl80211: send_mlme - da= 64:1c:b0:ef:99:22 noack=1 freq=0 no_cck=0 offchanok=0 wait_time=0 fc=0x50 (WLAN_FC_STYPE_PROBE_RESP) nlmode=3
1600642515.763274: nl80211: send_mlme -> send_frame
1600642515.763287: nl80211: send_frame - Use bss->freq=2442
1600642515.763300: nl80211: send_frame -> send_frame_cmd
1600642515.763314: nl80211: CMD_FRAME freq=2442 wait=0 no_cck=0 no_ack=1 offchanok=0
1600642515.763568: nl80211: Frame command failed: ret=-16 (Device or resource busy) (freq=2442 wait=0)
1600642515.763591: handle_probe_req: send failed
1600642515.765742: nl80211: send_mlme - da= 64:1c:b0:ef:99:22 noack=1 freq=0 no_cck=0 offchanok=0 wait_time=0 fc=0x50 (WLAN_FC_STYPE_PROBE_RESP) nlmode=3
1600642515.765860: nl80211: send_mlme -> send_frame
1600642515.765957: nl80211: send_frame - Use bss->freq=2442
1600642515.766056: nl80211: send_frame -> send_frame_cmd
1600642515.766079: nl80211: CMD_FRAME freq=2442 wait=0 no_cck=0 no_ack=1 offchanok=0
1600642515.766282: nl80211: Frame command failed: ret=-16 (Device or resource busy) (freq=2442 wait=0)
1600642515.766304: handle_probe_req: send failed
1600643055.956614: Ignore Probe Request due to DS Params mismatch: chan=7 != ds.chan=4
1600643955.647033: nl80211: send_mlme - da= 64:1c:b0:ef:99:22 noack=1 freq=0 no_cck=0 offchanok=0 wait_time=0 fc=0x50 (WLAN_FC_STYPE_PROBE_RESP) nlmode=3
1600643955.647057: nl80211: send_mlme -> send_frame
1600643955.647070: nl80211: send_frame - Use bss->freq=2442
1600643955.647084: nl80211: send_frame -> send_frame_cmd
1600643955.647097: nl80211: CMD_FRAME freq=2442 wait=0 no_cck=0 no_ack=1 offchanok=0
1600643955.647326: nl80211: Frame command failed: ret=-16 (Device or resource busy) (freq=2442 wait=0)
1600643955.647353: handle_probe_req: send failed
1600643955.649431: nl80211: send_mlme - da= 64:1c:b0:ef:99:22 noack=1 freq=0 no_cck=0 offchanok=0 wait_time=0 fc=0x50 (WLAN_FC_STYPE_PROBE_RESP) nlmode=3
1600643955.649454: nl80211: send_mlme -> send_frame
1600643955.649467: nl80211: send_frame - Use bss->freq=2442
1600643955.649480: nl80211: send_frame -> send_frame_cmd
1600643955.649493: nl80211: CMD_FRAME freq=2442 wait=0 no_cck=0 no_ack=1 offchanok=0
1600643955.649688: nl80211: Frame command failed: ret=-16 (Device or resource busy) (freq=2442 wait=0)
1600643955.649717: handle_probe_req: send failed
1600643955.652399: nl80211: send_mlme - da= 64:1c:b0:ef:99:22 noack=1 freq=0 no_cck=0 offchanok=0 wait_time=0 fc=0x50 (WLAN_FC_STYPE_PROBE_RESP) nlmode=3
1600643955.652422: nl80211: send_mlme -> send_frame
1600643955.652434: nl80211: send_frame - Use bss->freq=2442
1600643955.652447: nl80211: send_frame -> send_frame_cmd
1600643955.652460: nl80211: CMD_FRAME freq=2442 wait=0 no_cck=0 no_ack=1 offchanok=0
1600643955.652650: nl80211: Frame command failed: ret=-16 (Device or resource busy) (freq=2442 wait=0)
1600643955.652674: handle_probe_req: send failed
1600645124.882081: Add randomness: count=10240 entropy=1010
1600645124.882096: random pool - hexdump(len=128): [REMOVED]
1600645124.882111: random_mix_pool - hexdump(len=8): [REMOVED]
1600645124.882126: random_mix_pool - hexdump(len=16): [REMOVED]
1600645124.882140: random pool - hexdump(len=128): [REMOVED]
1600647135.984635: nl80211: send_mlme - da= 64:1c:b0:ef:99:22 noack=1 freq=0 no_cck=0 offchanok=0 wait_time=0 fc=0x50 (WLAN_FC_STYPE_PROBE_RESP) nlmode=3
1600647135.984658: nl80211: send_mlme -> send_frame
1600647135.984672: nl80211: send_frame - Use bss->freq=2442
1600647135.984687: nl80211: send_frame -> send_frame_cmd
1600647135.984700: nl80211: CMD_FRAME freq=2442 wait=0 no_cck=0 no_ack=1 offchanok=0
1600647135.984925: nl80211: Frame command failed: ret=-16 (Device or resource busy) (freq=2442 wait=0)
1600647135.984952: handle_probe_req: send failed
1600647135.989488: nl80211: send_mlme - da= 64:1c:b0:ef:99:22 noack=1 freq=0 no_cck=0 offchanok=0 wait_time=0 fc=0x50 (WLAN_FC_STYPE_PROBE_RESP) nlmode=3
1600647135.989510: nl80211: send_mlme -> send_frame
1600647135.989523: nl80211: send_frame - Use bss->freq=2442
1600647135.989536: nl80211: send_frame -> send_frame_cmd
1600647135.989549: nl80211: CMD_FRAME freq=2442 wait=0 no_cck=0 no_ack=1 offchanok=0
1600647135.989752: nl80211: Frame command failed: ret=-16 (Device or resource busy) (freq=2442 wait=0)
1600647135.989775: handle_probe_req: send failed

完整的调试日志这里


更新 27/09/20 - 附加输出

额外细节:

iw-list输出

iwconfig输出

usb-devices输出

干杯。

答案1

好吧,在对RT3070加密狗进行多次测试后,我可以肯定地说,这与设置有关tx-power

这里有几个问题:

1. CRDA 监管数据库最近似乎发生了变化。一些允许的值现在似乎代表 EIRP,而其他值仍然报告 ERP。

EIRP 对应于有效各向同性辐射功率,计算公式如下:

EIRP(dBm) = [Output Power] - [Cable Loss] + [Antenna Gain]

如果iw reg set AU使用澳大利亚国家代码,则iw reg get他们将看到以下输出:

global
country AU: DFS-ETSI
    (2400 - 2483 @ 40), (N/A, 36), (N/A)
    (5150 - 5250 @ 80), (N/A, 23), (N/A), NO-OUTDOOR, AUTO-BW
    (5250 - 5350 @ 80), (N/A, 20), (0 ms), NO-OUTDOOR, DFS, AUTO-BW
    (5470 - 5600 @ 80), (N/A, 27), (0 ms), DFS
    (5650 - 5730 @ 80), (N/A, 27), (0 ms), DFS
    (5730 - 5850 @ 80), (N/A, 36), (N/A)
    (57000 - 66000 @ 2160), (N/A, 43), (N/A), NO-OUTDOOR

第一行显示以下内容:(2.4GHz频段@ 40 MHz),(不适用,发射功率),换句话说,如果您的通道选择在 1-14 通道范围内,那么您的最大发射功率设置将为36 dBm。您可以通过运行轻松确认iwconfig wlan0 txpower 36

wlan0     IEEE 802.11  ESSID:"[SSID]"  
          Mode:Managed  Frequency:2.412 GHz  Access Point: [MAC]   
          Bit Rate=6.5 Mb/s   Tx-Power=36 dBm   
          Retry short  long limit:2   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=61/70  Signal level=-49 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:402  Invalid misc:3418   Missed beacon:0

然而,澳大利亚每 ACMA(FCC 的 AU 版本)的监管域限制指定 36 dBm 为最大 EIRP 功率,即发射机和天线增益的总和。换句话说,使用 36 dBm 的发射器并连接具有显着增益的天线是违法的,并且在许多地方操作 EIRP=40 dBm 的无线电设备(36 dBm + 6dBi - 1dBm 电缆损耗)会对让您受到当局的注意。

检查仍使用旧 CRDA 数据库的另一个系统(上次更新大约 1 个月前),iw reg get报告 AU 国家/地区代码的不同值。最大发射功率为 20 dBm。

这不仅限于 AU 国家代码,美国的发射功率也从原来的 20 dBm 跃升至现在的 30 dBm。

2. 连接稳定性与发射功率

看到有问题的tx-power价值观给我们提供了一个很好的参考点,但这并不能说明全部问题。因此,下一步是使用高增益 6dBi 平板天线,在不同的发射功率设置下使用不同国家的监管领域来运行连接测试。

实际记录的测试是8.8.8.8使用 AU(36dBm)、BO(20dBm) 和 US(30dBm) reg 域的每个 tx 功率设置从 10dBm 到 36dBm 的简单 5-ping 序列。

在日志中,TXPOWER 对应iwconfig wlan0 txpower [TXPOWER],而下一行的 tx-power 输出是iwconfig wlan0其自身的打印输出。每次重新配置 tx-power 时,都会sleep 5给接口 5 秒的时间来进行所有必要的校准。

我们:https://dpaste.com//CRAVMGW8S

非盟:https://dpaste.com//CETUDFVHA

博:https://dpaste.com//674RUR9TT

从日志中可以看出,根据所选的监管域,故障发生在非常不同的 tx-power 设置下。 AU 域无法在低于 30 dBm 的情况下维持连接,而 BO 在 19-20 dBm 时具有最强的连接。同样,美国开始在低于 26 dBm 时出现连接问题。

4. 界面崩溃及原因

如果您查看美国域的日志,在底部您将看到同名接口崩溃,随后出现数据包丢失和(丢失+错误)。它是 100% 可以重现的。

该错误似乎与某种线程锁定有关,因为使用ifup和重新启动界面ifdown没有任何效果。同样,如果tx-power的值不正确,则重新启动任何及所有相关的网络和网络管理器服务不会使接口联机。

尽管进行了重置,接口仍会显示为已启动,甚至iwconfig可能确实报告最大功率(如 OPiwconfig输出),但没有任何方法可以在该接口上实现连接,甚至无法更改其无线设置。

但是,如果有人执行以下操作:

sudo ifconfig wlan0 down
sudo iw reg set BO
sudo iwconfig wlan0 txpower 20
sudo ifconfig wlan0 up

ifconfig wlan0 down**最重要的步骤是在恢复之前重置 txpower 。 **

这可以 100% 解决问题

5. 以 36 dBm 与 A​​U 连接

我尚未对此进行长时间测试,但一小时后,适配器似乎确实变得更热,并且 ping 平均延迟比20 dBmiw reg set BO时更差。tx-power

相关内容