Rock/Wireless/AP mode manually
Contents
- 1 AP mode(RR acts as wireless router)
- 2 Prepare works
- 3 Compile the driver
- 3.1 Attention please: first,ensure your kernel has been compiled
- 3.2 To select target platform for compilation
- 3.3 Build wifi driver
- 3.4 Configure dhcp server,wifi(user,password),autorun the softAP
- 3.5 3.1 Configure static IP
- 3.6 3.2 Configure the dhcp server
- 3.7 3.3 Make your network faster
- 3.8 3.4 Configure the wifi(user,password):
- 3.9 3.5 Autorun your softAP:
AP mode(RR acts as wireless router)
Below is how to manually configure wifi as AP mode on RR.
Prepare works
1.1 Compile hostapd
wget http://dl.radxa.com/rock/source/RTL8723A_WiFi_linux_v4.1.7_8023_BTCOEX20130528_ver3.3_beta.rar sudo apt-get install unrar unrar x RTL8723A_WiFi_linux_v4.1.7_8023_BTCOEX20130528_ver3.3_beta.rar sudo apt-get install build-essential cd RTL8723A_WiFi_linux_v4.1.7_8023_BTCOEX20130528_ver3.3_beta/ cd wpa_supplicant_hostapd/ tar xzf wpa_supplicant_hostapd-0.8_rtw_r7048.20130424.tar.gz cd wpa_supplicant_hostapd-0.8_rtw_r7048.20130424/hostapd make sudo make install sudo mkdir -p /etc/hostapd
1.2 Install toolchain.
1.3 Download the kernel from the address: root@radxa:/tmp# git clone -b radxa-stable-3.0 https://github.com/radxa/linux-rockchip.git
or download here
http://pan.baidu.com/s/1jfOTo (china)
Compile the driver
Attention please: first,ensure your kernel has been compiled
unrar x RTL8723A_WiFi_linux_v4.1.7_8023_BTCOEX20130528_ver3.3_beta.rar cd RTL8723A_WiFi_linux_v4.1.7_8023_BTCOEX20130528_ver3.3_beta cd driver tar zxvf rtl8723A_WiFi_linux_v4.1.7_8023.20130628_BTCOEX20130528_ver3.3_beta.tar.gz cd rtl8723A_WiFi_linux_v4.1.7_8023.20130628_BTCOEX20130528_ver3.3_beta vim Makefile
To select target platform for compilation
47 CONFIG_PLATFORM_I386_PC = n 48 CONFIG_PTFORM_ANDROID_X86 = n 49 CONFIG_PLATFORM_JB_X86 = n ... ... 66 CONFIG_PLATFORM_ARM_TCC8920_JB42 = n 67 CONFIG_PLATFORM_ARM_RK2818 = y 68 CONFIG_PLATFORM_ARM_URBETTER = n ... ... 603 ARCH := arm #the architecture of the CPU. 604 CROSS_COMPILE := arm-eabi- # the toolchain prefix 605 KSRC := /media/jim/radxa_rock_linux/linux-rockchip # the path of kernel source
Build wifi driver
root@radxa:/tmp/driver/rtl8723A_Wi...3.3_beta# make
root@radxa:~# rm /lib/modules/3.0.36+/kernel/drivers/net/wireless/rtl8723au_lwfinger/8723au.ko
root@radxa:~# cp wlan.ko /lib/modules/3.0.36+/kernel/drivers/net/wireless/rtl8723au_lwfinger
root@radxa:~# reboot
Configure dhcp server,wifi(user,password),autorun the softAP
3.1 Configure static IP
root@radxa:/etc#vim /etc/network/interfaces auto wlan0 iface wlan0 inet static address 192.168.2.1 netmask 255.255.255.0
3.2 Configure the dhcp server
root@radxa:/etc# apt-get install dnsmasq
root@radxa:/etc# vim dnsmasq.conf
interface=wlan0 bind-interfaces except-interface=lo dhcp-range=192.168.2.150,192.168.2.254,12h #configure the range of available ip dhcp-option=3,192.168.2.1 #configure the server
3.3 Make your network faster
root@radxa:/etc# apt-get install haveged
3.4 Configure the wifi(user,password):
root@radxa:/etc# cp /tmp/RTL8723A_WiFi_/wpa_supplicant_hostapd/rtl_hostapd_2G.conf /etc/hostapd/hostapd.conf
root@radxa:/etc# vim /etc/hostapd/hostapd.conf
interface=wlan0 ctrl_interface=/var/run/hostapd ssid="user-name" channel=6 wpa=2 wpa_passphrase="password" #bridge=br0
3.5 Autorun your softAP:
root@radxa:/etc# vim wifs.sh
#!/bin/sh #start the AP service #Start hostapd, and it will automatically be bringed up sudo hostapd -B /etc/hostapd/hostapd.conf #Set ip on wlan0 sudo /sbin/ip addr add 192.168.2.1/24 dev wlan0 #Start dnsmasq sudo /usr/sbin/service dnsmasq start #Start ip_forward sudo echo 1 > /proc/sys/net/ipv4/ip_forward #add iptables rule for NAT sudo /sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE #start haveged sudo /etc/init.d/haveged start
root@radxa# vim /etc/rc.local
/etc/wifs.sh /lib/init/vars.sh /lib/lsb/init-functions
root@radxa# reboot