TL-WN725N Access-Point on ArchLinux + Hostapd

3

1

I bought a TL-WN725N v2 wifi usb dongle for my Raspberry.

Amazon read it would work out of the box but it didn't. So I followed several tutorials to have the driver working.

Now the problem is to make it work as an Access Point.

Here is my hostapd.conf file :

interface=wlan0
ssid=Your_AP_SSI
channel=1
## WPA and WPA2 configuration
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
## WPA settings
wpa=2
wpa_passphrase=my_secret_pass
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
## Hardware configuration
#driver=rtl871xdrv
driver=nl80211
ieee80211n=1
hw_mode=g

When I launch hostapd hostapd.conf it reads :

Configuration file: hostapd.conf
nl80211: Driver does not support authentication/association or connect commands
nl80211 driver initialization failed.
hostapd_free_hapd_data: Interface wlan0 wasn't started

Any ideas ?

Thx a lot !

ochurlaud

Posted 2014-05-31T12:34:13.940

Reputation: 65

Answers

5

Not all wifi cards, whether USB or not, can act as AP. From the look of it, it seems yours can't.

The way to find out is to issue the command

  iw list

which will have a long and really comprehensive output, where you should search for the following section:

  Supported interface modes:
             * IBSS
             * managed
             * AP
             * AP/VLAN
             * monitor
    software interface modes (can always be added):
             * AP/VLAN
             * monitor
    valid interface combinations:
             * #{ managed } <= 1, #{ AP } <= 1,
               total <= 2, #channels <= 1, STA/AP BI must match
             * #{ managed } <= 2,
               total <= 2, #channels <= 1

This is for my card, which shows the critical line: Supported interface modes: AP. As you can see, there follow also restrictions, under the heading valid interface combinations. In this special case, it means that I can use this card simultaneously in managed and AP mode, provided the two use the same channel. Which means I can set up an AP through hostapd, while I use a wifi connection to forward hostapd traffic to the Internet.

You ought to make the same check for your card.

If furthermore you wish to find out which USB adaptor can be put into AP mode, I am afraid there is no really authoritative list, mostly because of the manufacturers: for instance this Ubuntu help page states:

Be careful when buying a card for this project: - WLAN cards documented as Linux-supported often become no longer available. As a common cost-cutting measure, wireless adapter manufacturers will revise an existing product's specifications, substituting a different chipset (or other components) without changing the (formerly Linux-compatible product's) model number. Naturally, this is a common source of confusion for individuals attempting to purchase a compatible adapter, even when they think they know which adapter to buy. Manufacturers don't help matters much, often using strange naming conventions that produce numerous confusingly similar model names and numbers. Consider: At one point D-Link offered 3 different revisions (with 3 different chipsets) of its DWL-520 adapter, as well as the (completely different) DWL-520+, which was not to be confused with the entirely unrelated DWL-G520, DWL-A520, not to mention the 8 varieties of product offered under the "DWL-620" moniker. Thus it is crucially important to pay close attention not just to manufacturer/model names, but also revision numbers (if provided), chipsets, included drivers, etc, as well. (If uncertain, consider purchasing from a retailer who offers a "consumer friendly" return policy, so the product can be returned/exchanged if it turns out to be incompatible.)

After this major disclaimer, I will just say that http://www.thinkpenguin.com/ and http://linuxwireless.org/ provide lists of AP-capable adapters, and that Atheros products are often AP-capable. I regret I cannot be any more precise.

EDIT:

I have done a bit of research, and I have found out that there actually are two versions of the TP-WN725N USB adapter. v1 has Vendor code 0bda and product code 8176 https://wikidevi.com/wiki/TP-LINK_TL-WN725N_v1, while v2 has 0bda:8179 https://wikidevi.com/wiki/TP-LINK_TL-WN725N_v2. These codes, though not accessible through lspci, can be seen from the output of lsusb. You can then distinguish between the two.

Now it is important to learn which driver you are using. Since you do not have lshw (I normally run Arch, but on my Raspberry I installed raspbian, that's why...), the only way to establish which driver you are running is to do:

  lsmod | grep rtl 

It should be rtl8188cu for v1, but if you have v2 the above-referenced WikiDevi page says that there is a special, pre-compiled binary driver for the Raspberry which is located here. If you have v2, you should definitely use this.

For v1, I found this online guide, for v2 instead I found this.

One thing to check is whether you have the nl80211 driver available on your system; normally you should, but just to check, the file to be searched is mac80211.

I hope this will give you enough info to narrow down your problem.

MariusMatutiae

Posted 2014-05-31T12:34:13.940

Reputation: 41 321

@MariusMatutiae thanks for your extensive research! A helpful tutorial by a commentor in that thread worked for v2 https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=54946&sid=e010bf0c6cf529b0fcaf993711511d44&start=25#p1427675

– aaditya1234 – 2019-08-16T19:20:21.017

1The thing is that iw list doesnt return anything. Not even an error.... – ochurlaud – 2014-05-31T15:13:57.613

Perhaps the driver of your card only supports the old WEXT interface, not nl80211? Does it show up in iwconfig? – user1686 – 2014-05-31T15:55:54.570

Yes it does show in iwconfig. Is there a way to find if is AP-compatible in this command ? thx – ochurlaud – 2014-05-31T16:29:38.947

@ochurlaud Could you please post the output of sudo lshw -C network? Ty – MariusMatutiae – 2014-05-31T16:37:17.157

@ochurlaud ....and of lspci -vnn | grep -i net? Ty again. – MariusMatutiae – 2014-05-31T16:49:38.890

@MariusMatutiae Unfortunatelly, lspci doesn't work on Raspberry Pi, so there is no output except an error. For lshw, i can't find it in the repo. Something is trying to make me mad, i guess – ochurlaud – 2014-05-31T17:09:10.860

@ochurlaud Please see the edit of my answer. – MariusMatutiae – 2014-05-31T18:53:39.113

@MariusMatutiae I have definitely the v2 (I compiled myself the driver which was rtl8188eu). I'll try your link – ochurlaud – 2014-05-31T19:08:50.873

I can't edit precedent comment, so new one : It's works better with that.... Not finished. I'll tell you. Thx for your help (I've already followed this tutorial but without changing my driver) – ochurlaud – 2014-05-31T20:51:52.750

It works. Now i just to fight for finishing the configuration. Thx again – ochurlaud – 2014-05-31T23:17:11.973

2

I know this question is kind of old, but for the next ones who will have this problem, this could save them some time:

EDIT: This package has been moved to AUR archive since AUR moved to a Git backend. You can always find it here if you need it. See below for a nicer and more up-to-date solution.

Another package named hostapd-rtl in the (current) AUR provides the last version of hostapd and works with the TL-WN725N V2 device too. This package is based on the source of this GitHub repository.

Unda

Posted 2014-05-31T12:34:13.940

Reputation: 121