[[Raspberry Pi]]~


* Using BUFFALO WI-U2-433DM on Raspberry Pi 2 (self-compiling) [#pb2bb54b]
This article explains how to connect [[WI-U2-433DM (Air Station 11ac/n/a/g/b 433/150Mbps USB 2.0 support Wireless LAN dongle):http://buffalo.jp/product/wireless-lan/client/wi-u2-433dm/]] with Raspberry Pi 2 and how to use it on Raspbian.~
To flow the directions described in [[Raspberry Pi 2 kernel self-compile]], complete kernel compile and boot from the new kernel, and build the driver for WI-U2-433DM.~

** Obtaining source [#ned691d5]
Linux drivers for Realtek 8812au, which is used at WI-U2-433DM, is released from Realtek, posted at [[github:https://github.com/abperiasamy/rtl8812AU_8821AU_linux]] and maintained by volunteers. Please use a driver, which supports Raspberry Pi and is arranged with a newer version of kernel.~
To do git clone, please obtain the source code of the driver.~
 pi@raspberrypi ~ $ cd src/
 pi@raspberrypi ~/src $ git clone https://github.com/abperiasamy/rtl8812AU_8821AU_linux.git
 Cloning into 'rtl8812AU_8821AU_linux'...
 remote: Counting objects: 797, done.
 remote: Total 797 (delta 0), reused 0 (delta 0), pack-reused 797
 Receiving objects: 100% (797/797), 1.98 MiB | 846.00 KiB/s, done.
 Resolving deltas: 100% (430/430), done.
 Checking connectivity... done.

**Adjusting Makefile [#e23dc257]
Change the build option on Makefile for Raspberry Pi.~
 pi@raspberrypi ~/src $ cd rtl8812AU_8821AU_linux/
 beat@raspberrypi ~/src/rtl8812AU_8821AU_linux $ vim Makefile
At Line 52, change CONFIG_PLATFORM_I386_PC = y to CONFIG_PLATFORM_I386_PC = n~

**Build [#u8ee0a08]
Please execute Make.~
 pi@raspberrypi ~/src/rtl8812AU_8821AU_linux $ time make 2>&1 | tee make.log
 make ARCH=arm CROSS_COMPILE= -C /lib/modules/4.1.10-v7+/build M=/home/pi/src/rtl8812AU_8821AU_linux  modules
 make[1]: Entering directory '/usr/src/linux'
   CC [M]  /home/pi/src/rtl8812AU_8821AU_linux/core/rtw_cmd.o
   CC [M]  /home/pi/src/rtl8812AU_8821AU_linux/core/rtw_security.o
   CC [M]  /home/pi/src/rtl8812AU_8821AU_linux/core/rtw_debug.o
   CC [M]  /home/pi/src/rtl8812AU_8821AU_linux/core/rtw_io.o
   CC [M]  /home/pi/src/rtl8812AU_8821AU_linux/core/rtw_ioctl_query.o
   CC [M]  /home/pi/src/rtl8812AU_8821AU_linux/core/rtw_ioctl_set.o
   CC [M]  /home/pi/src/rtl8812AU_8821AU_linux/core/rtw_ieee80211.o
  ~~ Skipping ~~
   CC [M]  /home/pi/src/rtl8812AU_8821AU_linux/hal/OUTSRC/rtl8821a/HalHWImg8821A_TestChip_BB.o
   CC [M]  /home/pi/src/rtl8812AU_8821AU_linux/hal/OUTSRC/rtl8821a/HalHWImg8821A_TestChip_RF.o
   CC [M]  /home/pi/src/rtl8812AU_8821AU_linux/hal/OUTSRC/rtl8821a/HalPhyRf_8821A.o
   CC [M]  /home/pi/src/rtl8812AU_8821AU_linux/hal/OUTSRC/rtl8821a/odm_RegConfig8821A.o
   CC [M]  /home/pi/src/rtl8812AU_8821AU_linux/core/rtw_mp.o
   CC [M]  /home/pi/src/rtl8812AU_8821AU_linux/core/rtw_mp_ioctl.o
   LD [M]  /home/pi/src/rtl8812AU_8821AU_linux/8812au.o
   Building modules, stage 2.
   MODPOST 1 modules
   CC      /home/pi/src/rtl8812AU_8821AU_linux/8812au.mod.o
   LD [M]  /home/pi/src/rtl8812AU_8821AU_linux/8812au.ko
 make[1]: Leaving directory '/usr/src/linux'
 real    5m18.419s
 user    4m55.650s
 sys     0m16.600s
It takes 5 minutes approximately.~
The size of 8812au.ko is 1.3M. (The size is less than one tenth of mt7650u_sta.ko.)~
 pi@raspberrypi ~/src/rtl8812AU_8821AU_linux $ ls -alh 8812au.ko
 -rw-r--r-- 1 pi pi 1.3M Nov  5 21:03 8812au.ko

**Install [#rbd65dad]
Please apply the command line of  make install to install the kernel module.~
 pi@raspberrypi ~/src/rtl8812AU_8821AU_linux $ sudo make install
 install -p -m 644 8812au.ko  /lib/modules/4.1.10-v7+/kernel/drivers/net/wireless/
 /sbin/depmod -a 4.1.10-v7+

**Confirmation of load [#fb6de424]
The kernel module has been installed. As WI-U2-433DM is inserted to Raspberry Pi 2, 8812au.ko is loaded and the network interface, wlan*, is created.~
 root@raspberrypi:~# lsmod
 Module                  Size  Used by
 8812au                960539  0
 cfg80211              410393  1 8812au
 rfkill                 15913  1 cfg80211
 bcm2835_gpiomem         2860  0
 uio_pdrv_genirq         2924  0
 uio                     7784  1 uio_pdrv_genirq
 i2c_dev                 5610  0
 snd_bcm2835            19808  3
 snd_pcm                73405  1 snd_bcm2835
 snd_timer              17657  1 snd_pcm
 snd                    50337  9 snd_bcm2835,snd_timer,snd_pcm
 fuse                   79934  3
 ipv6                  336324  32

 oot@raspberrypi:~# iwconfig
 wlan0     unassociated  Nickname:"<WIFI@REALTEK>"
           Mode:Auto  Frequency=2.412 GHz  Access Point: Not-Associated
           Retry:off   RTS thr:off   Fragment thr:off
           Encryption key:off
           Power Management:off
           Link Quality:0  Signal level:0  Noise level:0
           Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
           Tx excessive retries:0  Invalid misc:0   Missed beacon:0

 lo        no wireless extensions.
 eth0      no wireless extensions.
** Configuration of network [#la8b560f]
At the configuration items of wlan0 in /etc/network/interfaces, please type in the SSID and passphrase of the access point that you like to access.~
 # vi /etc/network/interfaces
  (`please modify the lines below)
 allow-hotplug wlan0
 auto wlan0
 iface wlan0 inet manual
 wpa-ssid "your-ssid"
 wpa-psk "your-passwd"

** Rebooting [#gd5a0b43]
As the configuration is completed and the system is rebooted, IP address can be obtained. The details are shown below.~
 root@raspberrypi:~# ifconfig
 eth0      Link encap:Ethernet  HWaddr b8:27:eb:c2:87:00
           inet addr:  Bcast:  Mask:
           inet6 addr: fe80::ba27:ebff:fec2:8700/64 Scope:Link
           RX packets:3887 errors:0 dropped:639 overruns:0 frame:0
           TX packets:579 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:1000
           RX bytes:295688 (288.7 KiB)  TX bytes:98761 (96.4 KiB)
 lo        Link encap:Local Loopback
           inet addr:  Mask:
           inet6 addr: ::1/128 Scope:Host
           UP LOOPBACK RUNNING  MTU:65536  Metric:1
           RX packets:2876 errors:0 dropped:0 overruns:0 frame:0
           TX packets:2876 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:0
           RX bytes:431834 (421.7 KiB)  TX bytes:431834 (421.7 KiB)
 wlan0     Link encap:Ethernet  HWaddr cc:e1:d5:f7:14:e6
           inet addr:  Bcast:  Mask:
           inet6 addr: fe80::b80b:a0f:2479:5b10/64 Scope:Link
           RX packets:41 errors:0 dropped:6 overruns:0 frame:0
           TX packets:25 errors:0 dropped:1 overruns:0 carrier:0
           collisions:0 txqueuelen:1000
           RX bytes:5772 (5.6 KiB)  TX bytes:4430 (4.3 KiB)

* Revision History [#xb736499]
- 2016-02-16 This article is initially released.

Front page   Edit Diff Backup Upload Copy Rename Reload   New List of pages Search Recent changes   RSS of recent changes