7
  • I have Intel Centrino Wireless-N 1000
  • I installed hostapd from Ubuntu Software Center
  • When I run this command hostapd hostapd-minimal.conf I get this:

    root@tarek-PC:~# hostapd hostapd-minimal.conf
    Configuration file: hostapd-minimal.conf
    Line 2: invalid/unknown driver 'nl80211 '
    Line 4: unknown hw_mode 'g '
    2 errors found in configuration file 'hostapd-minimal.conf'
    

After doing make first I had this error:

driver_nl80211.c:25:26: warning: netlink/attr.h: No such file or directory

I solved it by installing libnl-1.0pre8

Now I have this error when doing make command:

../src/crypto/crypto_openssl.c:10:30: fatal error: openssl/opensslv.h: No such file or directory
compilation terminated.
make: *** [../src/crypto/crypto_openssl.o] Error 1

Can anyone help me with that error I am running Ubuntu 13.04?

techraf
  • 3,306
  • 10
  • 26
  • 37
Tarek
  • 97
  • 1
  • 3
  • 10

4 Answers4

6

You need to build, or obtain, a different copy of hostapd. The one you have has been built with the option CONFIG_DRIVER_NL80211 set to N, rather than Y.

There are simple and detailed instructions how to rebuild it here → Hostapd building instruction. Rebuild it with the option enabled. You may have to google for hostapd.2.0.tar.gz, but do exactly as it mentioned in link.

As for the follow-up question/error try to install this library libssl-dev using this command:

sudo apt-get install libssl-dev
muru
  • 193,181
  • 53
  • 473
  • 722
pourjour
  • 229
  • 1
  • 10
  • thank you for answer when I was following "Hostapd building instruction" I had an error. I edited my question please read my question for the error details if you want to help me – Tarek May 09 '13 at 21:36
  • 1
    Ok try this solution above. – pourjour May 09 '13 at 21:49
  • thank you **pourjour** for helping your solutions worked with me :) .I get sick from this now I have got a new error please see this [question] (http://askubuntu.com/questions/298368/how-to-fix-could-not-connect-to-kernel-driver-hostapd-error) if you want to help me – Tarek May 21 '13 at 20:52
  • This worked for me as well. I was trying to get my ErleRobotics PXFMini + RPiZero drone working with a Ralink RT5370 adapter I already had. When I pulled down the source for hostapd it already had CONFIG_DRIVER_NL80211 set to Y. So I just had to pull down the source and build it without making any changes. I did have to comment out some unsupported settings in the hostapd.conf file that came with the SDcard image from erlerobotics like DEVICENAME and MANUFACTURER. But now it works great! – Josh P Mar 28 '16 at 00:22
5

You see the spaces after the values? Remove them.

  • Line 2: invalid/unknown driver 'nl80211 '

  • Line 4: unknown hw_mode 'g '

Seth
  • 57,282
  • 43
  • 144
  • 200
jmarcos
  • 51
  • 1
  • 2
  • Don't know who have voted down, but it's the correct answer. In the config file there is a trailing space on many lines. This is the reason of the error. After removing them, it works. Thank you. – Byscripts Nov 08 '13 at 15:31
  • I had simular problem when cutting/pasting a hostapd.conf from a website: hostapd is due to a bad implementation very sensitive to whitespaces. Also make sure your interface= in hostapd.conf does not end with a space character, you will get a strange "nl80211: Register Action command failed: ret=-19" error otherwise... – Roalt Jan 16 '14 at 07:57
1

Check for EOL format. It should be in UNIX format as < LF > and not < CR >< LF >. That fixed mine error.

Dmitrij
  • 11
  • 1
1

I had a similar Problem, but without the spaces after the values and managed to solve it:

Before I encountered the Problem, I copied the hostapd.conf file from my Windows pc onto my Raspberry Pi. And I believe the problem was, that the text had special characters. Maybe some returns were different (Because I had a return instead of a space after the values in the errors)

But enough speculation, let's come to my solution:

  1. I renamed the old hostapd.conf file (to hostapdOld.conf)
  2. I created a new file with the name hostapd.conf
  3. And then I copied the whole content of the old file to the new one. (I just selected the whole text, didn't use Ctrl+A, if this even matters)

Then I ran hostapd as usual, with:

sudo hostapd -d /etc/hostapd/hostapd.conf

And it worked again