wifi: RTL8811CU (works!)

I just thought I would post my success story with a RTL8811CU USB wifi adapter on the kiwi. I had previously fought hard to get a MT7601 working and while it worked I had some stability issues. The RTL8811CU is cheap and getting it working was easy. I cracked the case open on mine and soldered a connector to be able to use an external 2.4GHz antenna (my kiwi is in a metal enclosure).

In a nutshell:

sudo apt-get update
sudo apt-get install -y build-essential dkms git
git clone https://github.com/fastoe/RTL8811CU.git
cd RTL8811CU
make
sudo make install
sudo reboot

The make step takes a while, like 20-30 minutes. Once you reboot, configure with connmanctl:

robot@ev3dev:~$ connmanctl
Error getting VPN connections: The name net.connman.vpn was not provided by any
connmanctl> enable wifi
Enabled wifi
connmanctl> scan wifi
Scan completed for wifi
connmanctl> services
*AO Wired                ethernet_b827ebbde13c_cable
                         wifi_e8de27077de3_hidden_managed_none
    AH04044914           wifi_e8de27077de3_41483034303434393134_managed_psk
    Frissie              wifi_e8de27077de3_46726973736965_managed_psk
    ruijgt gast          wifi_e8de27077de3_7275696a67742067617374_managed_psk
    schuur               wifi_e8de27077de3_736368757572_managed_psk
connmanctl> agent on
Agent registered
connmanctl> connect wifi_e8de27077de3_41      # You can use the TAB key at this point to autocomplete the name
connmanctl> connect wifi_e8de27077de3_41483034303434393134_managed_psk
Agent RequestInput wifi_e8de27077de3_41483034303434393134_managed_psk
  Passphrase = [ Type=psk, Requirement=mandatory ]
Passphrase? *************
Connected wifi_e8de27077de3_41483034303434393134_managed_psk
connmanctl> quit

Cheers!

Nick W1NJC

«1

Comments

  • Nick:

    Thanks for the clear instructions. I tried, and when I get to the make step, the following happens:

    make ARCH=arm CROSS_COMPILE= -C /lib/modules/4.19.94-ti-r42/build M=/home/debian/RTL8811CU modules

    make[1]: *** /lib/modules/4.19.94-ti-r42/build: No such file or directory. Stop.

    make: *** [Makefile:2217: modules] Error 2

    Looks like a module should be there, but when I go this, I don't see a build directory or file

    debian@kiwisdr:/lib/modules/4.19.94-ti-r42$ ls

    extra  modules.alias   modules.builtin   modules.dep   modules.devname modules.softdep modules.symbols.bin

    kernel modules.alias.bin modules.builtin.bin modules.dep.bin modules.order  modules.symbols


    Any suggestions appreciated. I'm not terribly versed in Linux compilation, but have faint memories from years ago.

    Eric

  • /lib/modules/4.19.94-ti-r42/build should be a link to the linux headers,

    Which should be in the package linux-headers-4.19.94-ti-r42 in this case, so "sudo apt install linux-headers-4.19.94-ti-r42" should install them.


    BTW, I got mt76x2u based USB dongles running with the stock kernel on debian 11, they can even do 5 GHz. But the driver seem to use a lot of CPU, so the waterfall gets slow, if there is a lot of traffic. But there's no audio buffer underruns.

  • Hi @eric_j_johnson . I think HB9TMC is right with the package that is missing. I remember when I was getting the MT7601 working I had to install the headers.

    Nick

  • thanks both. with this install, the compilation went fine (although it took a while)

    I am able to connect to the wireless nicely, but have problems when I reboot the kiwi/beagle

    Is there anything I am missing to have this startup automatically at reboot? the beable is running debian 10.11.

    Thanks again so much.

  • Hi Eric,

    Try it with the wired LAN disconnected and see if it connects on its own. I seem to remember this issue before, though I think I must have done something to make it connect even when the wired is present.

    Nick

  • Which brand/model do you use with the RTL8811CU which supports 5 GHz?

  • Listed as:

    USB Wireless Adapter 600Mbps Realtek RTL8811CU Chipset Mini Type Dual Band 11AC WiFi Dongle IEEE 802.11 a b g n ac for Laptop Desktop IPTV USB 3.0 Network Adapter Support Windows 10 Mac Linux

    link at amazon: https://www.amazon.com/gp/product/B078NRDTYK/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1


    @Nick tried your suggestion. It did boot and connect, but then eventually dropped the connection as is did when the wired lan was connected. I'll investigate later, I've seen some discussion of issues with connmanctl doing scans and turning off the connection, or of other control software running as well and interfering with connman. This is not crucial, but I was going to experiment with moving the kiwisdr farther from the house. Any other thoughts or experiences appreciated. I know that wireless lan is not supported, but thanks to both HB9TMC and njc for help.

    Eric

  • Definitely make sure it's not a signal issue.

    You could also try this:

     cd /opt/scripts/tools
    ./update_kernel.sh
    

    Reboot and then see if it's any different.

    More info and things to try here: https://learn.adafruit.com/setting-up-wifi-with-beaglebone-black/configuration

  • You can also type "dmesg -t" and check if there are any messages at that time which would explain why the wifi connection dropped.

    Or "journalctl |tail -n 1000"

  • Log analysis is a great idea. When I was troubleshooting, I ran this script as a cron job every 5 min. Perhaps it will be helpful to you. In the crontab I piped the output to a log file, e.g.:

    crontab -e
     */5 * * * * /root/wifi_connect.sh >> /root/wifi_connect.log
    

    wifi_connect.sh:

    #/bin/bash
    # #/var/lib/connman
    ROUTER="<your router/gateway IP>"
    DATE=`date`
    echo $DATE
    uptime
    #ping router
    echo "Checking connectivity to $ROUTER"
    ping -c3 $ROUTER > /dev/null
    if [ $? != 0 ]; then
        echo "Disconnected, attempting to reconnect"
        connmanctl connect wifi_<connection Id>
        echo "Reconnect command run"
    else
        echo "Ping OK"
    fi
    


    In my case it never logged anything interesting at all, not even a disconnect. This was because the wifi dongle/driver was causing the system to freeze up.

    Hope you can figure it out.

  • Thanks so much. I'll be busy for a couple of days with other stuff, but will report back. This all looks very helpful.

    Eric

  • Finally got back to this with good results on both kiwi1 and a kiwi2

    With Buster (debian 10), the key as noted by njc is to disconnect the network cable.

    and as noted above, it is necessary to install headers:

    package linux-headers-4.19.94-ti-r42 in this case, so "sudo apt install linux-headers-4.19.94-ti-r42"


    On the kiwi2, the process is similar, but again need to install an appropriate set of headers, as indicated by the error message. Connman is not installed and I could not get it to run in debian 11. However the process here. https://forum.beagleboard.org/t/debian-11-x-bullseye-monthly-snapshot-2023-10-07/31280 did the trick. Again seems stable once the cable is removed.


    Appreciate the support.

  • when I get 'Make' I get this Error....

    root@kiwisdr:~/Beagle_SDR_GPS/RTL8811CU# make
    /bin/sh: 1: clang-6.0: not found
    (standard_in) 1: syntax error
    make ARCH=arm CROSS_COMPILE= -C /lib/modules/4.19.94-ti-r42/build M=/root/Beagle_SDR_GPS/RTL8811CU  modules
    make[1]: *** /lib/modules/4.19.94-ti-r42/build: No such file or directory.  Stop.
    make: *** [Makefile:2217: modules] Error 2
    

    What can I do to Fix....?

  • @ShaneBrook It needs the kernel headers:

    "sudo apt install linux-headers-4.19.94-ti-r42"

  • Well, I got past the last error...

    Now, I'm stuck again....

    connmanctl> enable wifi
    Error wifi: Method "SetProperty" with signature "sv" on interface "net.connman.Technology" doesn't exist
    


  • I get this error....

    root@kiwisdr:~/Beagle_SDR_GPS/RTL8811CU# make
    /bin/sh: 1: clang-6.0: not found
    (standard_in) 1: syntax error
    make ARCH=arm CROSS_COMPILE= -C /lib/modules/4.19.94-ti-r42/build M=/root/Beagle_SDR_GPS/RTL8811CU  modules
    make[1]: Entering directory '/usr/src/linux-headers-4.19.94-ti-r42'
      Building modules, stage 2.
      MODPOST 1 modules
    make[1]: Leaving directory '/usr/src/linux-headers-4.19.94-ti-r42'
    


  • I got it fixed.... Thank you....

  • If I Disconnect the LAN from the KiwiSDR the WIFI and Lan crashes...

    What can I do to stop this?

    Thanks.....

  • HI Shane,

    I'm curious how you got the other problem fixed. After the crash, is the kernel still running (if you plug LAN back in, can you connect?) Also, what happens if you boot up with the wired LAN disconnected?

    Nick

  • I followed the instructions, to get it working. I have to TABs open, one to connect to the address of LAN and the second TAB connects to the address for the WIFI.....

    And then when I unplug the LAN you lose the connection on the WIFI and the kiwiSDR receiver is not connected to the router anymore. If you go ahead and unplug kiwiSDR receiver and wait a few minutes then power back on it does not connect to the WIFI.

    I did not put this one in....

    Will this cause it to automatically connect with the WIFI?


    wifi_connect.sh:


    #/bin/bash

    # #/var/lib/connman

    ROUTER="<your router/gateway IP>"

    DATE=`date`

    echo $DATE

    uptime

    #ping router

    echo "Checking connectivity to $ROUTER"

    ping -c3 $ROUTER > /dev/null

    if [ $? != 0 ]; then

      echo "Disconnected, attempting to reconnect"

      connmanctl connect wifi_<connection Id>

      echo "Reconnect command run"

    else

      echo "Ping OK"

    fi


    It's too bad there was not step by step instructions...

    So I guess you have to edit a boot up script in order for it to automatically connect with WIFI?


    If you power down and then plug the power cord back in and let it load up with only the WIFI USB dongal

    It will not auto connect. If you pull the USB dongal out and then power off for a few minutes and then put the power back in with the LAN wire plug in it works OK on the LAN. If you want the WIFI to work in you have to do this:


    robot@ev3dev:~$ connmanctl

    Error getting VPN connections: The name net.connman.vpn was not provided by any

    connmanctl> enable wifi

    Enabled wifi

    connmanctl> scan wifi

    Scan completed for wifi

    connmanctl> services

    *AO Wired        ethernet_b827ebbde13c_cable

                 wifi_e8de27077de3_hidden_managed_none

      AH04044914      wifi_e8de27077de3_41483034303434393134_managed_psk

      Frissie       wifi_e8de27077de3_46726973736965_managed_psk

      ruijgt gast     wifi_e8de27077de3_7275696a67742067617374_managed_psk

      schuur        wifi_e8de27077de3_736368757572_managed_psk

    connmanctl> agent on

    Agent registered

    connmanctl> connect wifi_e8de27077de3_41   # You can use the TAB key at this point to autocomplete the name

    connmanctl> connect wifi_e8de27077de3_41483034303434393134_managed_psk

    Agent RequestInput wifi_e8de27077de3_41483034303434393134_managed_psk

     Passphrase = [ Type=psk, Requirement=mandatory ]

    Passphrase? *************

    Connected wifi_e8de27077de3_41483034303434393134_managed_psk

    connmanctl> quit



    I am using RTL8188cus wifi USB dongal.

  • Try this:

    connmanctl enable wifi autoconnect=true
    

    When you type services you should see "AO" before your network. A=autoconnect, O=online

  • njcnjc
    edited October 30

    OK, I was incorrect before. You want to do this from the connmanctl shell:

    config wifi_<connection Id> autoconnect on
    

    I just tested this on my kiwi. If I run the config command with 'autoconnect off' and then run 'services', the "*AO" before my connection becomes just "*O". If I run the config command again with 'autoconnect on' and then run 'services', it returns to "*AO". The asterisk indicates that it is currently connected.

  • I just rebooted and LSUSB don't show WIFI dongle....

    and enable WIFI command don't work....

    I have to reinstall again to get to work.....

  • Do I need to fix this?

    /bin/sh: 1: clang-6.0: not found
    (standard_in) 1: syntax error
    


  • I don't know what that is. Your previous comment stated that you got wifi connected, but it was not auto connecting. Now it seems like you have other problems..

  • What is:

    <connection Id>
    
    

    WLAN ?

    config wifi_<connection Id> autoconnect on
    


  • When I rebooted I get this:

    connmanctl> services
    *AO Wired                ethernet_7804738347d6_cable
    connmanctl>  
    

    WIFI goes away.....

  • It does this.....

    from reboot


    CONSOLE: open connection
    root@kiwisdr:~/Beagle_SDR_GPS# lsusb
    Bus 001 Device 002: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    root@kiwisdr:~/Beagle_SDR_GPS# connmanctl
    connmanctl> services
    *AO Wired                ethernet_7804738347d6_cable
    connmanctl> enable wifi
    Error wifi: Already enabled
    connmanctl> services
    *AO Wired                ethernet_7804738347d6_cable
    connmanctl>  
    


  • Ok, it's not seeing your wifi device at all now. I'm not sure what you did.

    From a shell, type ifconfig

    Do you see wlan0? If not, you have a hardware/driver issue.

  • I Tried this WIFI Dongle:

    BrosTrend Linux WiFi Adapter for Ubuntu, Mint, Debian, Lubuntu, Xubuntu, Mate, Zorin, PureOS, Raspberry Pi 2+, Windows 11, 1200Mbps, 5GHz/2.4GHz, Long Range 2X5dBi Antennas, USB3.0

    Linux Driver, Go to: https://linux.brostrend.com/

    Installation steps

    1. Please note that an Internet connection is required at the time of installation, so as to be able to download the driver and its dependencies (dkms, linux-headers…). That means that you might have to use a wired connection (LAN cable) or mobile phone wifi-to-usb tethering.
    2. We recommend to update and reboot your system before running our installer, to avoid some common issues like mismatched kernel headers or old http certificates.
    3. After the system has booted, insert the Wi-Fi adapter into a USB slot.
    4. Select all the following line and right click → copy it to the clipboard:
     sh -c 'wget linux.brostrend.com/install -O /tmp/install && sh /tmp/install'
    

    You can chose for what USB WIFI Dongle you have and Driver.

    Mine is RTL8812AU

    It took about 3 Hrs. to finish....

    And it worked! Even after Boot! Auto startup.....

    Thank You.....

Sign In or Register to comment.