Question about Realtek RT8192CU wifi dongle and hotspot

Hi,

I am having issues getting the hotspot feature to work. I added a wifi dongle I purchased from: Miniature WiFi (802.11b/g/n) Module: For Raspberry Pi and more : ID 814 : $11.95 : Adafruit Industries, Unique & fun DIY electronics and kits

The output of lsusb is: Bus 001 Device 004: ID 0bda:8178
I see it is loading the rtl8192cu module, but I see on the dmesg output:
[ 43.572442] cfg80211: Calling CRDA to update world regulatory domain
[ 46.732703] cfg80211: Exceeded CRDA call max attempts. Not calling CRDA

Here is the complete dmesg and lsmod output: http://pastebin.com/yzz0EPt9

I see a wlan0 device with the 10.0.0.1 IP on the output of ifconfig, but when I run: iw wlan0 info
I get: command failed: No such device (-19)

I see the wlan0 is hard coded on the interfaces file.

Could this be related to the issue on this post: raspbian - Jessie: cfg80211: Calling CRDA to update world regulatory domain - Raspberry Pi Stack Exchange

“Looks like the CRDA package was missing from Jessie.”

Has anyone else tried a dongle based on that realtek dongle? it works on raspbian. I see that it is mentioned here: https://wiki.outernet.is/wiki/List_of_WiFi_dongles#Notes but I know that doesn’t mean anything.

Thanks!

CRDA isn’t critical to operation. I think the module that’s in the kernel is busted, but I’ll have to look into it. I think I have a 8192CU dongle lying around here somewhere. :smile:

EDIT 2:

Scratch the last edit. Firmware is also installed. Please try this:

$ sudo su
# vi /etc/init.d/S81hostapd

Find a line that says -- -B -P $HOSTAPD_PID $HOSTAPD_CONF and edit it (press i to start editing), and make it look like this:

-- -d -B -P $HOSTAPD_PID $HOSTAPD_CONF

Then press Esc : w q to save and exit. Restart hostapd with:

# service hostapd restart

Copy the output after running that command and pastebin it.

Thanks for your reply!

This is the output of that: http://pastebin.com/9xRtB1jJ

What does it say if you do:

$ iw list | grep -A7 "Supported interface modes"
ORxPi2 v2.6 | root@orxpi2:/etc/init.d> iw list
ORxPi2 v2.6 | root@orxpi2:/etc/init.d> iw wlan0 info
command failed: No such device (-19)
ORxPi2 v2.6 | root@orxpi2:/etc/init.d> 
ORxPi2 v2.6 | root@orxpi2:/etc/init.d> ifconfig
.
.
wlan0     Link encap:Ethernet  HWaddr 00:0B:81:XX:XX:XX
          inet addr:10.0.0.1  Bcast:0.0.0.0  Mask:255.255.255.0
          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)

Looks like the module is being loaded, but it doesn’t activate the dongle?

Possible, yeah. I’ll see if I can get mine to work over the weekend.

The support for AP mode is not confirmed, so not very promising.

I’ve just tried 8192cu dongle (Edimax) I have here. The result is as follows:

> sudo service hostapd restart
Password: 
Stopping hostapd: FAIL
Starting hostapd: Configuration file: /etc/hostapd.conf
nl80211: Driver does not support authentication/association or connect commands
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
nl80211 driver initialization failed.
wlan0: interface state UNINITIALIZED->DISABLED
wlan0: AP-DISABLED 
hostapd_free_hapd_data: Interface wlan0 wasn't started
FAIL

It appears that the driver (one that comes with the kernel) does not support AP mode. I’ve heard of an alternative driver that might support the ml80211 management commands, but not sure whether it actually works, and whether we’ll be able to include it in ORx.

For reference:

If someone feels like modding the ORx build to include these, we would be very grateful. :smile:

On further read, it appears that we not only need a separate driver for rt8192cu, but also a separate version of hostapd that supports this chipset. It will be very difficult to support this if it breaks the other chipsets.

I think I’ve got it working. There are two common Realtek dongles (that I know of). One is RTL8188CUS (most notably Edimax), and another is RT8192CU (like yours). The latter seems to work with the fixes I’ve made, and the former won’t even be recognized with the fixes (but that’s fine cause it wouldn’t work in AP mode anyway).

The fix involves patching hostapd with patches from pritambaral, which enables the use of rtl871xdrv driver in addition to nl80211 (the part where it’s ‘in addition to’ is critical, since this allows previously working dongles to continue working). Another bit is the addition of Realtek’s vendor drivers for the RT8192CU chips which comes from dz0ny.

Unfortunately, hostapd’s rtl871xdrv driver is not selected automatically, so manual intervention is needed. To activate this driver, you need to edit /etc/hostapd.conf file and add a following line:

driver=rtl871xdrv

When you’re done editing:

sudo service hostapd restart

The images can be downloaded from here.

Hi branko,

Thanks for looking in to this. I downloaded and installed the new image rc1.

It looks like the image does not include the rt8192cu module. I looked under: /lib/modules/4.1.12/kernel/drivers/net/wireless>

and it is no longer there.The device wlan0 is not created and hostapd fails to load because of that. I followed the links, but it does not look like I could do anything that was listed there. I think the image already include those patches. Am I missing something?

Please do this:

  1. boot w/o the wifi dongle
  2. plug it in
  3. type dmesg | tail

Paste the results here.

EDIT: Ah darn, it looks like I did botch the install, and the dongle I was testing is not actually rt8192cu so of course it works. Tho I also noticed the driver isn’t very friendly to what we’re doing so might not work out. Plus I see reports form people for whom the driver did not work at all. I’ll try with stock kernel driver in combination with Realtek-enabled hostapd, and let’s see where that takes us.

EDIT 2: One of the Realtek dongles I could never get working before works with the in-kernel driver, so this is promising. I’m doing a clean rebuild of the image and will upload soon.

Let’s try the new image. It’s 2.7a2 at the same location as before.

Hi branko,

I am happy to report that the latest image work as expected! I can see and connect to the outernet hotspot! Here is the output of my dmesg: http://pastebin.com/F4iFeQ2X

Thanks again!

I also added the crda package so now you have:

[   14.774512] cfg80211: Calling CRDA to update world regulatory domain
[   14.881684] cfg80211: World regulatory domain updated:
[   14.887272] cfg80211:  DFS Master region: unset
[   14.891761] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[   14.902842] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[   14.911254] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[   14.920303] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
[   14.928606] cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
[   14.939424] cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
[   14.949202] cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
[   14.958347] cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[   14.966653] cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)