我正在创建一个使用蓝牙分析仪的实验。我正在创建一个必须使用 5GHz 频段的 Wi-Fi 热点,这样它就不会干扰蓝牙。
我已经编辑了 Hotspot.nmconnection 文件以强制 5GHz:
[connection]
id=Hotspot
uuid=d37d72ae-0731-4bbd-8e4d-ec1b99f4df72
type=wifi
autoconnect=false
interface-name=wlx9418655b6ec2
timestamp=1706128923
[wifi]
band=a
mode=ap
ssid=hw-ble-station
[wifi-security]
group=ccmp;
key-mgmt=sae
pairwise=ccmp;
proto=rsn;
psk=******
[ipv4]
method=shared
[ipv6]
addr-gen-mode=stable-privacy
method=auto
[proxy]
热点打开并可以访问互联网,但我的频谱分析仪显示它在 2.4GHz 范围内广播。
在 Ubuntu 22.04 上。[
]1
由于修改 nmconnections 不起作用,我尝试了以下操作:
hardwaresyseng@hw-ble-station:~$ nmcli con mod Hotspot wifi.band a
Error: Failed to modify connection 'Hotspot': Insufficient privileges
hardwaresyseng@hw-ble-station:~$ sudo nmcli con mod Hotspot wifi.band a
hardwaresyseng@hw-ble-station:~$ sudo nmcli connection up Hotspot
Error: Connection activation failed: 802.1X supplicant took too long to authenticate
Hint: use 'journalctl -xe NM_CONNECTION=d37d72ae-0731-4bbd-8e4d-ec1b99f4df72 + NM_DEVICE=wlx9418655b6ec2' to get more details.
hardwaresyseng@hw-ble-station:~$ journalctl -xe NM_CONNECTION=d37d72ae-0731-4bbd-8e4d-ec1b99f4df72 + NM_DEVICE=wlx9418655b6ec2
iw phy 的输出太大,超出了 30k 个字符的限制,所以我无法按要求将其包括在内。
这是的尾部journalctl -u wpa_supplicant.service -b -0
:
hardwaresyseng@hw-ble-station:~$ tail journal.txt
Feb 12 17:01:11 hw-ble-station wpa_supplicant[658]: wlx9418655b6ec2: CTRL-EVENT-DSCP-POLICY clear_all
Feb 12 17:01:11 hw-ble-station wpa_supplicant[658]: Note: nl80211 driver interface is not designed to be used with ap_scan=2; this can result in connection failures
Feb 12 17:01:11 hw-ble-station wpa_supplicant[658]: wlx9418655b6ec2: Failed to start AP functionality
Feb 12 17:01:36 hw-ble-station wpa_supplicant[658]: wlx9418655b6ec2: CTRL-EVENT-DSCP-POLICY clear_all
Feb 12 17:01:39 hw-ble-station wpa_supplicant[658]: Note: nl80211 driver interface is not designed to be used with ap_scan=2; this can result in connection failures
Feb 12 17:01:39 hw-ble-station wpa_supplicant[658]: wlx9418655b6ec2: Failed to start AP functionality
Feb 12 17:02:05 hw-ble-station wpa_supplicant[658]: wlx9418655b6ec2: CTRL-EVENT-DSCP-POLICY clear_all
Feb 12 17:02:08 hw-ble-station wpa_supplicant[658]: Note: nl80211 driver interface is not designed to be used with ap_scan=2; this can result in connection failures
Feb 12 17:02:08 hw-ble-station wpa_supplicant[658]: wlx9418655b6ec2: Failed to start AP functionality
Feb 12 17:02:34 hw-ble-station wpa_supplicant[658]: wlx9418655b6ec2: CTRL-EVENT-DSCP-POLICY clear_all
这是的尾部iw phy
:
hardwaresyseng@hw-ble-station:~$ tail -200 iw_phy.txt
TX STBC
RX STBC 1-stream
Max AMSDU length: 7935 bytes
DSSS/CCK HT40
Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
Minimum RX AMPDU time spacing: 4 usec (0x05)
HT Max RX data rate: 300 Mbps
HT TX/RX MCS rate indexes supported: 0-15
VHT Capabilities (0x039071f6):
Max MPDU length: 11454
Supported Channel Width: 160 MHz
RX LDPC
short GI (80 MHz)
short GI (160/80+80 MHz)
TX STBC
SU Beamformee
MU Beamformee
VHT RX MCS set:
1 streams: MCS 0-9
2 streams: MCS 0-9
3 streams: not supported
4 streams: not supported
5 streams: not supported
6 streams: not supported
7 streams: not supported
8 streams: not supported
VHT RX highest supported: 0 Mbps
VHT TX MCS set:
1 streams: MCS 0-9
2 streams: MCS 0-9
3 streams: not supported
4 streams: not supported
5 streams: not supported
6 streams: not supported
7 streams: not supported
8 streams: not supported
VHT TX highest supported: 0 Mbps
Bitrates (non-HT):
* 6.0 Mbps
* 9.0 Mbps
* 12.0 Mbps
* 18.0 Mbps
* 24.0 Mbps
* 36.0 Mbps
* 48.0 Mbps
* 54.0 Mbps
Frequencies:
* 5180 MHz [36] (22.0 dBm)
* 5200 MHz [40] (22.0 dBm)
* 5220 MHz [44] (22.0 dBm)
* 5240 MHz [48] (22.0 dBm)
* 5260 MHz [52] (22.0 dBm)
* 5280 MHz [56] (22.0 dBm)
* 5300 MHz [60] (22.0 dBm)
* 5320 MHz [64] (22.0 dBm)
* 5340 MHz [68] (22.0 dBm)
* 5360 MHz [72] (22.0 dBm)
* 5380 MHz [76] (22.0 dBm)
* 5400 MHz [80] (22.0 dBm)
* 5420 MHz [84] (22.0 dBm)
* 5440 MHz [88] (22.0 dBm)
* 5460 MHz [92] (22.0 dBm)
* 5480 MHz [96] (22.0 dBm)
* 5500 MHz [100] (22.0 dBm)
* 5520 MHz [104] (22.0 dBm)
* 5540 MHz [108] (22.0 dBm)
* 5560 MHz [112] (22.0 dBm)
* 5580 MHz [116] (22.0 dBm)
* 5600 MHz [120] (22.0 dBm)
* 5620 MHz [124] (22.0 dBm)
* 5640 MHz [128] (22.0 dBm)
* 5660 MHz [132] (22.0 dBm)
* 5680 MHz [136] (22.0 dBm)
* 5700 MHz [140] (22.0 dBm)
* 5720 MHz [144] (22.0 dBm)
* 5745 MHz [149] (22.0 dBm)
* 5765 MHz [153] (22.0 dBm)
* 5785 MHz [157] (22.0 dBm)
* 5805 MHz [161] (22.0 dBm)
* 5825 MHz [165] (22.0 dBm)
* 5845 MHz [169] (22.0 dBm)
* 5865 MHz [173] (22.0 dBm)
* 5885 MHz [177] (22.0 dBm)
* 5905 MHz [181] (22.0 dBm)
Supported commands:
* new_interface
* set_interface
* new_key
* start_ap
* new_station
* new_mpath
* set_mesh_config
* set_bss
* authenticate
* associate
* deauthenticate
* disassociate
* join_ibss
* join_mesh
* remain_on_channel
* set_tx_bitrate_mask
* frame
* frame_wait_cancel
* set_wiphy_netns
* set_channel
* tdls_mgmt
* tdls_oper
* start_sched_scan
* probe_client
* set_noack_map
* register_beacons
* start_p2p_device
* set_mcast_rate
* connect
* disconnect
* channel_switch
* set_qos_map
* add_tx_ts
* set_multicast_to_unicast
WoWLAN support:
* wake up on disconnect
* wake up on magic packet
* wake up on pattern match, up to 20 patterns of 16-128 bytes,
maximum packet offset 0 bytes
* can do GTK rekeying
* wake up on GTK rekey failure
* wake up on EAP identity request
* wake up on 4-way handshake
* wake up on rfkill release
* wake up on network detection, up to 11 match sets
software interface modes (can always be added):
* AP/VLAN
* monitor
valid interface combinations:
* #{ managed } <= 1, #{ AP, P2P-client, P2P-GO } <= 1, #{ P2P-device } <= 1,
total <= 3, #channels <= 2
HT Capability overrides:
* MCS: ff ff ff ff ff ff ff ff ff ff
* maximum A-MSDU length
* supported channel width
* short GI for 40 MHz
* max A-MPDU length exponent
* min MPDU start spacing
Device supports TX status socket option.
Device supports HT-IBSS.
Device supports SAE with AUTHENTICATE command
Device supports low priority scan.
Device supports scan flush.
Device supports per-vif TX power setting
P2P GO supports CT window setting
P2P GO supports opportunistic powersave setting
Driver supports full state transitions for AP/GO clients
Driver supports a userspace MPM
Driver/device bandwidth changes during BSS lifetime (AP/GO mode)
Device adds DS IE to probe requests
Device can update TPC Report IE
Device supports static SMPS
Device supports dynamic SMPS
Device supports WMM-AC admission (TSPECs)
Device supports configuring vdev MAC-addr on create.
Device supports randomizing MAC-addr in scans.
Device supports randomizing MAC-addr in sched scans.
Device supports randomizing MAC-addr in net-detect scans.
max # scan plans: 2
max scan plan interval: 65535
max scan plan iterations: 254
Supported TX frame types:
* IBSS: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* mesh point: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
* P2P-device: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
Supported RX frame types:
* IBSS: 0x40 0xb0 0xc0 0xd0
* managed: 0x40 0xb0 0xd0
* AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
* AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
* mesh point: 0xb0 0xc0 0xd0
* P2P-client: 0x40 0xd0
* P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
* P2P-device: 0x40 0xd0
Supported extended features:
* [ VHT_IBSS ]: VHT-IBSS
* [ RRM ]: RRM
* [ MU_MIMO_AIR_SNIFFER ]: MU-MIMO sniffer
* [ SCAN_START_TIME ]: scan start timestamp
* [ BSS_PARENT_TSF ]: BSS last beacon/probe TSF
* [ BEACON_RATE_LEGACY ]: legacy beacon rate setting
* [ FILS_STA ]: STA FILS (Fast Initial Link Setup)
* [ CONTROL_PORT_OVER_NL80211 ]: control port over nl80211
* [ TXQS ]: FQ-CoDel-enabled intermediate TXQs
* [ SCAN_MIN_PREQ_CONTENT ]: use probe request with only rate IEs in scans
* [ EXT_KEY_ID ]: Extended Key ID support
* [ CONTROL_PORT_NO_PREAUTH ]: disable pre-auth over nl80211 control port support
* [ DEL_IBSS_STA ]: deletion of IBSS station support
* [ SCAN_FREQ_KHZ ]: scan on kHz frequency support
* [ CONTROL_PORT_OVER_NL80211_TX_STATUS ]: tx status for nl80211 control port support
hardwaresyseng@hw-ble-station:~$ sudo iwlist wlx9418655b6ec2 channel
wlx9418655b6ec2 32 channels in total; available frequencies :
Channel 01 : 2.412 GHz
Channel 02 : 2.417 GHz
Channel 03 : 2.422 GHz
Channel 04 : 2.427 GHz
Channel 05 : 2.432 GHz
Channel 06 : 2.437 GHz
Channel 07 : 2.442 GHz
Channel 08 : 2.447 GHz
Channel 09 : 2.452 GHz
Channel 10 : 2.457 GHz
Channel 11 : 2.462 GHz
Channel 12 : 2.467 GHz
Channel 13 : 2.472 GHz
Channel 14 : 2.484 GHz
Channel 36 : 5.18 GHz
Channel 40 : 5.2 GHz
Channel 44 : 5.22 GHz
Channel 48 : 5.24 GHz
Channel 52 : 5.26 GHz
Channel 56 : 5.28 GHz
Channel 60 : 5.3 GHz
Channel 64 : 5.32 GHz
Channel 100 : 5.5 GHz
Channel 104 : 5.52 GHz
Channel 108 : 5.54 GHz
Channel 112 : 5.56 GHz
Channel 116 : 5.58 GHz
Channel 120 : 5.6 GHz
Channel 124 : 5.62 GHz
Channel 128 : 5.64 GHz
Channel 132 : 5.66 GHz
Channel 136 : 5.68 GHz
Feb 12 17:09:22 hw-ble-station NetworkManager[621]: <warn> [1707786562.0050] device (wlx9418655b6ec2): Activation: (wifi) Hotspot network creation took too long, failin>
Feb 12 17:09:22 hw-ble-station NetworkManager[621]: <info> [1707786562.0051] device (wlx9418655b6ec2): state change: config -> failed (reason 'supplicant-timeout', sys->
Feb 12 17:09:22 hw-ble-station NetworkManager[621]: <warn> [1707786562.0062] device (wlx9418655b6ec2): Activation: failed for connection 'Hotspot'
Feb 12 17:09:22 hw-ble-station NetworkManager[621]: <info> [1707786562.0069] device (wlx9418655b6ec2): state change: failed -> disconnected (reason 'none', sys-iface-st>
Feb 12 17:11:46 hw-ble-station NetworkManager[621]: <info> [1707786706.3997] device (wlx9418655b6ec2): Activation: starting connection 'Hotspot' (d37d72ae-0731-4bbd-8e4>
Feb 12 17:11:46 hw-ble-station NetworkManager[621]: <info> [1707786706.3998] device (wlx9418655b6ec2): state change: disconnected -> prepare (reason 'none', sys-iface-s>
Feb 12 17:11:46 hw-ble-station NetworkManager[621]: <info> [1707786706.4002] device (wlx9418655b6ec2): state change: prepare -> config (reason 'none', sys-iface-state: >
Feb 12 17:11:46 hw-ble-station NetworkManager[621]: <info> [1707786706.4005] device (wlx9418655b6ec2): Activation: (wifi) access point 'Hotspot' has security, but secre>
Feb 12 17:11:46 hw-ble-station NetworkManager[621]: <info> [1707786706.4005] device (wlx9418655b6ec2): state change: config -> need-auth (reason 'none', sys-iface-state>
Feb 12 17:11:46 hw-ble-station NetworkManager[621]: <info> [1707786706.4012] device (wlx9418655b6ec2): state change: need-auth -> prepare (reason 'none', sys-iface-stat>
Feb 12 17:11:46 hw-ble-station NetworkManager[621]: <info> [1707786706.4018] device (wlx9418655b6ec2): state change: prepare -> config (reason 'none', sys-iface-state: >
Feb 12 17:11:46 hw-ble-station NetworkManager[621]: <info> [1707786706.4019] device (wlx9418655b6ec2): Activation: (wifi) connection 'Hotspot' has security, and secrets>
Feb 12 17:12:12 hw-ble-station NetworkManager[621]: <warn> [1707786732.0042] device (wlx9418655b6ec2): Activation: (wifi) Hotspot network creation took too long, failin>
Feb 12 17:12:12 hw-ble-station NetworkManager[621]: <info> [1707786732.0043] device (wlx9418655b6ec2): state change: config -> failed (reason 'supplicant-timeout', sys->
Feb 12 17:12:12 hw-ble-station NetworkManager[621]: <warn> [1707786732.0053] device (wlx9418655b6ec2): Activation: failed for connection 'Hotspot'
Feb 12 17:12:12 hw-ble-station NetworkManager[621]: <info> [1707786732.0059] device (wlx9418655b6ec2): state change: failed -> disconnected (reason 'none', sys-iface-st>
答案1
首先仔细检查 Wi-Fi 适配器支持情况:确保设备上的 Wi-Fi 适配器支持 5GHz 频段。并非所有 Wi-Fi 适配器都支持 2.4GHz 和 5GHz 频段。
然后监控频道和频率:使用命令行工具或图形网络监控工具检查热点广播的实际频率和频道。这可以帮助您确认它是否在 5GHz 频段。
sudo iwlist wlxxxxx channel
更新 NetworkManager:确保您安装了最新版本的 NetworkManager,因为更新可能包括错误修复和改进。
sudo apt update
sudo apt upgrade