Problems with Realtek RTL8188CUS

The Miniature WiFi module from Adafruit does not work with Ubuntu 13.04 on the BeagleBone Black. Wish I knew that before I purchased it. Would have saved me many hours of work. Strap in, this one is a bit ugly.

814_MED

The instructions are for the ubuntu-13.04-armhf-minfs-3.8.12-bone17.img.xz image. If you use a different image it should still work. Just make sure you have the correct kernel headers installed.

1. Grab the modified driver from here:
wget https://realtek-8188cus-wireless-drivers-3444749-ubuntu-1304.googlecode.com/files/rtl8192cu-tjp-dkms_1.6_all.deb

2. Update the available package information
apt-get update

3. Grab the kernel headers and install
wget http://rcn-ee.net/deb/raring-armhf/v3.8.12-bone17/linux-headers-3.8.12-bone17_1.0raring_armhf.deb
dpkg -i linux-headers-3.8.12-bone17_1.0raring_armhf.deb

5. install the dkms package and all its dependencies
apt-get install dkms

6. Install the rtl8192cu-tjp-dkms_1.6_all.deb package. Its going to fail, dont be concerned. We aren’t done yet!
dpkg -i rtl8192cu-tjp-dkms_1.6_all.deb

7. Fix the missing arch type
cd /usr/src/linux-headers-3.8.12-bone17/arch/
ln -s arm armv7l

8. Fix a problem with the timex.h header
vi /usr/src/linux-headers-3.8.12-bone17/arch/armv7l/include/asm/timex.h

change line 18 from

#include <mach/timex.h>

to

#include </usr/src/linux-headers-3.8.12-bone17/arch/arm/include/asm/timex.h>

9. Run make to build the driver

cd /usr/src/rtl8192cu-tjp-1.6
make

10. Copy the new module in to the kernel modules directory
cp 8192cu.ko /lib/modules/3.8.12-bone17/kernel/drivers/net/wireless/

11. Update the module deps
depmod

12. Blacklist the native drivers.
vi /etc/modprobe.d/blacklist.conf

add this to the end:

# Blacklist native RealTek 8188CUs drivers
blacklist rtl8192cu
blacklist rtl8192c_common
blacklist rtlwifi

13. reboot

Its OK to now remove the driver source under /usr/src/rtl8192cu-tjp-1.6 if you need to free up some disk space.

That’s it. Hopefully all the steps worked for you. If not leave me a message. Enjoy!

46 thoughts on “Problems with Realtek RTL8188CUS

  1. Pingback: How to Enable Crypto Acceleration on the BeagleBone Black | fortune datko

  2. This is why people chose other OSes.

    I swear, I’ve pulled enough of my hair out trying to figure this issue out.

    Wifi should have been a proven tech by now, that includes a common linux driver interface, ESPECIALLY a distro like debian.

    Sweet jesus.

  3. I hear you. I was quite surprised to find this adaptor didn’t work out of the box. Given the history and way devices are developed and supported in Linux I doubt it will ever get much better than it is today. On the bright side, any flavor of Linux is better than Windows 8.

    • I’ll need to load it up to verify… but looking at the patch file it does not appear to be. I’m going to be updating the kernel in my BB image file. If you can wait I’ll use this kernel and patch it to use the working driver.

      • Has anyone verified that the dongle can be made to work on Ubuntu 13.10 yet? I installed “ubuntu-13.10-console-armhf-2013-11-15.tar.xz” from here: http://elinux.org/BeagleBoardUbuntu#Saucy_13.10

        With a fresh install, lshw shows the device as “DISABLED”:

        $ sudo lshw -c network

        *-network:0 DISABLED
        description: Wireless interface
        physical id: 1
        bus info: usb@1:1
        logical name: wlan0
        serial: 00:13:ef:90:0b:b3
        capabilities: ethernet physical wireless
        configuration: broadcast=yes driver=rtl8192cu driverversion=3.8.13-bone30 firmware=N/A link=no multicast=yes wireless=IEEE 802.11bgn
        *-network:1
        description: Ethernet interface
        physical id: 2
        logical name: eth0
        serial: c8:a0:30:b1:86:df
        capabilities: ethernet physical
        configuration: broadcast=yes driver=TI CPSW Driver v1.0 driverversion=1.0 ip=192.168.1.106 link=yes multicast=yes
        *-network:2
        description: Ethernet interface
        physical id: 3
        logical name: usb0
        serial: b6:14:46:e3:dc:ba
        capabilities: ethernet physical
        configuration: broadcast=yes driver=g_ether driverversion=29-May-2008 firmware=musb-hdrc ip=192.168.7.2 link=yes multicast=yes

  4. Great write up! One thing you can suggest too is just to run dpkg -i rt*** again after updating the include.

    -Sean

  5. I’ve spent so much time on this issue, following several red herrings until I stumbled on this blog. This worked beautifully for me. Finally the WiFi seems to work rock solid. I’m just surprised there is no easier way to update the drivers under Ubuntu.

    Thanks! You’re the man!

  6. Really useful write-up and it allowed me to at least get a driver to load and something out of the dongle…..BUT….there appears to be weird timing issues if you are using this as an AP and also serving DHCP…Its like the driver takes so long to load and get the interface ready that the DHCP server comes along, sees the wlan0 interface either as not yet up or indeterminate, and barfs…so you get the situation where the client PCs can associate with the AP but not get an IP address. It seems to be very flakey, sometimes working and sometimes not…I tried seting delays so that DHCP started later, but its more ccomplex than that and eventually I just dumped this chipset in favour of the 5370.

    • I’m not surprised. My experience with the Realtek Linux drivers has not been positive. They are difficult to get working and can be very flaky. The only reason I spent the time to get this dongle working was because I didnt know this before I purchased two of them. Given what I know now I would have returned them and gotten ones with an Atheros chipset.

  7. Hi, Im getting this error at step 9, any ideas??

    root@ubuntu-arm:/usr/src/rtl8192cu-tjp-1.6# make all
    make ARCH=armv7l CROSS_COMPILE= -C /lib/modules/3.8.13/build M=/usr/src/rtl8192cu-tjp-1.6 modules
    make: *** /lib/modules/3.8.13/build: No such file or directory. Stop.
    make: *** [modules] Error 2

    • Looks like the header files in not where the make file is expecting them. Does /lib/modules/3.8.13/build exist? If not just creating a symlink from /lib/modules/3.8.13/build to the kernel source is installed should work.

      • Hi thanks for your reply, hey question by the kernel source you mean were the kernel headers are install?

        Also /lib/modules/3.8.13/build does not exists, I have this instead /lib/modules/3.8.13-bone30.

        and this is the content:

        ubuntu@ubuntu-armhf:/lib/modules/3.8.13-bone30$ ls -l
        total 1348
        drwxr-xr-x 9 root root 4096 Nov 14 11:24 kernel
        -rw-r–r– 1 root root 342079 Nov 23 18:33 modules.alias
        -rw-r–r– 1 root root 360050 Nov 23 18:33 modules.alias.bin
        -rw-r–r– 1 root root 12018 Nov 14 11:24 modules.builtin
        -rw-r–r– 1 root root 14571 Nov 23 18:33 modules.builtin.bin
        -rw-r–r– 1 root root 69 Nov 23 18:33 modules.ccwmap
        -rw-r–r– 1 root root 92446 Nov 23 18:33 modules.dep
        -rw-r–r– 1 root root 148906 Nov 23 18:33 modules.dep.bin
        -rw-r–r– 1 root root 163 Nov 23 18:33 modules.devname
        -rw-r–r– 1 root root 73 Nov 23 18:33 modules.ieee1394map
        -rw-r–r– 1 root root 141 Nov 23 18:33 modules.inputmap
        -rw-r–r– 1 root root 81 Nov 23 18:33 modules.isapnpmap
        -rw-r–r– 1 root root 1664 Nov 23 18:33 modules.ofmap
        -rw-r–r– 1 root root 51786 Nov 14 11:24 modules.order
        -rw-r–r– 1 root root 99 Nov 23 18:33 modules.pcimap
        -rw-r–r– 1 root root 43 Nov 23 18:33 modules.seriomap
        -rw-r–r– 1 root root 131 Nov 23 18:33 modules.softdep
        -rw-r–r– 1 root root 111956 Nov 23 18:33 modules.symbols
        -rw-r–r– 1 root root 142843 Nov 23 18:33 modules.symbols.bin
        -rw-r–r– 1 root root 46889 Nov 23 18:33 modules.usbmap

  8. Thanks a million for this – great post. I would have spent a long time finding the timex.h fix. If it helps anyone, I did this compile on the BBB, with 3.8.13-bone30. Working like a charm so far.

    Cheers,
    Con

  9. Hi Darshan,

    Thanks for the great tutorial! My wifi is now rock solid on the BBB with the WiFi dongle.

    For anyone else reading, I’m also using the 3.8.13-bone30 kernel!

    Thanks again,

    Jonathan

  10. Dear Darshan,

    Thanks for sharing this interesting tutorial.
    I went through the different steps on a 3.18.13-bon28 kernel with no problems.
    However, the wlan interface failed to go up. Any clues?

    Thanks again 🙂

  11. Few questions…
    – Can you see the wlan0 interface at all?
    – What errors are you seeing when you try to bring up the interface?
    – Are you powering your BBB with a power supply or just over USB?

    • Hi Darshan,

      Thanks for your quick reply.
      Below are my answers:
      1)No, unfortunately I am not able to see the wlan0 interface.
      2)When trying to brin wlan0 up, I got the following error:

      3)Finally, I am powering the BBB through the power supply.

      Any clues?
      Thanks for your help!

  12. 2)When trying to brin wlan0 up, I got the following error:

    wpa _ supplicant : / sbin / wpa _ supplicant daemon failed to start
    run-parts : / etc /network/if-pre-up.d/wpasupplicant exited with return code 1
    For info, please visit https://www.isc.org/software/dhcp/

    Cannot find device “wlan0”
    Error getting hardware address for “wlan0”: No such device
    Failed to bring up wlan0.

  13. Ok, looks the kernel module is probably not loaded. Try this:

    modprobe 8192cu

    If there are no errors after you run this command use dmesg to make sure there are no errors being written to the system log.

    Assuming you do get an error… My bet is the module is either broken or not in the right place.

    Make sure to substitute “linux-headers-3.8.12-bone17” with the correct path for your kernel. I just tried building against 3.8.13-bone41 and it worked so it should be fine with your kernel.

    If the kernel module is not found:
    cd /usr/src/rtl8192cu-tjp-1.6
    insmod 8192cu.ko

    If this works then you just need to re-do steps 10 and 11.

    Hope this helps. If not let me know.

    Thanks!

    – Darshan

    • Thanks Drashan. Using modprobe loads the module as I can see using lsmod:

      Module Size Used by
      8192cu 535620 0

      But again , I am not able to bring wlan0 up.

      Using dmesg shows nothing suspicious. However, the last few lines below appear after the wifi dongle is plugged in:

      82.031449] rtw driver version=v3.4.4_4749.20121105
      [ 82.031505] Build at: Apr 18 2014 07:16:57
      [ 82.036092] usbcore: registered new interface driver rtl8192cu

  14. OK, this is good… It appears the module is working. I found that if you dont boot the BBB with the device plugged it the module will load but the interface will not show up. Reboot and run lsmod. You should see the 8192cu module has been automatically loaded.

    Next run “ifconfig -a” and check if there are any wlan intefaces. Its possible the interface is not on wlan0.

    • Well it seems the module is not loading by-itself..Rebooting with the device plugged-in and then lsmod returns the following:
      ubuntu@arm:~$ lsmod
      Module Size Used by
      g_multi 56821 0
      libcomposite 17153 1 g_multi

      With ifconfig -a and iwconfig no wireless extensions is there..
      Seems bizarre 🙁

  15. Humm, can you verify the wireless module is working and contains the chipset you think it does? The lsusb command should show this…

    # lsusb
    Bus 001 Device 002: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

  16. mmmm seems different!!
    ubuntu@arm:~$ lsusb
    Bus 001 Device 002: ID 148f:7601 Ralink Technology, Corp.
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

  17. Yes, i was disguised by the dongle pic on ur blog..It is so close to mine except it does not have the texture in it..It seems these guys are using the same packaging company!!! Thanks for the help Darshan 🙂

  18. Hello I’m using the BBB & ausu N10-nano usb wifi Adapter.
    And my kernel is beaglebone 3.8.13-bone43 with Debain.
    I followed your steps and success build the module 8192cu.
    But i can’t see any about wlan in dmesg, it only show that

    [ 1099.558120] rtw driver version=v3.4.4_4749.20121105
    [ 1099.558166] Build at: Mar 27 2014 17:40:59
    [ 1099.558637] usbcore: registered new interface driver rtl8192cu

    seems the same problem as Alix’s,could somebody give me some suggestions? Thanks a lots!

  19. Seems all the header files have gone… anyone have a copy? Also, how can I get headers for :
    Linux beaglebone 3.8.13-bone47 #1 SMP Fri Apr 11 01:36:09 UTC 2014 armv7l GNU/Linux ???

  20. you’re my hero man! thank you 😀

    Worked perfectly for Debian 3.8.13-bone47

    I had the rtl8188 wifi card running smooth on my RPi, so I figured I’d plug it into the BeagleBone and it should work the same. I mean, both distors are Debian, right? Um, no. If Raspbian has it figured out, why not BeagleBone?

  21. Good stuff! I’m using the Ubuntu 14.04 distro on my BBB, which uses the 3.14.26 kernel. The provided driver worked for a Edimax EW-7811Un, but would drop after a short period of time randomly.

    Followed your tutorial (perfect level of content and brevity), but there were some type cast errors during the compile of the new driver, so I went a lookin’. Found this continuation on Timothy Phillip’s work (the googlecode site) that was able to produce an installable module: https://github.com/pvaret/rtl8192cu-fixes

    So far an ssh session has stayed up for 15 minutes, so it’s either the driver or could be the power management troubleshooting he mentions.

    Thank you for taking the time to document the steps for the rest of the BBB community!

  22. Pingback: BeagleBone Black with Edimax USB Wi-Fi on Ubuntu 14.04 | Gavin Adams Information Blog

  23. I have trouble with the linux headers. It says it can’t find the build file. But as you can see here: http://imgur.com/LJOnqxN
    the file is there and the path linking to it is right.
    So this is constantly failing:
    cd /usr/src/rtl8192cu-tjp-1.6
    make

Comments are closed.