Thursday, October 3, 2013

Compiling TP-LINK WN725N V2 driver in Raspbmc with 3.10.13 kernel

Assalamualaikum,  Hi.
DISCLAIMER: I didn't take any credit for this post. This post is direct copy-pasta from Stm lab's user Rodi post

I just re-share for visibility and record. But maybe will re-edit with my wording later on.

Edit: Support for 8188EU chipsets already added into the Raspbmc kernel after latest hotfix update ~ http://www.raspbmc.com/2013/10/raspbmc-hotfix/

TLDR;
Grab the kernel module mirrored here, put it in wireless modules folder, depmod -a, modprobe 8188eu. Full step-by-step guide is in my previous post.


Long version:
Follow these steps to compile the 8188eu driver by yourself

1. Enable "install & update kernel headers" in the raspbmc settings menu => system configuration (this will take a while, you wont see the progress)
⇒ needed for grabbing Module.symvers

2. Install GCC, MAKE and GIT
pi@raspbmc:~$ sudo apt-get -y install gcc make git

3. Get linux source code
=> Please verify that you are at ~ which is equal to /home/pi !

pi@raspbmc:~$ wget --no-check-certificate https://github.com/raspberrypi/linux/archive/rpi-3.10.y.tar.gz

pi@raspbmc:~$ tar -xzf rpi-3.10.y.tar.gz
pi@raspbmc:~$ mv linux-rpi-3.10.y rpi-linux

4. Get rtl8188eu source code
pi@raspbmc:~$ git clone git://github.com/lwfinger/rtl8188eu.git

5. Clean the kernel source
pi@raspbmc:~$ cd rpi-linux
pi@raspbmc:~/rpi-linux$ make mrproper

6. Setup .config and clear the CONFIG_CROSS_COMPILE assignment in .config
pi@raspbmc:~/rpi-linux$ zcat /proc/config.gz > .config
pi@raspbmc:~/rpi-linux$ vi .config

6.1. Now clear the CONFIG_CROSS_COMPILE assignment ⇒ CONFIG_CROSS_COMPILE=""
6.2. Type ":x" and then type Enter to save

7. Prepare the modules
pi@raspbmc:~/rpi-linux$ make modules_prepare

8. Copy Module.symvers from kernel headers folder to linux source folder
pi@raspbmc:~/rpi-linux$ cp /usr/src/linux-headers-3.10.13/Module.symvers .

9. Prepare the installation of the rtl8188eu driver by defining folder links
pi@raspbmc:~/rpi-linux$ ln -s /home/pi/rpi-linux /usr/src/linux
pi@raspbmc:~/rpi-linux$ ln -s /usr/src/linux /lib/modules/3.10.13/source
pi@raspbmc:~/rpi-linux$ ln -s /usr/src/linux /lib/modules/3.10.13/build

10. make and install the rtl8188eu
pi@raspbmc:~/rpi-linux$ cd ../rtl8188eu
pi@raspbmc:~/rtl8188eu$ make && make install

11. Optional: Install the driver if make install didn’t work due to permission
pi@raspbmc:~/rtl8188eu$ sudo cp 8188eu.ko /lib/modules/`uname -r`/kernel/drivers/net/wireless/
pi@raspbmc:~/rtl8188eu$ sudo depmod -a
pi@raspbmc:~/rtl8188eu$ sudo modprobe 8188eu

12. now ifconfig should show wlan0


References:
Tutorial: Installing TP-LINK WN725N V2 driver (Kernel 3.10.13/September Update)
http://forum.stmlabs.com/showthread.php?tid=10805&pid=82459#pid82459

9 comments:

  1. I think a step between 7 and 8 is missing:

    make modules

    (/usr/src/linux-headers-3.10.xx/Module.symvers was missing)

    ReplyDelete
    Replies
    1. Did you perform step 1?
      3.10.xx? not 3.10.13?

      Delete
  2. I don;t have /usr/src/linux-headers-3.10.13/Module.symvers or /usr/src/linux-headers-3.10.18/Module.symvers (I'm running 3.10.18), what should I do now?

    ReplyDelete
    Replies
    1. Did you perform step 1? What is the contents inside your /usr/src?
      By the way, as I mentioned in edit above, TP-LINK WN725N V2 should already supported in latest release. Is there any reason for you to keep using this version?

      Delete
  3. Hi! I'm a noob, learning little by little. Now I know how to enter command lines, but, at step 1, what do you mean by "unzip it on your raspberry pi" ? Thank you!

    ReplyDelete
    Replies
    1. Sorry for the late reply,
      those steps are from the forum, but I had it removed since I didn't provide the zipped file here. You can just directly download the unzipped file from my dropbox account if you want to.

      To answer your question, in the original post, the 8188eu.ko file is shared as a zipped file (8188eu.ko.zip). So in order to use that file (8188eu.ko), you need to extract the zipped file by unzip command:
      $unzip 8188eu.ko.zip

      If you don't have the unzip program installed, you can install it by:
      $sudo apt-get install unzip

      Delete
  4. your symlinks are wrong
    pi@raspbmc:~/rpi-linux$ ln -s /usr/src/rpi-linux /lib/modules/3.10.13/source
    pi@raspbmc:~/rpi-linux$ ln -s /usr/src/rpi-linux /lib/modules/3.10.13/build

    should have been
    pi@raspbmc:~/rpi-linux$ ln -s /home/pi/rpi-linux /lib/modules/3.10.13/source
    pi@raspbmc:~/rpi-linux$ ln -s /home/pi/rpi-linux /lib/modules/3.10.13/build

    ReplyDelete
    Replies
    1. thanks for pointing that out.
      haven't spend my time to review the steps. (which is blatantly copy pasted from the source)
      since most of people still referring to this guide, I'll look into it and rewrite the working steps by today.

      Delete
  5. Although Raspbmc now supports this wifi dongle, mine was dropping arounf 50% of the pckets, so I've followed this guide and installed it on RaspBMC with 3.10.24 kernel. I was able to compile it and install it without problems, but this one was really slow, getting ping times between 3000 and 25000 ms (yes I said 3000 to 25000 ms !!!!) so nor the one included in Raspbmc nor this one works for me. Any ideas or new sources to try?

    ReplyDelete