http://www.daveconroy.com/turn-your-raspberry-pi-into-a-wifi-hotspot-with-edimax-nano-usb-ew-7811un-rtl8188cus-chipset/

Posted by dconroy on Jul 10, 2013 in How To's, Raspberry Pi | 142 comments | 143,087 views

I’m writing this blog to help anyone with an Edimax Nano USB WiFi adapter (EW-7811Un) configure a Wireless Accesss Point. The main reason I wrote this post is because the Edimax was the first wireless adapter I ever recommended(turning a Raspberry Pi into a fully functional web server). I chose this adapter because it works out of the box, is cheap, and has a really low profile. But when I started the process of trying to turn my rPi into a WiFi hotspot, it seemed that every tutorial out there claimed that the Edimax card I had recommended “doesn’t support Access Point”.

Luckily for you and me, this is not the case.

Given the varied level of experience of my readers, this tutorial will start from scratch. If you already have your operating system running, skip forward as needed.

For this tutorial I am using Raspbian. I recommend it because it is an optimized version of Debian built specifically for Raspberry Pi’s. The last stable downloads can be found here.

To flash your SD Card, you will need to unzip the image and write it your SD card using Win32DiskImager. This tool can also be used to after our initial setup to create an image of our finalized implementation(very useful as a backup).

After the image is flashed, you can boot your device. At this point you can use your HDMI Cable/Mouse/Keyboard for your initial configuration, or you can use an SSH Client like Putty to connect. The default hostname, login, and password are as follows:

host:raspberrypi
Username: pi
Password: raspberry

For this tutorial, I will be using putty. On first boot, you will be prompted with a configuration tool called Raspi-Config. If the raspi-config doesnt load automatically, just enter the following command from the shell to get started.

sudo raspi-config

The settings I recommend you update are

update
expand_rootfs
change_pass
change_timezone
memory_split

The usual distribution images are 2 GB. When you copy the image to a
larger SD card you have a portion of that card unused. expand_rootfs
expands the initial image to expand to fill the rest of the SD card,
giving you more space. By default, 64mb is reserved for the Graphical
UI. Since we plan on using this as a WiFi Hotspot, we can reduce this to
32mb with the memory_split command.

After you finish your changes to the raspi-config, you should reboot your pi using the following command:

sudo shutdown -r now

At this point you have a fully functional linux server, but we still need to check our network card and setup our WiFi hotspot.

Prerequisites

The first thing you need to do is make sure you have an existing wired connection to your rPi. After that, you need to install the following packages.

sudo apt-get install bridge-utils hostapd

The whole crux of the issue is that it is the apt hosted copy of hostapd that is not compatible with the RTL8188CUS chipset. But, thanks to the Edimax team, I’ve got a replacement hostapd binary to resolve this issue. This tutorial will not work without it.

To download and replace the installed binary version of hostapd we just installed, issue the following commands:

wget http://www.daveconroy.com/wp3/wp-content/uploads/2013/07/hostapd.zip
unzip hostapd.zip
sudo mv /usr/sbin/hostapd /usr/sbin/hostapd.bak
sudo mv hostapd /usr/sbin/hostapd.edimax
sudo ln -sf /usr/sbin/hostapd.edimax /usr/sbin/hostapd
sudo chown root.root /usr/sbin/hostapd
sudo chmod 755 /usr/sbin/hostapd

*Note, some people don’t like the idea of installing from untrusted 3rd parties, so if If would rather compile your own binary, you can download the realtek driver here. You will have to navigate to the ~/RTL8188C_8192C_USB_linux_v3.4.4_4749.20121105/wpa_supplicant_hostapd/wpa_supplicant_hostapd-0.8/hostapd and run a make, make install, then hostapd like i did above.

Bridge the Network Connections

Now that we have the proper hostapd installed, we need to create a bridge between our ethernet connection and our Edimax Wireless card. To do this, we need to edit our network interfaces:

sudo nano /etc/network/interfaces

To avoid any conflicts, you need to delete or comment out(#) any lines conatining wlan0 and then add the following text to bridge the connections, assuming your ethernet and wireless adapters are named eth0 and wlan0( use ifconfig -a to check)

auto br0
iface br0 inet dhcp
bridge_ports eth0 wlan0

The resulting file should look like this:

#loopback adapter
auto lo
iface lo inet loopback

#wired adapter
iface eth0 inet dhcp

#bridge
auto br0
iface br0 inet dhcp
bridge_ports eth0 wlan0

Configuring Hostapd

Now that our interfaces are setup, we need to configure hostapd. To do so, create the following file

sudo nano /etc/hostapd/hostapd.conf

with the following contents:

interface=wlan0
driver=rtl871xdrv
bridge=br0
ssid=DaveConroyPi
channel=1
wmm_enabled=0
wpa=1
wpa_passphrase=ConroyPi
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
auth_algs=1
macaddr_acl=0

Wrapping Up

We should be finished now, and afer a reboot

sudo reboot

you can test your configuration using the following command

sudo hostapd -dd /etc/hostapd/hostapd.conf

If it runs as expected, you can add it to startup by editing

sudo nano /etc/default/hostapd

and uncommenting and updating the following line

DAEMON_CONF="/etc/hostapd/hostapd.conf"

That should do it! I’m happy to answer any questions, just comment on this post. Thanks for reading!

Turn Your Raspberry Pi Into a WiFi Hotspot with Edimax Nano USB EW-7811Un (RTL8188CUS chipset)的更多相关文章

  1. Raspberry PI B+ debian + wifi 网络设置

    # file /etc/network/interfaces auto lo iface lo inet loopback #auto eth0 #allow-hotplug eth0 #iface ...

  2. 树莓派(Raspberry Pi 3) 使用wifi模块连接网络

    树莓派3B内置了wifi和蓝牙模块,启动WIFI模块有两种方式,一种是图形界面,一种是命令行模式. 使用图形界面: 在桌面右上角的菜单栏里面选择wifi,输入密码就可以了. 使用命令行: 第一步:配置 ...

  3. 【树莓派】【转】将树莓派Raspberry Pi设置为无线路由器(WiFi热点AP,RTL8188CUS芯片)

    下文为转载,文章转自:http://wangye.org/blog/archives/845/,仅供本次学习实践参考. 最近又开始折腾起Raspberry Pi来了,因为某处上网需要锐捷拨号,于是我就 ...

  4. 将树莓派Raspberry Pi设置为无线路由器(WiFi热点AP,RTL8188CUS芯片)

    http://wangye.org/blog/archives/845/ 最近又开始折腾起Raspberry Pi来了,因为某处上网需要锐捷拨号,于是我就想能不能让我的树莓派代劳,当然首先要将其改造为 ...

  5. 树莓派做AP发射wifi(RTL8188CUS芯片) 分类: shell ubuntu Raspberry Pi 2014-11-29 01:25 822人阅读 评论(0) 收藏

    最近在做一个项目,需要用树莓派作为AP发射wifi,对比cubieboard,树莓派的配置容易得多,而且支持也更多. 较为官方的介绍配置为无线热点的文章莫过于这一篇<RPI-Wireless-H ...

  6. 最简单的RASPBERRY PI wifi配置

    Setting up Wifi with the Command Line  SIMON MONK   This tutorial works best if your router is broad ...

  7. RASPBERRY PI wifi配置

    Raspberry Pi 手把手教你在树莓派上安装USB无线网卡支持WIFI 树莓派虽然已经有了有线网卡,但是并未配置无线网卡,移动性不够强,好在机器配备了2个USB口,当然要分一个出来给WIFI无线 ...

  8. RASPBERRY PI 外设学习资源

    参考: http://www.siongboon.com/projects/2013-07-08_raspberry_pi/index.html Raspberry Pi         Get st ...

  9. Adding an On/Off switch to your Raspberry Pi

    http://www.raspberry-pi-geek.com/Archive/2013/01/Adding-an-On-Off-switch-to-your-Raspberry-Pi#articl ...

随机推荐

  1. 在MAC下调试运行暗黑全世界客户端及部分代码注解(基于Firefly)

    原地址:http://www.myexception.cn/program/1399860.html 在MAC下调试运行暗黑全世界客户端及部分代码注解(基于Firefly) 在MAC下调试运行暗黑世界 ...

  2. Python利用ConfigParser读取配置文件

    http://www.2cto.com/kf/201108/100384.html #!/usr/bin/python # -*- coding:utf-8 -*- import ConfigPars ...

  3. Socat

    http://www.oschina.net/p/socat/ tcpick https://sourceforge.net/projects/tcpick/

  4. ***用php的strpos() 函数判断字符串中是否包含某字符串的方法

    判断某字符串中是否包含某字符串的方法 if(strpos('www.idc-gz.com','idc-gz') !== false){ echo '包含'; }else{ echo '不包含'; } ...

  5. SRM589

    250: 给一个串S,可以做这样的操作,可以将串中的一种字母变成另一种字母,代价是该种字母的数量.求解的问题是,最小的代价将串S变成回文串. 根据回文关系,我们可以形成等价对应关系,a与b等价对应说明 ...

  6. Android 通过广播启动另一个应用的Activity

    需求:现在有应用A和应用B,我需要在A应用中启动B应用中的某个Activity 实现:A应用中的Activity发送广播,关键代码如下: String broadcastIntent = " ...

  7. Hadoop初步认识

    Hadoop的介绍: Hadoop是一个适用于大数据的并行存储和计算的平台,是 Apache的一个用java 语言实现开源软件框架,实现了在大量计算机组成的集群中对海量数据进行分布式计算.Hadoop ...

  8. R语言学习笔记:生成序列(Genenrating Sequences)

    R提供了多种生成不同类型序列的方法.如: > x<-1:20 > x [1]  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 1 ...

  9. java编解码技术,json序列化与二进制序列化

    1.何为json序列化与二进制序列化 通常我们在程序中采用的以json为传输,将json转为对象的就是json序列化了.而二进制序列化通常是我们将数据转换为二进制进行传输,然后在进行各类转换操作 2. ...

  10. mysqld -install命令时出现install/remove of the service denied错误的原因和解决办法

    原因:没有使用管理员权限 解决方法:使用管理员权限打开cmd,然后运行mysqld -install,服务安装成功