# USB WLAN card for AP



## JohnnySorocil (Nov 21, 2019)

Does anybody has USB WLAN card to recommend for running AP (hostapd)?
I tried multiple run and urtwn cards but they are not stable - don't know how to precise debug network setup  but there are dropped pings to Internet, sometimes internet won't work but ssh-ing to another machine will work, sometimes internet will work but ssh-ing to other machine won't, general non stability when loading web pages and so on.
The same setup and PC with all mini PCI-e ath card will work flawless. Purpose of USB WLAN card will be to put it in my ARM box (which doesn't have miniPCIe slot) to play with routing.
Thanks for any help!


----------



## SirDice (Nov 21, 2019)

If it's just to play around with routing why don't you simply use an (USB) ethernet card? Or, slightly more advanced, split up your current, single, interface using VLANs. Note however that for VLANs your switch will need to understand VLAN tagged packets. Most cheap (unmanaged) switches don't support it though.


----------



## JohnnySorocil (Nov 21, 2019)

SirDice said:


> If it's just to play around with routing why don't you simply use an (USB) ethernet card?



Because I don't want wires and router will be also used "in production" for phones and guests PCs.


----------



## SirDice (Nov 21, 2019)

Fair enough.


----------



## YuryG (Nov 21, 2019)

I am quite happy with my Ralink USB dongle in AP mode.
Was looking at this table when selected the device.
https://en.wikipedia.org/wiki/Comparison_of_open-source_wireless_drivers#FreeBSD


----------



## Phishfry (Nov 21, 2019)

RaLink with run driver is what I used on BBB and Pi


----------



## JohnnySorocil (Nov 21, 2019)

Can you tell me the exact vendor and model of the cards that you are using? Preferably with dmesg output.
I have already tried one card with run driver and it doesn't work stable (amd64 & arm tested):

```
ugen2.3: <Ralink 802.11 n WLAN> at usbus2
run0 on uhub4
run0: <1.0> on usbus2
run0: MAC/BBP RT3572 (rev 0x0223), RF RT3052 (MIMO 2T2R), address 4c:72:b9:e2:d0:d3
```


----------



## Phishfry (Nov 21, 2019)

I believe the best performing one was RA3572. It has 2T2R and worked OK under 10 yards.
Are you using FreeBSD 11.3 or FreeBSD 12?
I had set it up both BBB and Pi2 as a MiFi with cell modem and wifi.
Arm is the only platform I used these USB devices on.
I also have used the stubby single channel RT3070.
My Arm boards are not currently in use as I migrated to server learning.
What is the problem you are having? Poor reception? Crashing machine?
There was a time when I plugged in my stick the RALink firmware would crash the whole machine
But that was back when FreeBSD 11 was -CURRENT. It got fixed.


----------



## JohnnySorocil (Nov 21, 2019)

I am using 12.0 (PC laptop) and 12.1-RELEASE (Orange Pi Zero).
Does your card have PCB antennas or external? I do not need some extra lenghty reception (40-ish square meters apartment, but all my tests were performed in the same room). 
Problems which I am having are strange: sometimes internal network won't work but I can go to internet, sometimes internal network won't work but not internet. Ping will show some packages are lost (forgot exact number).


----------



## YuryG (Nov 22, 2019)

JohnnySorocil said:


> Can you tell me the exact vendor and model of the cards that you are using? Preferably with dmesg output.
> I have already tried one card with run driver and it doesn't work stable (amd64 & arm tested):
> 
> ```
> ...


I have even an older device which is Buffalo AirStation N300 USB (WLI-UC-G300HP).

```
ugen3.2: <Ralink 802.11 n WLAN> at usbus3
run0 on uhub3
run0: <1.0> on usbus3
run0: MAC/BBP RT3071 (rev 0x021C), RF RT3022 (MIMO 2T2R), address 4c:e6:76:*
```
Or this newer one D-Link DWA-140/D1B N300:

```
ugen6.2: <Ralink 802.11 n WLAN> at usbus6
run1 on uhub6
run1: <1.0> on usbus6
run1: MAC/BBP RT5392 (rev 0x0223), RF RT5372 (MIMO 2T2R), address e4:6f:13:*
```
Sometimes (rare) I see timeouts and not use it at heaviest thoroughputs but it works for months online.

And I am not sure that your instability is due to WLAN dongles (only). There could be other reasons.

The device I have real problems with is an old Atheros PCI WLAN card. It's awful, sometimes no way to make it work again but to reboot (and not always clean with this device even after reboot).


----------



## JohnnySorocil (Nov 23, 2019)

YuryG said:


> Or this newer one D-Link DWA-140/D1B N300:
> 
> ```
> ugen6.2: <Ralink 802.11 n WLAN> at usbus6
> ...


Thanks, ordered it just and and see how it will behave 



YuryG said:


> And I am not sure that your instability is due to WLAN dongles (only). There could be other reasons.


What do you mean? Replacing that with miniPCIe ath card (and changing line or two in rc.conf) resulted in normal behaving AP.
On USB WLAN AP i needed to load wlan_amrr module to have more than 1M of throughput.


----------



## Phishfry (Nov 23, 2019)

JohnnySorocil said:


> Does your card have PCB antennas or external?


External. Mine looks like this one:








						RaLink RT3572 2.4GHz & 5GHz 802.11a/b/g/n 300Mbps Wireless USB WiFi Adapter  | eBay
					

1 x NEW Ralink RT3572L Dual Band USB WiFi Adapter. This WiFi Adapter easy to use and easy to setup, it working on Samsung Smart TV with plug & play! Non product quality problems, we will not take responsibility.



					www.ebay.com
				



It is not in use currently.



JohnnySorocil said:


> wlan_amrr module


This is what was failing on Arm for me and while back with FreeBSD 11-CURRENT. I had to manually add it.



YuryG said:


> The device I have real problems with is an old Atheros PCI WLAN card. It's awful


What is the chipset here? AR5xxx was troublesome. My previous WAP (before the APU2 that I currently use) was a Checkpoint U5
It is an old Lanner box and used MiniPCI cards.
I found that Mikrotek MiniPCI modules on this box had more output power than any of my MiniPCIe cards including the Mikrotek card I ended up settling on.

```
ath0@pci0:4:0:0:    class=0x028000 card=0xd01419b6 chip=0x0033168c rev=0x01 hdr=0x00
    vendor     = 'Qualcomm Atheros'
    device     = 'AR958x 802.11abgn Wireless Network Adapter'
    class      = network
```
For $40 bucks I am happy with the Mikrotik. I also use an outdoor antenna inside that is a Terrawave


----------



## YuryG (Nov 24, 2019)

JohnnySorocil said:


> Thanks, ordered it just and and see how it will behave
> ...
> On USB WLAN AP i needed to load wlan_amrr module to have more than 1M of throughput.


The bad thing about this type of devices is that manufacturers are substituting chipsets in them without changing name, just small "revision" number (D1B in my case) that is not always even shown in pricelists.

(Wikidevi, unfortunately is down for some time.)

I have wlan_amrr in my kernel, so can't say if I actually need this or not.


----------



## YuryG (Nov 27, 2019)

Phishfry said:


> …
> What is the chipset here? AR5xxx was troublesome. My previous WAP (before the APU2 that I currently use) was a Checkpoint U5
> …


Yes, it is the case. Troublesome Atheros

```
ath0@pci0:5:1:0:    class=0x020000 card=0x3a131186 chip=0x0013168c rev=0x01 hdr=0x00
    vendor     = 'Qualcomm Atheros'
    device     = 'AR5212/5213/2414 Wireless Network Adapter'
    class      = network
    subclass   = ethernet
    bar   [10] = type Memory, range 32, base 0xfebf0000, size 65536, enabled
    cap 01[44] = powerspec 2  supports D0 D3  current D0
```


```
ath0: <Atheros 5212> mem 0xfebf0000-0xfebfffff irq 17 at device 1.0 on pci4
ath0: AR2413 mac 7.9 RF2413 phy 4.5
ath0: 2GHz radio: 0x0000; 5GHz radio: 0x0056
```
The other Atheros card (LAN, builtin on a motherboard) fails to work stable even on Windows with proprietary drivers, just stops recieving and need a reboot. So, I am definitely not their fan anyway since.


----------



## Phishfry (Nov 27, 2019)

Indeed our Atheros sweetspot is the AR9xxx series wireless drivers. Atheros Bigfoot LAN devices seem to have lots of problems.


----------



## tOsYZYny (May 30, 2020)

How has wireless worked out for you?  What are you currently using, what kind of speed and range do you get?  What do you recommend?
I am currently running a router installed with FreeBSD 12 with pf and off of that, I have a TP-Link mini router acting at a wifi pass-through as well as a DD-WRT.  I like the TP-link pass through since I can "see" each device, but if I can run a USB wifi adapter, I'd prefer to go that route.


----------

