如何从覆盆子Pi托管wifi网络?

时间:2016-04-13 13:54:01

标签: networking raspberry-pi wifi driver dhcp

所以我想尝试一个覆盆子pi 2 B +来生成一个wifi网络,我可以连接各种其他wifi功能项目(Android手机,Windows PC等)我不需要它转发连接到外。 我正在运行最新的raspbian jessie,更新并使用D-Link Dwa-131 wifi加密狗。

我从adafruit那里学到了这个教程: https://learn.adafruit.com/setting-up-a-raspberry-pi-as-a-wifi-access-point

在通过NAT配置之前停止,我不需要。他们提供的hostapd版本的链接也已经死了,所以我跳过了。

尝试使用我的配置文件启动hostapd时(sudo / usr / sbin / hostapd /etc/hostapd/hostapd.conf)我收到以下错误:

Configuration file: /etc/hostapd/hostapd.conf 
Line 2: invalid/unknown driver 'r8712u' 
1 errors found in configuration file '/etc/hostapd/hostapd.conf' 
Failed to set up interface with /etc/hostapd/hostapd.conf 
Failed to initialize interface

所以我接着检查了我的wlan0设备驱动程序,结果得到了r8712u:

readlink /sys/class/net/wlan0/device/driver   
../../../../../../../../bus/usb/drivers/r8712u

所以我有点被困在这里。

这是我的hostapd.conf,如果有任何帮助的话。但它与教程没有什么不同。

interface=wlan0
driver=r8712u
ssid=raspberry
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=passphrase
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

欢迎任何帮助。

编辑:在SO上发现this帖子后,我尝试从adafruit获取hostapd版本,并用它来更新我自己的版本(第一次必须弄错地址)。但问题没有改变。

编辑2:最后一切都归结为加密狗不具备nl80211能力。所以在我的Pi上没有AP,直到我得到另一个。或者Pi3。

2 个答案:

答案 0 :(得分:0)

阅读official documentation

具体来说,您可能需要使用driver=nl80211

这是我几年前使用的配置,但应该仍然可以使用:

interface=wlan0
driver=nl80211

# Enable country-based frequency/power limits
ieee80211d=1
# Set this to your country code:
country_code=US

# This is the name of the network:
ssid=Home

# g actually means to use the 2.4 GHz channels, i.e. b/g/n
hw_mode=g
# Pick any channel from 1 to 11, ideally the one that is least used by other APs:
channel=1

# The encryption scheme. As far as I know, this is the safest combination nowadays.
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
rsn_pairwise=CCMP
# 1=wpa, 2=wep, 3=both. You really want WPA.
auth_algs=1

# Set the password here:
wpa_passphrase=complicated
# Disable MAC filtering.
macaddr_acl=0
# Uncomment this to enable 802.11n (faster). Might work badly on some cards.
#ieee80211n=1

我为你添加了评论。

答案 1 :(得分:0)

我在raspbian拉伸时遇到了同样的问题 尝试这个,如果它的工作 sudo killall wpa_supplicant sudo hostapd /etc/hostapd/hostapd.conf 看它是否初始化没有问题,因为它在我的工作 我在raspberry页面上使用教程中的默认hostapd conf 然后我删除了wpa_supplicant as sudo apt remove wpasupplicant 并重新启动它

相关问题