• Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
HomepcDuinokernel and ubootEnable AP mode for pcDuino2 (Green WiFi Module)
Previous Next

Enable AP mode for pcDuino2 (Green WiFi Module)

Posted by: admin , May 24, 2014

The new batch of pcDuino v2 upgraded the Wifi module to be 8188EUS (Green color) from the previous 8188EUS (Black color). In this post, we show the steps to turn on the AP mode for pcDuino2.

1. Install linux-headers

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


2. Change the wlan node rule

In our previous post regarding to WLAN, the numbering of wlan* changes randomly. This is really annoying, and give lots of headache. In this step, we explain the method to change the numbering rule of wlan node.

$sudo vi  /etc/udev/rules.d/70-persistent-net.rules

Replace the mac address with asterisk ‘*’, and remove all others. Reboot pcDuino, and we found that there is only one possibility: wlan0.

ubuntu@ubuntu:~/RTL8188-hostapd/hostapd$ ifconfig
eth0      Link encap:Ethernet  HWaddr 86:8e:9f:d6:5e:48 
          inet addr:192.168.1.123  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::848e:9fff:fed6:5e48/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5237 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6836 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2958785 (2.9 MB)  TX bytes:5686710 (5.6 MB)
          Interrupt:55 Base address:0xb000
 
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:29 errors:0 dropped:0 overruns:0 frame:0
          TX packets:29 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2738 (2.7 KB)  TX bytes:2738 (2.7 KB)
 
rename6   Link encap:Ethernet  HWaddr ce:d2:9b:2f:e4:d1  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:3 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
 
usb0      Link encap:Ethernet  HWaddr 00:11:22:33:44:55 
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
 
wlan0     Link encap:Ethernet  HWaddr cc:d2:9b:2f:e4:d1  
          inet6 addr: fe80::ced2:9bff:fe2f:e4d1/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:10 overruns:0 frame:0
          TX packets:0 errors:0 dropped:1 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:18649 (18.6 KB)  TX bytes:48918 (48.9 KB)

 

3. Download the source files, and rebuild the driver

The driver that comes with pcDuino2 has issue when it comes to AP mode. So we need to delete the original driver.

$sudo rm /lib/modules/3.4.29+/kernel/drivers/net/wireless/rtl8188eu/8188eu.ko

Download the source files of the driver:

$git clone https://github.com/lwfinger/rtl8188eu

$cd rtl8188eu/

Modify Makefile:

$vim Makefile

Add the red part:

Build by typing: $sudo make

Install the driver by typing:  $sudo make install

4. In order to use wlan0 as gateway, set wlan0 as static IP.

$sudo vim /etc/network/interfaces

DHCPD is installed by default in the image released by 20131126. Also, the IP 192.168.100.1 is configured to be the gateway. Reboot pcDuino after we set the static IP.

5. Build and install hostapd

Download source files:

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

$cd RTL8188-hostapd/hostapd

Build and install:

$sudo make install

Modify the configuration file:

$sudo vim /etc/hostapd/hostapd.conf

In the above case, the name of the AP is carwifi, and the password is 1234567.

7. Configure hostapd to be automatically on after power cycle

$update-rc.d hostapd defaults 80 20

 

Tags: kernel and uboot, Linux Applications

Share!
Tweet

admin

About the author

Leave a Reply Cancel reply

You must be logged in to post a comment.

Category

  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors