我正在尝试将我的 Raspberry Pi Compute Module 3+ 设置为带有 WiFi 加密狗的接入点的接入点。
我正在关注本教程:https ://elinux.org/RPI-Wireless-Hotspot 。
我可以使用加密狗 EP-N8508GS 设置接入点,但是当我尝试使用 TL-WN722N 时,出现以下错误:
pi@raspberrypi:~ $ sudo service hostapd start
Job for hostapd.service failed because the control process exited with error code.
See "systemctl status hostapd.service" and "journalctl -xe" for details.
这似乎是 nl80211 驱动程序的问题,但我真的不明白为什么它适用于第一个加密狗而不适用于另一个加密狗。我想尝试使用 tp-link 加密狗,因为第一个不支持 AP 模式并在设备尝试连接时使 kernell 崩溃。
$ 服务主机状态
pi@raspberrypi:~ $ service hostapd status
● hostapd.service - Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
Loaded: loaded (/lib/systemd/system/hostapd.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Mon 2019-05-06 03:49:27 BST; 1
Process: 1103 ExecStart=/usr/sbin/hostapd -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF
May 06 03:49:27 raspberrypi systemd[1]: hostapd.service: Control process exited, code=exited
May 06 03:49:27 raspberrypi systemd[1]: Failed to start Advanced IEEE 802.11 AP and IEEE 802.
May 06 03:49:27 raspberrypi systemd[1]: hostapd.service: Unit entered failed state.
May 06 03:49:27 raspberrypi systemd[1]: hostapd.service: Failed with result 'exit-code'.
$ journalctl -xe
pi@raspberrypi:~ $ journalctl -xe
May 06 04:10:22 raspberrypi hostapd[619]: nl80211: Driver does not support authentication/ass
May 06 04:10:22 raspberrypi hostapd[619]: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
May 06 04:10:22 raspberrypi hostapd[619]: nl80211 driver initialization failed.
May 06 04:10:22 raspberrypi hostapd[619]: wlan0: interface state UNINITIALIZED->DISABLED
May 06 04:10:22 raspberrypi hostapd[619]: wlan0: AP-DISABLED
May 06 04:10:22 raspberrypi hostapd[619]: hostapd_free_hapd_data: Interface wlan0 wasn't star
May 06 04:10:22 raspberrypi systemd[1]: hostapd.service: Control process exited, code=exited
May 06 04:10:22 raspberrypi systemd[1]: Failed to start Advanced IEEE 802.11 AP and IEEE 802.
-- Subject: Unit hostapd.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit hostapd.service has failed.
--
-- The result is failed.
May 06 04:10:22 raspberrypi systemd[1]: hostapd.service: Unit entered failed state.
May 06 04:10:22 raspberrypi systemd[1]: hostapd.service: Failed with result 'exit-code'.
May 06 04:10:25 raspberrypi systemd[1]: hostapd.service: Service hold-off time over, scheduli
May 06 04:10:25 raspberrypi systemd[1]: Stopped Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/W
-- Subject: Unit hostapd.service has finished shutting down
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit hostapd.service has finished shutting down.
May 06 04:10:25 raspberrypi systemd[1]: Starting Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/
-- Subject: Unit hostapd.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit hostapd.service has begun starting up.
May 06 04:10:25 raspberrypi hostapd[621]: Configuration file: /etc/hostapd/hostapd.conf
May 06 04:10:25 raspberrypi hostapd[621]: nl80211: Driver does not support authentication/ass
May 06 04:10:25 raspberrypi hostapd[621]: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
May 06 04:10:25 raspberrypi hostapd[621]: nl80211 driver initialization failed.
May 06 04:10:25 raspberrypi hostapd[621]: wlan0: interface state UNINITIALIZED->DISABLED
May 06 04:10:25 raspberrypi hostapd[621]: wlan0: AP-DISABLED
May 06 04:10:25 raspberrypi hostapd[621]: hostapd_free_hapd_data: Interface wlan0 wasn't star
May 06 04:10:25 raspberrypi systemd[1]: hostapd.service: Control process exited, code=exited
May 06 04:10:25 raspberrypi systemd[1]: Failed to start Advanced IEEE 802.11 AP and IEEE 802.
-- Subject: Unit hostapd.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit hostapd.service has failed.
--
-- The result is failed.
May 06 04:10:25 raspberrypi systemd[1]: hostapd.service: Unit entered failed state.
May 06 04:10:25 raspberrypi systemd[1]: hostapd.service: Failed with result 'exit-code'.
我的配置:
/lib/systemd/system/hostapd.service
pi@raspberrypi:~ $ cat /lib/systemd/system/hostapd.service
[Unit]
Description=Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
After=network.target
[Service]
Type=forking
PIDFile=/run/hostapd.pid
Restart=on-failure
RestartSec=2
EnvironmentFile=/etc/default/hostapd
ExecStart=/usr/sbin/hostapd -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF}
/etc/default/hostapd
pi@raspberrypi:~ $ cat /etc/default/hostapd
# Defaults for hostapd initscript
#
# See /usr/share/doc/hostapd/README.Debian for information about alternative
# methods of managing hostapd.
#
# Uncomment and set DAEMON_CONF to the absolute path of a hostapd configuration
# file and hostapd will be started during system boot. An example configuration
# file can be found at /usr/share/doc/hostapd/examples/hostapd.conf.gz
#
DAEMON_CONF="/etc/hostapd/hostapd.conf"
# Additional daemon options to be appended to hostapd command:-
# -d show more debug messages (-dd for even more)
# -K include key data in debug messages
# -t include timestamps in some debug messages
#
# Note that -B (daemon mode) and -P (pidfile) options are automatically
# configured by the init.d script and must not be added to DAEMON_OPTS.
#
#DAEMON_OPTS=""
/etc/hostapd/hostapd.conf
pi@raspberrypi:~ $ cat /etc/hostapd/hostapd.conf
interface=wlan0
ssid=MyAP
hw_mode=g
channel=1
auth_algs=1
ieee80211n=1 # 802.11n support
wmm_enabled=1 # QoS support
ht_capab=[HT40+][SHORT-GI-20][DSSS_CCK-40]