-   Slackware (
-   -   Problems with hostapd (

mitusf 02-03-2013 08:52 AM

Problems with hostapd
Hi, I'm trying to set up an Access Point for my wireless network with hostapd. I have problems setting it right. Here it is the output of starting the server /etc/rc.d/rc.hostapd start after setting the config file /etc/hostapd/hostapd.conf like in


# /etc/rc.d/rc.hostapd start
Starting HOSTAPD:  /usr/sbin/hostapd -B -P /var/run/ /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
Failed to set interface wlan0 to master mode.
nl80211 driver initialization failed.
rmdir[ctrl_interface]: No such file or directory
ELOOP: remaining socket: sock=5 eloop_data=0x9a37a58 user_data=(nil) handler=0x80854f0

Did someone encountered the same problem and can he tell me what is wrong?


mitusf 02-03-2013 09:59 AM

Assuming that the wireless interface of my PC on which I have tested above does not support other modes then Managed, I tried it on my raspberry pi, and here it is the error messages:


# /etc/rc.d/rc.hostapd start
Starting HOSTAPD: /usr/sbin/hostapd -B -P /var/run/ /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
nl80211 not found.
nl80211 driver initialization failed.
rmdir[ctrl_interface]: No such file or directory
Now, another question is how can I resolve this problem on raspberry pi with hostapd?

guanx 02-03-2013 05:50 PM

You'd either use a driver (for your WiFi chipset) that supports the generic linux cfg80211 or let hostapd use the (hostap) driver that your chipset driver supports (e.g. ralink, rtl871xdrv, etc.).

mitusf 02-06-2013 07:30 AM

I thought I have managed to set the card to work on raspi but I was wrong. The led blinks, but with iwconfig it is not shown. But when I run ifconfig wlan0 up it is recognized.

guanx, do you know what is the problem that is not working with iwconfig and neither with wicd?

guanx 02-06-2013 11:48 AM

Hi, mitusf. My wreched self am using the infamous RTL8192 currently. The firmware gets loaded only when the interface is brought up. I don't remember if it was the same for RT5370 (is this your chip?).

Wicd should bring up the interface before doing wireless operations (e.g. scanning). If not, it's a bug in wicd.

If you can confirm your problem is due to the firmware not loaded, we can devise a workaround.

mitusf 02-06-2013 01:00 PM

Hi guanx, yes, it's the RT5370 chip on the card. It is not recognized by iwconfig (only by ifconfig), the card blinks, the driver is loaded by udev at boot, no indication about using any firmware, but I haven't tried to remove the rt* firmwares to see how it works (or not), not recognized by iwconfig so, therefor not working under wicd. It's very strange. You know, that the card works with the ralink driver, by manually loading it, after removing rt2800usb, rt2800lib, rt2x00usb, rt2x00lib, but not removing mac80211 (requiered by hostapd, but has still problem initializing the nl80211 driver this way, probably not correctly done all the linking when inserted the driver into the kernel).

So, I am looking at buying another card, an edimax-EW7811Un and I hope it will work and maybe returning the current one.

guanx 02-06-2013 02:17 PM

So your RT5370 still does not show up in iwconfig even after brought up with ifconfig? That's strange. BTW, my RT5370 works directly with stock kernel (i.e. the rt2800usb driver).

With EW7811Un (RTL8188CUS) I have no experience. I do use RTL8192CU, which shares the same drivers (both Linux driver and manufacturer driver) with RTL8188CUS. RTL8192CU's performance is measurable better than RT5370's, but the driver quality is much lower. Hope you good luck!

mitusf 02-07-2013 10:56 AM

I've bought the edimax-EW7811Un today. The card is working under RPi, there was the driver already installed for it (8192cu module), although the device has it's own manufacturer driver but it's practically impossible to build and install it, it's a mess. Although the device is working, there are still problems with hostapd, fact which bothers me enough. Do you know if your RTL8192CU chip based device is working with hostpad and what is it's store name?

guanx 02-07-2013 06:36 PM

Beware the followings may not apply to your case because my USB WiFi adapter (TL-WN823N) has RTL8192CU but your EW-7811Un seems to have RTL8188CUS. They share the same drivers, though.

With neither the official Linux driver (rtl8192cu.ko) nor the namufacturer's driver (8192cu.ko) could I work with multiple virtual interfaces.

With the official Linux driver I don't (yet) have problems in station mode. It can work in AP (master) mode but stations are disconnected very often. The author of this driver is very busy, so if you don't plan to fix it yourself then don't use it for AP.

With the manufacturer's driver I had some success in station mode. But today, I've no idea why, I always get "cannot allocate memory" errors. I spent no time to dig out the reason because as I know you plan to run an AP instead. Using the hostapd that comes together with the the manufacture's driver package, I ran an AP and saw no problem until now.

A few notes for the manufacturer's driver:

To build as a module in a recent Linux kernel, it is necessary to export the "kernel_thread" symbol.

--- linux-3.7/kernel/fork.c    2012-12-11 04:30:57.000000000 +0100
+++ 2013-01-25 23:47:50.712831626 +0100
@@ -1643,6 +1643,7 @@
        return do_fork(flags|CLONE_VM|CLONE_UNTRACED, (unsigned long)fn, NULL,
                (unsigned long)arg, NULL, NULL);

The generic cfg80211 support is broken, at lease for more recent kernels. It is disabled by default anyway, so don't worry.

Without cfg80211 support you need to use the rtl871xdrv driver in "hostapd.conf" and not the nl80211 driver.

Without cfg80211 support the iw command does not work. Use iwconfig if necessary.

It is known that ifconfig might freez the whole system. The ip command works.

mitusf 02-08-2013 09:34 AM

Thanks, I guess I'll try to build it, although I haven't found the latest source on the internet yet, but I have an 2010 release (2.0.939) on CD. I hope it will work.

guanx 02-08-2013 10:22 AM


Originally Posted by mitusf (Post 4887069)
... I haven't found the latest source on the internet yet ...

Just search for "rtl8188cus linux driver" on the Internet and you get:

at the bottom is the link


mitusf 02-08-2013 01:10 PM

Ah, ok, I just hadn't cookies accepted. Now it's ok.

mitusf 02-17-2013 11:43 AM

Hi guanx,

I haven't had much time for testing but I reached to these results:

- first, it seems that there is no difference between the manufacturer driver and the linux driver: they share the same name 8192cu.ko, only that the linux driver it is placed into rtl8192cu subdir, but there is no indication that it has otherwise different provenience than the manufacturer driver.
- there is a problem with the manufacturer driver: after I compile and build it, the resulting module can not be inserted into the kernel - it results a "invalid module format" message being displayed. I have built the driver with:

make ARCH=arm -C /usr/src/linux M='directory of the driver' modules
- with the linux driver though, I have tried to put it to Master mode with iwconfig, but it refuses to accept setting up essid after successfully changed to Master, and all other parameters like channel, enc, key (though I don't remember now in what configuration worked, maybe even with enc/WEP key or maybe only without encryption, anyway, essid setting failed after that and I don't know why). Anyway, I have managed thought to set up a working ad-hoc link, but even this way, only when the remote computer initiated the link and not the raspi comp (but I might be wrong here, I need to test it further to check for sure because it might be possible that the connection couldn't be established because of some failure to negotiate the Cell and need to be re-initiated - also I can't remember here the context in which the error occurred). Anyway, with this working Ad-hoc connection I still have to try to set it using rc.inet1.conf and wpa_supplicant scripts to see if at least I can manage to set up a good encrypted ad-hoc network if an AP doesn't work (through hostapd).

All times are GMT -5. The time now is 04:56 PM.