LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 02-03-2013, 08:52 AM   #1
mitusf
Member
 
Registered: Nov 2011
Location: Bucharest, Romania
Distribution: Slackware
Posts: 141

Rep: Reputation: 2
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 http://docs.slackware.com/howtos:net...s_access_point

Code:
# /etc/rc.d/rc.hostapd start
Starting HOSTAPD:  /usr/sbin/hostapd -B -P /var/run/hostapd.pid /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?

Thanks.
 
Old 02-03-2013, 09:59 AM   #2
mitusf
Member
 
Registered: Nov 2011
Location: Bucharest, Romania
Distribution: Slackware
Posts: 141

Original Poster
Rep: Reputation: 2
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:

Quote:
# /etc/rc.d/rc.hostapd start
Starting HOSTAPD: /usr/sbin/hostapd -B -P /var/run/hostapd.pid /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?
 
Old 02-03-2013, 05:50 PM   #3
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,014

Rep: Reputation: 146Reputation: 146
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.).
 
Old 02-06-2013, 07:30 AM   #4
mitusf
Member
 
Registered: Nov 2011
Location: Bucharest, Romania
Distribution: Slackware
Posts: 141

Original Poster
Rep: Reputation: 2
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 192.168.3.1 up it is recognized.

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

Last edited by mitusf; 02-06-2013 at 07:32 AM.
 
Old 02-06-2013, 11:48 AM   #5
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,014

Rep: Reputation: 146Reputation: 146
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.
 
Old 02-06-2013, 01:00 PM   #6
mitusf
Member
 
Registered: Nov 2011
Location: Bucharest, Romania
Distribution: Slackware
Posts: 141

Original Poster
Rep: Reputation: 2
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.
 
Old 02-06-2013, 02:17 PM   #7
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,014

Rep: Reputation: 146Reputation: 146
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!
 
1 members found this post helpful.
Old 02-07-2013, 10:56 AM   #8
mitusf
Member
 
Registered: Nov 2011
Location: Bucharest, Romania
Distribution: Slackware
Posts: 141

Original Poster
Rep: Reputation: 2
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?
 
Old 02-07-2013, 06:36 PM   #9
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,014

Rep: Reputation: 146Reputation: 146
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.
Code:
--- linux-3.7/kernel/fork.c     2012-12-11 04:30:57.000000000 +0100
+++ linux-3.7.new/kernel/fork.c 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);
 }
+EXPORT_SYMBOL(kernel_thread);
 #endif
 
 #ifndef ARCH_MIN_MMSTRUCT_ALIGN
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.
 
1 members found this post helpful.
Old 02-08-2013, 09:34 AM   #10
mitusf
Member
 
Registered: Nov 2011
Location: Bucharest, Romania
Distribution: Slackware
Posts: 141

Original Poster
Rep: Reputation: 2
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.
 
Old 02-08-2013, 10:22 AM   #11
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,014

Rep: Reputation: 146Reputation: 146
Quote:
Originally Posted by mitusf View Post
... I haven't found the latest source on the internet yet ...
Just search for "rtl8188cus linux driver" on the Internet and you get:

http://www.realtek.com/products/prod...n=4&ProdID=274

at the bottom is the link

http://www.realtek.com/downloads/dow...Downloads=true

.

Last edited by guanx; 02-08-2013 at 11:07 AM.
 
Old 02-08-2013, 01:10 PM   #12
mitusf
Member
 
Registered: Nov 2011
Location: Bucharest, Romania
Distribution: Slackware
Posts: 141

Original Poster
Rep: Reputation: 2
Ah, ok, I just hadn't cookies accepted. Now it's ok.
 
Old 02-17-2013, 11:43 AM   #13
mitusf
Member
 
Registered: Nov 2011
Location: Bucharest, Romania
Distribution: Slackware
Posts: 141

Original Poster
Rep: Reputation: 2
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:
Quote:
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).

Last edited by mitusf; 02-17-2013 at 11:45 AM.
 
Old 08-18-2014, 03:50 AM   #14
louigi600
Member
 
Registered: Dec 2013
Location: Italy
Distribution: Slackware
Posts: 176

Rep: Reputation: 9
Quote:
Originally Posted by mitusf View Post
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 http://docs.slackware.com/howtos:net...s_access_point

Code:
# /etc/rc.d/rc.hostapd start
Starting HOSTAPD:  /usr/sbin/hostapd -B -P /var/run/hostapd.pid /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?

Thanks.
I didn't know about http://docs.slackware.com/howtos:net...s_access_point so I went and wrote another
running_an_access_point_from_a_slackware_box
There's a lot of extra details in the article I wrote: it might be worth while having a look at it.

Quote:
Originally Posted by mitusf View Post
Hi guanx,

- 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.
Are you building the module with the same toolchain with which the kernel was built ?

Quote:
- 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
Hostapd should be the one that transition your wifi card into master mode and sets all the other options, you should not be doing that with iwconfig and/or iw. Have an extended look in the sample hostapd.conf provided in the sources.

Last edited by louigi600; 08-18-2014 at 11:11 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
hostapd jush Linux - Server 0 05-27-2012 01:40 AM
hostapd OmidPLUS Linux - Wireless Networking 7 03-17-2012 07:58 AM
hostapd authentication leo2008 Linux - Wireless Networking 3 02-15-2012 08:32 AM
Connection/disconnection problems with wpa_supplicant and hostapd when using WPA2 enc wallamit Linux - Wireless Networking 0 01-23-2012 06:05 AM
hostapd problem simonmcquire Linux - Networking 0 06-21-2009 07:24 AM


All times are GMT -5. The time now is 09:26 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration