New script to compile TP-Link TL-WN725N version 2 lwfinger driver in Raspbian

This script overrides the old “Compile and install driver for TP-Link TL-WN725N version 2 in Raspbian“.

I’ve tried it with 3.10.33+ and worked perfectly but it failed for 3.10.24+ (I got the usual “ERROR: could not insert '8188eu': Exec format error“). It would be nice if people could give me their results for different kernel versions.

#!/bin/bash

# Get linux source code, prepare config files and create symlinks
VERSION=`uname -r | awk -F'.' '{print $1"."$2}'`
cd ~
wget https://codeload.github.com/raspberrypi/linux/tar.gz/rpi-${VERSION}.y -O rpi-${VERSION}.y.tar.gz
sudo tar zxf rpi-${VERSION}.y.tar.gz -C /usr/src/
cd /usr/src/linux-rpi-${VERSION}.y/
sudo bash -c "zcat /proc/config.gz > /usr/src/linux-rpi-${VERSION}.y/.config"
# In the next step you may be prompted questions about the configuration
# if your /proc/config.gz does not answer them (new features for example)
sudo make oldconfig
sudo make modules_prepare
sudo wget https://github.com/raspberrypi/firmware/raw/master/extra/Module.symvers
sudo ln -s /usr/src/linux-rpi-${VERSION}.y /lib/modules/`uname -r`/source
sudo ln -s /usr/src/linux-rpi-${VERSION}.y /lib/modules/`uname -r`/build
# Optional
#sudo ln -s /usr/src/linux-rpi-${VERSION}.y /usr/src/linux-`uname -r`
#sudo ln -s /usr/src/linux-rpi-${VERSION}.y /usr/src/linux

# Get driver source, compile, install and load it
cd ~
git clone https://github.com/lwfinger/rtl8188eu.git
cd rtl8188eu
# This wil take around 20 minutes
make all
sudo make install
# After this step you should have those new files installed:
# /lib/modules/`uname -r`/kernel/drivers/net/wireless/8188eu.ko
# /lib/firmware/rtlwifi/rtl8188eufw.bin
sudo modprobe 8188eu

# Remove driver and linux source code to recover some space (around 700MB)
# Leave those lines commented if you want to keep the code for future compilations
#sudo rm /lib/modules/`uname -r`/source
#sudo rm /lib/modules/`uname -r`/build
#sudo rm /usr/src/linux-`uname -r`
#sudo rm /usr/src/linux
#sudo rm -R /usr/src/linux-rpi-${VERSION}.y
#cd ~
#rm rpi-${VERSION}.y.tar.gz
#rm -R rtl8188eu

TP-Link TL-WN725N

Ref: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=71&t=17666&p=179845

You might also like

Compile and install driver for TP-Link TL-WN725N version 2 in Raspbian
UPDATE: Read this post if you have another version of the kernel and want a script to compile the driver...

TP-Link TL-WN725N version 2 in Raspbian 2014-01-07-wheezy-raspbian with kernel 3.10.25+
UPDATE: Read this post if you have another version of the kernel and want use a script to compile the...

TP-Link TL-WN725N version 2 in Raspberry Pi
Version 2 of TP-Link TL-WN725N driver doesn't come by default in Raspbian so it won't work by just plug-ining...

Disable power management for TL-WN725N (8188eu driver) in Raspbian
If your wifi connections switches off after being connected for some time sometimes it may be fixed by...

Leave a comment ?

34 Comments.

  1. Does it work for Kali 1.0.6? (Kernel 3.6.11-cutdown I think)

  2. Works! Thanks!

  3. It doesn’t work on 3.10.25+. ERROR: could not insert ‘8188eu’: Exec format error

    • Thank you!

    • works on 3.10.25+ but with this changes:

      I get the Modules.symvers with this:

      REV=`zcat /usr/share/doc/raspberrypi-bootloader/changelog.Debian.gz | grep ‘* firmware as of’ | head -n 1 | sed -e ‘s/\ \*\ firmware as of \(.*\)$/\1/’`
      wget https://raw.github.com/raspberrypi/firmware/$REV/extra/Module.symvers -O rasp-tmp/Module.symvers

      at the end, no modprobe error, and after reboot:

      pi@raspberrypi ~ $ iwconfig
      wlan0 unassociated Nickname:””
      Mode:Managed Frequency=2.412 GHz Access Point: Not-Associated
      Sensitivity:0/0
      Retry:off RTS thr:off Fragment thr:off
      Power Management:off
      Link Quality=0/100 Signal level=0 dBm Noise level=0 dBm
      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.

  4. Hi, failed on 3.10.33+ :

    ERROR: could not insert ‘8188eu’: Exec format error

  5. It doesn’t work on 3.10.36+

    ERROR: could not insert ‘8188eu’: Exec format error

  6. love you so much!!
    raspbian 3.10.37+ #669

  7. mhm … to easily happy… actually it did the thing (ifconfig showed the wlan0) but i could not connect so I decided to reboot and now no more wlan0 on ifconfig… I deleted all the istances of previous installs of 8188eu.ko but I ask you if you have any idea on how to put things right again…
    thanks fabrizio

    • If it worked once should work again. Try redoing all the steps.

      • actually i do not know if I did it the roght way:

        1- I copied the above and saved to a chmodded 755 abc.sh file on the rpi
        2- I executed it with a $ sudo ./abc.sh
        3- ifconfig -> wlan0 showed
        4- reboot ifconfig -> wlan0 showed no more.

        I thought it was a problem of root permissions so I reinstalled with $./abc.sh but the procedure ended with

        cp -n rtl8188eufw.bin /lib/firmware/rtlwifi/.
        ERROR: could not insert ‘8188eu’: Exec format error

        any idea?
        f

  8. Doesn’t work on 3.10.32+

  9. raspbian 3.10.37+

    end with a ERROR: could not insert ’8188eu’: Exec format error too, never work

  10. I have compiled it for 3.12.20+ and it works like a charm!
    If somebody could tell me where I can upload these files I can upload a zip file for you so you don’t have to compile all the time.

  11. works like a charm with 3.12.21+

  12. ERROR: could not insert ‘8188eu’: Exec format error

    kernel version 3.12.21+

  13. Works great! Version: 3.12.23+

  14. ERROR: could not insert ‘8188eu’: Invalid argument

  15. 3.12.23+

    ERROR: could not insert ‘8188eu’: Invalid argument

  16. Thanks ! It works perfectly for me on a Raspbian 3.13.24+

  17. Doesn’t work on 3.12.22+ Same error

  18. Works for 3.12.28++! Saved my day.

  19. Muchísimas gracias por el script.
    Es lento pero funciona perfectamente en una pi con raspbian y el kernel 3.12.28+
    Al hacer un scan con wifi config te sale todo bien menos la señal que pone 0dBm en todos pero es un detalle sin importancia.
    Un saludo y gracias

  20. After an ‘apt-get upgrade’ with kernel 3.12.28+

    ERROR: could not insert ‘8188eu’: Exec format error

    Any idea to solve it ????

    Tks to all

  21. Yoyanoestoy

    Work fine on 3.12.29+

  22. Linux raspberrypi 3.12.28+ #709 PREEMPT Mon Sep 8 15:28:00 BST 2014 armv6l GNU/Linux

    same Exec format error.

  23. To jest wielkie! W życiu nie kompilowałem sterownika. Podniosełem raspbiana i straciłem wifi a nie ma odpowiedniego sterownika do tej wersji (35+). Dzięki temu skryptowi samo wszystko się zrobiło!
    Wielkie dzięki!

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.