极客工坊

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 19443|回复: 0

开启pcDuino V2的wifi AP功能

[复制链接]
发表于 2013-12-25 08:53:11 | 显示全部楼层 |阅读模式
pcDuino V2已经自带wifi模块了,但是这个模块的型号是rtl8188cus,跟之前的rt5370sta型号不一样,查了一下,这个wifi也是带AP功能的。rtl8188在树莓派上很多人都玩过AP,可是同样的方法在pcDuino上面就会出现问题,本教程将手把手教你开启wifi的AP的功能。
1,  下载工具软件

sudo apt-get update

sudo apt-get install git vim

sudo apt-get install isc-dhcp-server
2,  下载官网驱动源码

wget ftp://WebUser[email protected]/cn/wlan/RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911.zip

#http://www.realtek.com.tw/downlo ... ngid=1&
3,  下载编译驱动需要内核头文件

sudo apt-get install pcduino-linux-headers-3.4.29+      

cd  /usr/src/ linux-headers-3.4.29+/arch

cp  arm  armv7l  -rf
如果你用的是pcDuino lite wifi,这行这个之后需要重启,然后在u-boot的3秒位置停下,输入,要不然启动不起来

setenv loglevel 8 ramfs

boot

mount  /deV/nandd /mnt

cd  /mn lib/modules/3.4.29+/kernel/drivers

rm gpu –rf

reboot
4,  删除原有的8188cu.ko

rm  /lib/modules/3.4.29+/kernel/drivers/net/wireless/rtl8192cu/8192cu.ko

rm  /lib/modules/3.4.29+/kernel/drivers/net/wireless/8192cu.ko
5,  编译安装驱动

unzip  RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911.zip

cd   RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911

chmod +x install.sh

sudo ./install.sh
6,安装结束

ubuntu@ubuntu:~/RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911$ lsmod

Module                  Size  Used by

8192cu                624916  0

sw_interrupt            2424  0

gpio                    4509  0

pwm                     5050  0

adc                     1671  0

hardwarelib             1551  4 sw_interrupt,gpio,pwm,adc

rt5370sta             616973  0

驱动里面自带的hostapd是没有做成系统服务的,这里感谢开源,有个玩家做成了系统服务。

git clone
https://github.com/jenssegers/RTL8188-hostapd

cd RTL8188-hostapd/hostapd

sudo make install
安装8188的hostapd

cd  RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911/wpa_supplicant_hostapd

tar xvf wpa_supplicant_hostapd-0.8_rtw_r7475.20130812.tar.gz

cd  hostapd

sudo make install
配置hostapd

vim  /etc/hostapd/hostapd.conf

# Basic configuration



interface=wlan3  #根据你自己的接点

ssid=wifi

channel=1

#bridge=br0



# WPA and WPA2 configuration



macaddr_acl=0

auth_algs=1

ignore_broadcast_ssid=0

wpa=3

wpa_passphrase=12345678

wpa_key_mgmt=WPA-PSK

wpa_pairwise=TKIP

rsn_pairwise=CCMP



# Hardware configuration



driver=rtl871xdrv

ieee80211n=1

hw_mode=g

device_name=RTL8192CU

manufacturer=Realtek



service hostapd restart
设置wifi热点名字为wifi ,密码为12345678

你现在清除一下你设置的wifi的密码,就可以通过你的手机搜索到wifi这个热点,但是还连不上

要配置一下网络

vim /etc/network/interfaces

auto wlan3

iface wlan3 inet static

        address 192.168.100.1

        netmask 255.255.255.0              

service networking restart
配置dhcp

vim /etc/dhcp/dhcpd.conf #在最后面加

subnet 192.168.100.0 netmask 255.255.255.0 {

  range 192.168.100.10 192.168.100.100;

  option routers 192.168.100.1;

  option domain-name-servers 8.8.8.8;

}

service isc-dhcp-server restart

设置开机启动
hostapd启动后dhcpd才能启动,dhcpd关闭hostapd才关闭

update-rc.d hostapd defaults 80 20

update-rc.d isc-dhcp-server defaults 90 10
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 需要先绑定手机号

Archiver|联系我们|极客工坊

GMT+8, 2024-3-29 04:26 , Processed in 0.037848 second(s), 17 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表