Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Novice
1,346 Views

Ubilinux access point hostapd/driver issue

Jump to solution

This is an issue mentioned as an "aside" in a few other threads by users dottedquad and bra, to deaf ears.

I've got an Edison running ubilinux build 150309 (as of this writing, the most recent). I'm trying to configure wifi in access point mode, but experiencing what appear to be driver issues. However, numerous users have reported working APs, both on Yocto and Ubilinux. Where else might the three of us (and any others) look to find the problem?

 

My suspicion is that nl80211 is either not trying, or is falling back on, the older, two-interface method that requires monitor mode. (https://wireless.wiki.kernel.org/en/users/documentation/hostapd https://wireless.wiki.kernel.org/en/users/documentation/hostapd) Perhaps I'm wrong, but the Edison wireless chipset driver doesn't support monitor mode. I cannot find any information about "forcing" one mode or the other.

The usual steps first:

rfkill is not blocking.

/etc/default/hostapd includes only this uncommented line:

DAEMON_CONF="/etc/hostapd/hostapd.conf"

/etc/hostapd/hostapd.conf is very near to the default values, and can be seen here http://pastebin.com/qtrj2ku7 hostapd.conf - Pastebin.com.

/etc/network/interfaces has only:

auto wlan0

iface wlan0 inet static

address 192.168.42.1

netmask 255.255.255.0

When trying to start hostapd (either on boot, with service, or by running # hostapd -ddK /etc/hostapd/hostapd.conf) , I receive the following output (full text for searchability):

[....] Starting advanced IEEE 802.11 management: hostapdrmdir[ctrl_interface]: No such file or directory

failed!

random: Trying to read entropy from /dev/random

Configuration file: /etc/hostapd/hostapd.conf

ctrl_interface_group=0

nl80211: interface wlan0 in phy phy2

rfkill: initial event: idx=2 type=2 op=0 soft=0 hard=0

rfkill: initial event: idx=5 type=2 op=0 soft=0 hard=0

rfkill: initial event: idx=6 type=1 op=0 soft=0 hard=0

rfkill: initial event: idx=7 type=1 op=0 soft=0 hard=0

nl80211: Using driver-based off-channel TX

nl80211: Use separate P2P group interface (driver advertised support)

nl80211: TDLS supported

nl80211: Add own interface ifindex 6

nl80211: Set mode ifindex 6 iftype 3 (AP)

nl80211: Create interface iftype 6 (MONITOR)

Failed to create interface mon.wlan0: -19 (No such device)

nl80211: Failed to set interface wlan0 into AP mode

netlink: Operstate: linkmode=0, operstate=6

nl80211: Set mode ifindex 6 iftype 2 (STATION)

nl80211 driver initialization failed.

rmdir[ctrl_interface]: No such file or directory

dmesg produces only one line of new content:

CFG80211-ERROR) wl_cfg80211_add_virtual_iface : device is not ready

To me, this looks like a driver issue. iw list includes AP mode, but running # iwconfig wlan0 mode master generates:

Error for wireless request "Set Mode" (8B06) :

SET failed on device wlan0 ; Invalid argument.

Tags (1)

Accepted Solutions
Highlighted
Novice
143 Views

Re: Ubilinux access point hostapd/driver issue

Jump to solution

Resolved, thanks to @petn-randall on freenode # debian!

The newest version of hostapd doesn't use the "old method" described by the documentation, but the version in the stock repositories that ship installed with Ubilinux does. Updating to the newest (testing) hostapd fixes it. Details follow.

The problem:

In the stock hostapd binary, receiving and sending management frames requires monitor mode interface. It attempts to configure one interface running in master mode for standard traffic and another one for authentication, keys management, etc. This method is still supported by nl80211 driver as a fallback, but is NOT supported by the Edison chipset and driver.

Later, nl80211 implemented special commands for sending management frames (NL80211_CMD_FRAME) and subscribing to them (NL80211_CMD_REGISTER_FRAME). This allowed user space to handle wireless infrastructure using a single AP interface only. This is currently preferred method that can be used with all mac80211 drivers implementing AP mode. It solves our problem here, since it doesn't require a Monitor Mode interface (which we can't do). Newer versions of hostapd have already been patched to use this method - lucky us!

The solution:

First, add the testing repository to your list of repositories:

# echo deb http://ftp.us.debian.org/debian http://ftp.us.debian.org/debian testing main contrib non-free >> /etc/apt/sources.list

Then, add an apt preference such that you don't update ALL your packages to testing versions. Unless you're into that kind of thing, I guess. As root, add these lines to /etc/apt/preferences (create the file if it doesn't exist).

Package: *

Pin: release a=testing

Pin-Priority: 900

Finally, update hostapd using the testing repo. Note which other packages will also be updated to testing versions as a result.

# apt-get -t testing install hostapd

It will ask a few questions during the install. Make sure to retain the customized /etc/init.d/hostapd provided by ubilinux. It is correctly configured for the edison. If you accidentally blow it away, here is an original: http://pastebin.com/KrvUBNDX http://pastebin.com/KrvUBNDX

It may restart a few services, like cron, while it runs. Once it's complete, double-check your configuration files (/etc/hostapd/hostapd.conf and /etc/network/interfaces and /etc/default/hostapd), and restart hostapd. Your access point should come up automagically!

 

View solution in original post

1 Reply
Highlighted
Novice
144 Views

Re: Ubilinux access point hostapd/driver issue

Jump to solution

Resolved, thanks to @petn-randall on freenode # debian!

The newest version of hostapd doesn't use the "old method" described by the documentation, but the version in the stock repositories that ship installed with Ubilinux does. Updating to the newest (testing) hostapd fixes it. Details follow.

The problem:

In the stock hostapd binary, receiving and sending management frames requires monitor mode interface. It attempts to configure one interface running in master mode for standard traffic and another one for authentication, keys management, etc. This method is still supported by nl80211 driver as a fallback, but is NOT supported by the Edison chipset and driver.

Later, nl80211 implemented special commands for sending management frames (NL80211_CMD_FRAME) and subscribing to them (NL80211_CMD_REGISTER_FRAME). This allowed user space to handle wireless infrastructure using a single AP interface only. This is currently preferred method that can be used with all mac80211 drivers implementing AP mode. It solves our problem here, since it doesn't require a Monitor Mode interface (which we can't do). Newer versions of hostapd have already been patched to use this method - lucky us!

The solution:

First, add the testing repository to your list of repositories:

# echo deb http://ftp.us.debian.org/debian http://ftp.us.debian.org/debian testing main contrib non-free >> /etc/apt/sources.list

Then, add an apt preference such that you don't update ALL your packages to testing versions. Unless you're into that kind of thing, I guess. As root, add these lines to /etc/apt/preferences (create the file if it doesn't exist).

Package: *

Pin: release a=testing

Pin-Priority: 900

Finally, update hostapd using the testing repo. Note which other packages will also be updated to testing versions as a result.

# apt-get -t testing install hostapd

It will ask a few questions during the install. Make sure to retain the customized /etc/init.d/hostapd provided by ubilinux. It is correctly configured for the edison. If you accidentally blow it away, here is an original: http://pastebin.com/KrvUBNDX http://pastebin.com/KrvUBNDX

It may restart a few services, like cron, while it runs. Once it's complete, double-check your configuration files (/etc/hostapd/hostapd.conf and /etc/network/interfaces and /etc/default/hostapd), and restart hostapd. Your access point should come up automagically!

 

View solution in original post