exabrial
Posts: 13
Joined: Mon Nov 26, 2012 11:57 pm

RPI3: Module nl80211 not found, required for HostAPD?

Fri Mar 25, 2016 10:08 pm

Hey guys,

I'm trying to use my RaspberryPi as a backup router for a 4G LTE connection. The great news is, NAT/DHCP works fantastic over ethernet, so I know I have that part of the problem solved. (I can plug a device into the pi and it pulls an address from DnsMasq running on the PI and uses the PI as a router).


The problem is I cannot get hostapd on the RaspberryPI to work using the built-in wifi. I followed this guide roughly: https://frillip.com/using-your-raspberr ... h-hostapd/

However, when I try and modprobe that driver:

Code: Select all

[email protected]:~ $ sudo modprobe nl80211
modprobe: FATAL: Module nl80211 not found.
Here's my hostapd file:

Code: Select all


interface=wlan0
driver=nl80211
ssid=Pi3-AP
hw_mode=g
channel=4
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_passphrase=raspberry
rsn_pairwise=CCMP
When I try to start hostapd by hand, I get an error 95:

Code: Select all

[email protected]:~ $ sudo /usr/sbin/hostapd /etc/hostapd/hostapd.conf 
Configuration file: /etc/hostapd/hostapd.conf
Failed to create interface mon.wlan0: -95 (Operation not supported)
wlan0: Could not connect to kernel driver
Using interface wlan0 with hwaddr b8:27:eb:32:7d:a7 and ssid "Pi3-AP"
wlan0: interface state UNINITIALIZED->ENABLED
wlan0: AP-ENABLED 
If I want to do hostadp using the built-in wifi, am I required to use that particular driver?

exabrial
Posts: 13
Joined: Mon Nov 26, 2012 11:57 pm

Re: RPI3: Module nl80211 not found, required for HostAPD?

Fri Mar 25, 2016 10:29 pm

Strange, also this might be of interest... wlan0 is not joining the bridge I have setup:

Code: Select all

[email protected]:~ $ sudo brctl show
bridge name	bridge id		STP enabled	interfaces
lan0		8000.b827eb6728f2	no		eth0
So I tried adding it manually:

Code: Select all

[email protected]:~ $ sudo brctl addif lan0 wlan0
can't add wlan0 to bridge lan0: Operation not supported
[email protected]:~ $ sudo iw dev wlan0 set 4addr on
command failed: Operation not supported (-95)
Someone said that's because it's in "client mode". How do I unclient mode it?

User avatar
allfox
Posts: 452
Joined: Sat Jun 22, 2013 1:36 pm
Location: Guang Dong, China

Re: RPI3: Module nl80211 not found, required for HostAPD?

Sat Mar 26, 2016 2:06 am

Greetings.

I didn't use the on board wireless with hostapd. However I think the 95 message you are watching is about mon.wlan0, not wlan0. I read AP_ENABLED line there, so maybe your AP is already working. Ignore mon.wlan0.

Someone said you could just coment out any driver line.

The nl80211 driver might need a bridge=br0 line to tell hostapd to add wlan0 to br0.

Additional tip: I suggest that it would be better to add a country=CN line either. Change CN to your location. This make your AP compiles local radio rules.

exabrial
Posts: 13
Joined: Mon Nov 26, 2012 11:57 pm

Re: RPI3: Module nl80211 not found, required for HostAPD?

Sat Mar 26, 2016 4:45 am

Thanks! I think there were two keys to getting this working:

one,

Code: Select all

/etc/network/interfaces
needed wireless-mode master

Code: Select all

source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual

auto wlan0
iface wlan0 inet manual
	wireless-mode Master

auto lan0
iface lan0 inet static
	address 192.168.0.254
	netmask 255.255.255.0
	bridge_ports eth0 wlan0
	bridge_stp on
Second, I added the lines you suggested to hostapd.conf:

Code: Select all

interface=wlan0
driver=nl80211
ssid=something here
hw_mode=g
channel=4
country_code=US
bridge=lan0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_passphrase=something here
rsn_pairwise=CCMP
ieee80211n=1
ieee80211d=1
wmm_enabled=0

THANK YOU!!

User avatar
allfox
Posts: 452
Joined: Sat Jun 22, 2013 1:36 pm
Location: Guang Dong, China

Re: RPI3: Module nl80211 not found, required for HostAPD?

Sat Mar 26, 2016 5:05 am

btw: US doesn't need 80211d. In fact, it is banned by the U.S. Federal Communications Commission.

There are few countries get their radio rules defined in the very beginning of Wifi. These countries don't need 80211d, including US, CN, JP, etc. Those come later need append their rules, so 80211d.

Mikem22
Posts: 6
Joined: Sat Apr 16, 2016 12:04 pm

Re: RPI3: Module nl80211 not found, required for HostAPD?

Sat Apr 16, 2016 12:12 pm

Hello
I'm a Pi novice and a first timer here.
I'm having the same problem connecting to the onboard Pi3 wifi and getting the same error messages
Please can you advise what I do with your lines of code:
"source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual

auto wlan0
iface wlan0 inet manual
wireless-mode Master

auto lan0
iface lan0 inet static
address 192.168.0.254
netmask 255.255.255.0
bridge_ports eth0 wlan0
bridge_stp on"

Where and how do I input them?
Thanks
Mike

DirkS
Posts: 9967
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: RPI3: Module nl80211 not found, required for HostAPD?

Sat Apr 16, 2016 1:32 pm

Mikem22 wrote:Where and how do I input them?
Info is just above the code:

Code: Select all

/etc/network/interfaces
is the file.

Edit it with

Code: Select all

sudo nano /etc/network/interfaces

User avatar
allfox
Posts: 452
Joined: Sat Jun 22, 2013 1:36 pm
Location: Guang Dong, China

Re: RPI3: Module nl80211 not found, required for HostAPD?

Sun Apr 17, 2016 1:50 am

I tried the on board Wifi with hostapd recently. It works, well, not that fast.

The error message about mon.wlan0 is expected, according to https://wireless.wiki.kernel.org/en/use ... /brcm80211 , the monitor mode for brcmfmac is not ready yet. It could be ignored anyway.

And I don't use "bridge_stp on" in my configuration, because this is the old Spanning Tree Protocol, there would be a delay when some interface come online. If you find that devices can not connect to AP in the first minutes, try disable it.

Here is my bridge config:

Code: Select all

auto br0
iface br0 inet manual
     bridge_ports eth0 eth1 eth3 wlan0 wlan1
     bridge_stp off
     bridge_waitport 0
     bridge_fd 0

Mikem22
Posts: 6
Joined: Sat Apr 16, 2016 12:04 pm

Re: RPI3: Module nl80211 not found, required for HostAPD?

Sun Apr 17, 2016 3:16 pm

Thanks for the advice.
By a process of fumbling about and trying stuff it looks like I solved my problem. I had different names in raspi-config (Advanced Options - Hostname) and hostapd.conf (ssid=) after I made these the same everything seems to be working okay now. The tutorial I followed to set up the Pi as an Access Point didn't mention the Hostname, so I didn't know it was there until later.
Mike

Return to “General discussion”