How to install a rtl8192cu on the Beaglebone Black (BBB) running Angstrom

opkg update
opkg upgrade
opkg install kernel-dev
opkg install kernel-headers

You may need to reboot.

cd /usr/src/kernel
make scripts
ln -s /usr/src/kernel /lib/modules/$(uname -r)/build
cd ~
git clone git://github.com/cmicali/rtl8192cu_beaglebone.git
cd rtl8192cu_beaglebone
make CROSS_COMPILE=""

Then follow 2.2 from bonenotes.tumblr.com:

Install the driver

mv 8192cu.ko /lib/modules/$(uname -r)
depmod -a
cd /etc/modules-load.d
echo "8192cu" > rtl8192cu-vendor.conf

Blacklist the old rtlwifi drivers

cd /etc/modprobe.d
echo "install rtl8192cu /bin/false" >wifi_blacklist.conf
echo "install rtl8192c_common /bin/false" >>wifi_blacklist.conf
echo "install rtlwifi /bin/false" >>wifi_blacklist.conf

Edit /var/lib/connman/settings and enable WIFI

[global]
OfflineMode=false
 
[Wired]
Enable=true
Tethering=false
 
[WiFi]
Enable=true
Tethering=false

Encrypt your passphrase

wpa_passphrase YourSSID YourPassphrase

Edit /var/lib/connman/wifi.config and set it to the following

[service_home]
Type=wifi
Name=YourSSID
Passphrase=YourEncryptedPassphrase

Plug in your WIFI adaptor and reboot

shutdown -r 0

Sources & Thanks:
Big Thanks to cmicali: bonenotes.tumblr.com/
Thanks to Nomel: nomel.org/post/30357133735/beaglebone-tutorial-how-to-compile-kernel-modules-and

35 Comments so far »

  1. STB said

    June 14 2013 @ 5:31 AM

    If anyone gets the error:
    "/bin/sh: scripts/basic/fixdep: No such file or directory"
    when running
    # make CROSS_COMPILE=""

    it means that you haven't compiled the kernel source scripts yet.

    If you are not root then switch to root:
    # su

    and compile the scripts:
    # cd /usr/src/kernel
    # make scripts

    If you have never compiled kernel modules before, I would suggest doing this step right after installing the kernel-dev and kernel-header packages. Perhaps reboot first.

    Thanks to: http://elene.dahners.com/blog/2012/10/22/compiling-a-kernel-module-for-beaglebone/

  2. Don Miller said

    June 21 2013 @ 6:42 PM

    In some cases, after the first "reboot" in your procedure, the user will need to:

    cd /usr/src/kernel
    make scripts

    I tried your flow on a recently re-flashed card, and your MAKE step bombed out because some scripts had not been prepared ahead of time. You probably did not run into this because your card must not have been as "virgin" at the time as mine was...

  3. Jim Chase said

    June 23 2013 @ 2:40 PM

    Where you say "You may need to reboot." I would replace that with:

    shutdown -r now*

    (Technically, you only have to do that if your kernel is upgraded. But it doesn't hurt anything. This process on most new BBB will upgrade the kernel.)

    You need to add a step after: ln -s /usr/src/kernel /lib/modules/$(uname -r)/build

    cd /usr/src/kernel
    make scripts

    My BBB was brand new, and I had never built anything on it before.

    I am still having an issue connecting, but it may be I'm too far from my router with this tiny antenna. Will check with laptop closer to router.

    Current setup:

    BBB with Angstrom Linux 3.8.13-r23a.22
    Apple TimeCapsule router (version 1), WPA/WPA2
    Disconnected Ethernet cable
    Connected USB network for debugging

    ifconfig -a output:

    root@beaglebone:~# ifconfig -a
    eth0 Link encap:Ethernet HWaddr C8:A0:30:BA:7B:6A
    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)
    Interrupt:56

    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:65536 Metric:1
    RX packets:84 errors:0 dropped:0 overruns:0 frame:0
    TX packets:84 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:5800 (5.6 KiB) TX bytes:5800 (5.6 KiB)

    usb0 Link encap:Ethernet HWaddr 7A:05:50:E7:7A:02
    inet addr:192.168.7.2 Bcast:192.168.7.3 Mask:255.255.255.252
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:424 errors:0 dropped:0 overruns:0 frame:0
    TX packets:114 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:47979 (46.8 KiB) TX bytes:20200 (19.7 KiB)

    wlan0 Link encap:Ethernet HWaddr 00:13:EF:10:15:51
    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)

    __________

    After a long period of time (don't know exact time, went to lunch :^)
    ifconfig -a shows this for wlan0:

    wlan0 Link encap:Ethernet HWaddr 00:13:EF:10:15:51
    inet addr:169.254.232.207 Bcast:169.254.255.255 Mask:255.255.0.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:3 errors:0 dropped:1581 overruns:0 frame:0
    TX packets:39 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:363272 (354.7 KiB) TX bytes:26134 (25.5 KiB)

    Seems it may just not see the network.

  4. Jim Chase said

    June 23 2013 @ 3:04 PM

    I was right, it just didn't see the network. Range on the small antenna is not very good. It doesn't help that the Realtek radio device isn't that good either. I'm getting about ~25ft range (not line of site) through a couple of walls.

    However, when within 10 feet, the connection was still a bit laggy.

    Suggestions on tools for WLAN performance measurement?

  5. BM said

    June 26 2013 @ 8:42 PM

    After running 'make CROSS_COMPILE=""' I get '/bin/sh: scripts/mod/modpost: No such file or directory'

    Any ideas how to fix this?

  6. Andrew said

    July 20 2013 @ 2:12 AM

    Thank you! Now my BBone is wirelessly connected...

  7. Holm said

    August 21 2013 @ 5:30 AM

    Nice tutorial. I ran into troubles with encrypting my passphrase. This did the trick:
    IF your SSID contains spaces, you'll need quotation marks:
    # wpa_passphrase "Your SSID" passphrase

    Thank you for the great tutorial!

  8. Pablo said

    September 2 2013 @ 10:06 PM

    hello!! thanks for the tutorial, i follow all the steps but when i come to "depmod -a" i receive this message "WARNING: could not open /lib/modules/3.8.13/modules.order: No such file or directory
    WARNING: could not open /lib/modules/3.8.13/modules.builtin: No such file or directory"

    anyone can help me?

    Thanks again for your time!

  9. Arnaud Soyez said

    September 3 2013 @ 7:10 AM

    Hi Pablo, I remember seeing this. I don't think this warning message is a showstopper, it shouldn't prevent the system from registering your new module.

  10. k klein said

    September 5 2013 @ 6:21 PM

    Unfortunately "make scripts" runs out of space if you have installed java and netrexx on your BBB. I will have to cross compile on Ubuntu running under VirtualBox on my mac.

  11. Luiz Gustavo Castelan Póvoas said

    September 8 2013 @ 10:03 PM

    k klein: try uninstalling some packages you are not using, example: Chrominum and firefox.

  12. Kming said

    September 13 2013 @ 11:20 AM

    Encountering the same scenario as Pablo,

    #depmod -a
    "WARNING: could not open /lib/modules/3.8.13/modules.order: No such file or directory
    WARNING: could not open /lib/modules/3.8.13/modules.builtin: No such file or directory"

    I tried to follow through the rest of the steps, the wifi seems to not work. And when I do check the ipconfig, I don't see the wlan0.

    #ipconfig -a
    eth0 Link encap:Ethernet HWaddr 90:59:AF:4A:7B:8D
    inet6 addr: fe80::9259:afff:fe4a:7b8d/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:261 errors:0 dropped:0 overruns:0 frame:0
    TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:55528 (54.2 KiB) TX bytes:2062 (2.0 KiB)
    Interrupt:56

    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:65536 Metric:1
    RX packets:4 errors:0 dropped:0 overruns:0 frame:0
    TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:280 (280.0 B) TX bytes:280 (280.0 B)

    usb0 Link encap:Ethernet HWaddr E2:E0:67:F3:55:B0
    inet addr:192.168.7.2 Bcast:192.168.7.3 Mask:255.255.255.252
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:706 errors:0 dropped:0 overruns:0 frame:0
    TX packets:639 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:48567 (47.4 KiB) TX bytes:120910 (118.0 KiB)

  13. Greg said

    September 20 2013 @ 5:41 PM

    I have been unable to connect at all with these exact changes applied. I am not assigned an IP, nor do I authenticate or associate to the AP, whereas with the old drivers I could at least connect for a brief period before being deauthenticated for various reasons.

    root@beaglebone:dmesg | grep wlan0
    [ 9.691073] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready

    I know the module is loaded and the wifi dongle can work because using 'iwlist wlan0 scan' yields the information about the network I am attempting to connect to. One output I don't understand why I am receiving is the Nickname from iwconfig wlan0:

    wlan0 unassociated Nickname:""
    Mode:Managed Frequency=2.412 GHz Access Point: Not-Associated
    Sensitivity:0/0
    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

    I am using a 5 V 2.5 A barrel jack, the ethernet cable is disconnected and I am SSH'd into the board via the USB cable. Is there anything else I am forgetting? Any help would be much appreciated.

  14. Greg said

    September 20 2013 @ 5:50 PM

    Edit:
    Nickname should read ""

  15. Andrés said

    September 24 2013 @ 3:16 PM

    Excellent tutorial!

    However, I've experienced this small problem: the Wifi Dongle gets an IP and default gateway through DHCP, but apparently no DNS server is configured, since I can use the network correctly by using IP adresses, but URL's cannot be resolved. I haven't had this problem when using Ethernet.

    Any ideas?
    Thanks in advance!

  16. Guy said

    September 25 2013 @ 8:59 AM

    Thanks for the tutorial

    I have run into a small problem near the end.
    I do not have a wifi.config file to edit in /var/lib/connman

    What does this mean I did wrong?

    Regards
    Guy

  17. Arnaud Soyez said

    September 25 2013 @ 9:02 AM

    Just try creating it manually.

  18. Guy said

    September 27 2013 @ 7:50 AM

    Ok, I saw a few other people do that as well, so I'll give it a shot.

    However, I have another, bigger problem now.

    During the "opkg upgrade" phase, I need to do a few reboots. This is due to the internet connection bombing out. At some point after one of these reboots, I am met with a user login window and the option of three users:
    > mpd
    > xuser
    > Other

    The first two require a password, and "Other" requires a User name and Password.
    In the case of the first two, I have no clue what the password is... (It's not "Blank", "root", "1111", "1234" or anything I can think of)
    In the case of "Other", the username "Root" and password "blank" combination do not work.

    I really hope someone has dealt with this.

    Regards
    Guy

  19. Cameron said

    October 5 2013 @ 10:04 PM

    Guy, I had the same issue and had to flash the board again.

    I am wondering what about the upgrade step is specifically needed to run the wifi adapter. running opkg upgrade takes my board over 2 hours to complete. I have read many reports of people having major issues after the upgrade step.

    I would really like to see a bare-bones, minimum required installs, approach to enabling wifi on the BBB.

    Fingers crossed that someone smarter than me will provide this!

    Thanks!

  20. Aerialbear said

    October 8 2013 @ 7:08 PM

    Having the same problem as Pablo: I followed all the steps carefully but do not see wlan0 listed ifconfig -a.

    I compiled and got the .ko file - is there a way to verify it? I am wondering if this file is corrupt.

  21. Nico said

    October 12 2013 @ 8:14 AM

    Had the same problem with upgrading.
    I searched the internet and found that there is a wide spreading problem.
    I saw that the opkg upgrade will work with this image:

    http://dominion.thruhere.net/koen/angstrom/beaglebone/BBB-eMMC-flasher-2013.05.02.img.xz

    Burn it to a sd Start your beagle with the SD while holding the user boot button. Wait for a while -45min till all LEDs are constant on. reboot with no SD card and issue the upgrade again. This should be working.

  22. saperlot said

    October 13 2013 @ 4:10 PM

    HI,
    I blacklisted the old drivers as shown here, but i think the system loads the wrong driver:

    root@beaglebone:~# lsusb -t
    /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=musb-hdrc/1p, 480M
    /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=musb-hdrc/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Vendor Specific Class, Driver=rtl8192cu, 480M

    It's listed as rtl8192cu. I'm having a problem that connman can't connect, but if i try the interface getting running with "interfaces" and the "ifup wlan" i can get it running with a static ip, dhcp fails..

    Is here loaded the wrong driver or is there an other problem?

  23. saperlot said

    October 13 2013 @ 4:50 PM

    Edit:
    Problem not solved, but it works if there is no eth connection. does this make sense?

  24. Sean said

    October 19 2013 @ 1:21 PM

    Amazing ... worked the first time - well actually the second time. In your example of modifying the /var/lib/connman/settings file, the "Tethering=false" is VERY IMPORTANT. At least for me it was.

    On my first try, I found that without that Tethering setting the Edimax dongle would connect to my WAP and get an IP. What didn't work was talking to other systems on my LAN. From the BBB, I could ping the WAP but nothing else could ping (or otherwise) to the BBB through the Edimax.

    Tried adding the "Tethering=false" and rebooted. POOF !!! Now everything can talk to the BBB.

    I need to read up on what the Tethering argument does in Connman.

  25. hola said

    October 21 2013 @ 2:13 PM

    This works for tl wn725n

  26. hola said

    October 21 2013 @ 2:14 PM

    Works on a tl wn725n?

  27. samira said

    November 5 2013 @ 3:18 AM

    OMG, it works on 1st try.
    Thank you so much.
    Samira, BKK.

  28. preetham said

    December 11 2013 @ 9:21 AM

    Thanks! Worked like a charm

  29. Javi said

    January 9 2014 @ 11:55 AM

    I'm seeing the same problem Pablo originally reported. On running 'depmod -a', I get:

    root@beaglebone:/usr/src/kernel# depmod -a
    WARNING: could not open /lib/modules/3.8.13/modules.order: No such file or directory
    WARNING: could not open /lib/modules/3.8.13/modules.builtin: No such file or directory

    On 'ifconfig -a' I see no wlan0.

    Anybody solve this issue yet?

  30. Sani Elfishawy said

    January 12 2014 @ 8:33 PM

    @saperlot. Did you find a solution?

    For me as well lsusb -t gives Driver=rtl8192cu

    I kind of expected to see Driver-8192cu

    Can the folks who have it working please let us know what lsusb -t returns.

  31. Jason said

    January 20 2014 @ 1:24 PM

    Just wanted to comment on the issue of the opkg update locking users out by removing the "auto-login".
    You can still login as root. Hit 'ctrl-alt-f1' at the login prompt and it will take you to a cmd line where you can login as root. You can then fix the issue by creating a root password or re-installing the auto-login-hack pkg.

    opkg install --force-reinstall angstrom-gdm-autologin-hack

  32. Greg said

    February 2 2014 @ 6:20 AM

    Big thanks! Worked flawlessly on the first try. Using a Bolse branded 8192cu with external antenna.

  33. Jim Rachar said

    February 6 2014 @ 11:13 AM

    For someone able to ping the network, but no dns, try this:

    echo nameserver 192.168.1.1 > /etc/resolv.conf

    Of course, you will need to enter the actual nameserver ip address on your network.

  34. mike said

    February 23 2014 @ 8:48 PM

    did a "shutdown -r 0" after the "opkg install kernel-headers" step and seem to have bricked my bbb.

    Anyone have a similar plight? Better still, any suggestions on how to recover?

  35. Josh said

    April 3 2014 @ 4:18 AM

    I have followed the above instructions, but am still not working. When I dmesg | grep 8192 I get a bunch of the following errors:

    [ 2.406587] 8192cu: disagrees about version of symbol alloc_etherdev_mqs
    [ 2.406612] 8192cu: Unknown symbol alloc_etherdev_mqs (err -22)

    The error repeats lots of times for different links. I am assuming that the driver is ever loaded because of the errors. I did get the following error when I did the depmod -a step:

    "WARNING: could not open /lib/modules/3.8.13/modules.order: No such file or directory
    WARNING: could not open /lib/modules/3.8.13/modules.builtin: No such file or directory"

    Related? Anyway, thanks to anyone who can help me!

Comment RSS · TrackBack URI

Leave a comment

Name: (Required)

eMail: (Required)

Website:

Comment: