OpenWrt Forum Archive

Topic: Support for USB Wi-Fi devices

The content of this topic has been archived on 26 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I'm trying to create a travel-sized router with the AP/LAN interface in the 5 GHz band, and the Internet/WAN interface either a 2.4 GHz Wi-Fi client or Ethernet.

There are very few choices for 5 GHz USB  Wi-Fi devices with Linux support.
I have a USB Wi-Fi device with the Ralink 5572 chipset. 

Would OpenWRT support the mode of operation where a USB-connected device is the AP, and another USB Wi-Fi device served as a client on the WAN interface?
Could OpenWRT run on a Raspberry Pi and do that with two USB Wi-Fi devices?
Could OpenWRT run on a TP Link TL WR703n and have the 5 GHz Wi-Fi device plug into its USB port?

I'd appreciate any suggestions,

OK, I have 15.05 Chaos Calmer installed and running on the raspberry pi 2.  It sees the Ethernet and is running a DHCP server on that port.
However it does not see the USB Wi-Fi at all.

Basic debugging commands like "sudo lsusb" don't work
lsmod does not show rt2800usb or mac80211 or cfg80211

cat /etc/network/interfaces give "not found"

Is there any tutorial on setting up USB WI-Fi devices in the OpenWRT environment?

Here's what I'm trying to do ultimately: PunBB bbcode test

(Last edited by timg11 on 14 Feb 2016, 03:06)

To get my Ralink USB to work on my raspberry, i recompiled the trunk and included the Ralink modules in menuconfig.

It sounds like you are trying to reinvent the wheel.

If you go to the Table of Hardware (Details) and sort the Device Type for "Travel" you will find a number of devices which already perform the role, some include batteries.  All are a single radio on 2.4ghz at the moment, but a second radio does work on the USB adapter.  https://wiki.openwrt.org/toh/views/toh_ … ll?dataflt[Device+Type*~]=travel

There are issues with a USB device.  Basically they seem to run slower than the single radio, but I have not tried a 5Ghz device. 

There are issues with a single radio, basically if the WWAN is not available, the WLAN will hang.  There are two basic solutions.  One is to just kill the WWAN and the other to change the WWAN if it fails. 
1 - https://forum.openwrt.org/viewtopic.php … 30#p278230
2 - http://www.gl-inet.com/forums/topic/wif … post-11953

The GLI routers have a proprietary interface which makes connections easy and come with OpenWrt installed.  You can attach solution 1 to the reset button (I have this running). 

HooToo and Kingston both have battery powered routers (among others) with good threads and OpenWrt support.  I am using the Kingston right now, but still building it out.   I also run a HooToo (non battery) with a second adapter (USB).  You really want a device with a programmable button and not all do (including the Kingston)

You need to install basic USB support first, then your driver.  I think that's all.
https://wiki.openwrt.org/doc/howto/usb.essentials => first 4 items for sure.
I do not think you should need to compile your own to make it work.  Just install packages.
I have an EDImax 7811, and replaced it with a faster Buffalo WLI-UCGN.  Not as small, but runs better.

You may want to check to see what is supported in the newer linux kernel for DD as opposed to CC, then check your selection against trunk as this might get you newer\more 5GhZ driver options.

Please detail what 5GhZ devices and drivers you use and test, good and bad.  There is no good place to note this info.

(Last edited by RangerZ on 14 Feb 2016, 06:58)

@RangerZ, thank you for the helpful information. I really don't want to reinvent the wheel, but I have searched for an appropriate dual-band travel router, and all that I have found have significant limitations.  My requirements:
1) the LAN AP at 5 GHz
2) the WAN client side, either Ethernet or Wi-Fi
3) Flexible configuration mechanism for WAN port Wi-Fi client connection  (I have tried to use various Wi-Fi to Ethernet clients, but they fail to connect to many hotel networks)

I will examine all the OpenWRT compatible travel routers you mention.  One question - since they come with a 2.4 GHz radio, and I will be adding the 5 GHz by USB, is it possible to make the USB radio the AP, and the built-in radio the WAN client?

I understand the single-radio issues, thus my intention to use two radio.

Thanks for the link on the usb essentials, I'm heading there now.

I have been working with the Ralink 5572 chipset which is in the Rosewill RNX-N600UB (probably others). I have made it work under Raspbian with the nl80211 driver and hostapd.  But there are a variety of problems, and I can't seem to keep the AP running over time:

First this issue with bridging. Still not solved, just commented it out of /etc/network/interfaces to concentrate on getting the AP function to work.  This post also has all the driver and configuration info for the Ralink 5572.

Then this issue with hostapd, that I was able to fix by stumbling on rpi-update.

Then this issue with hostapd and enabling 5 GHz channels.  Still no solution - was working on shell scripting work-arounds.

Latest is this issue where the wlan0 interface for the AP loses its statically configured IP and reverts to APIA.  I rolled back the changes for NAT routing, but it still happens.  Before I didn't let it sit long enough. Somehow a DHCP client function is also claiming wlan0 and overriding with APIA, even though I have it set for static, and have a DHCP server on that interface.

So you can see I've been working on this for weeks, and posted lots of questions in Raspberry Pi forums, and nobody has replied with any answers.  So I thought I'd look at OpenWRT, which is already optimized to be a router. And, I _really_ appreciate you took the time to post a reply! big_smile big_smile

(Last edited by timg11 on 14 Feb 2016, 17:56)

I have reviewed all the travel routers in the Table of Hardware.
I don't want one with a battery since it adds weight, and I don't need that capability.

The key question is if OpenWRT can support the LAN side AP on a USB WLAN radio.
They seem to provide the USB for plugging in a 3G/4G dongle, which would provide a WAN interface. 
I will want to make the built-in 2.4 GHz radio (or the Ethernet) the WAN interface, and have the 5 GHz USB WLAN dongle provide the LAN AP.

Does OpenWRT support that?

yes. even more than that, depending on the chipset/driver support you can choose other modes than AP/STA like WDS, mesh etc.

Confirming anarch99's response, yes.  You can assign wich one you want in the wifi tab. You should see radio0 and radio1.  Choose the scan button on radio 0 to find an AP.  Add your WLAN on radio 1.

I am curious why you want a 5Ghz on the WLAN side.  Not that this is a problem, well actually it is.  These devices are far and few in between working.  Your speed will still be relegated (for internet) to the performance of the WLAN\WAN side?  The only up side I can see is media sharing.

You beat the radio issue with 2 - 2.4Ghz radios.  Doing it on may HooToo.

FYI, Kingston has just released a new dual band device (both inside) called the MLWG3, however no one as yet has reported cracking the case.  http://www.kingston.com/us/wireless/wir … ders#mlwg3

Why use 5 GHz for the LAN?  Well, this is a travel router for use in hotels. I have a notebook computer, a tablet, and a phone that I want to be able to communicate with each other on a private network. Some media sharing, and general file transfer between these devices. Range is a few meters, within a room, so the shorter range at 5 GHz is not an issue. Most hotels have dozens of APs visible in the 2.4 band. Add to that many individual's running their own hotspots also in the 2.4 GHz band, and then add the illegal jamming behavior some hotels do to try and block private hotspots, and the 2.4 GHz band is not very attractive. 

I agree that a two radio setup with the LAN on channel 1 and the WAN on channel 11 (or the reverse depending on the strength and channel of the best AP for the WAN to connect to) is also workable, and definitely better than single radio devices.

So for next steps, I guess I need to determine if OpenWRT can support my Ralink 5572 dongle.

Then I can select one of the travel routers that are supported and have a USB port.    Which would you recommend in terms of performance, stability, reliability, build quality, etc?  I'm looking for something small and light, that will always work, and be flexible and configurable enough to deal with various networking situations I find in various places.  My short list at the moment is Alfa AP121U, TP-Link TL-MR3020, A5-V11 Mini Router. The WLAE-AG300N looked interesting, but seems to be discontinued, with a few places selling it for about $150US.  The Kingston  MLWG3 looks good if it is ever supported.

(Last edited by timg11 on 15 Feb 2016, 00:18)

Good answer!

I have a GLI-AR150 that I spent 6 weeks traveling with recently.  I did not use it with a second radio however.  It comes with OpenWrt and a GUI by GLI.  The GUI is real good at managing the AP side connection (incorrectly called a repeater).  It has a AR 400mhz cpu and 16/64 for memory.  Comes setup with USB for file sharing and will support a camera.  They now have a newer version with an MT7620n 580mhz, (MT300N) and soon will have another with a 128MB (MT300A).  I think the AR150 is in trunk, and GLI has a CC version without their GUI, but I like it.

Guessing only at 2.4.  I use the driver in a buffalo device I have on my HooToo.  I get about 7mbps with it.
https://wikidevi.com/wiki/Ralink_RT5572

In general, you'd have more fun with using USB wlan cards in STA mode, rather than AP mode. AP mode needs a wlan card and a driver that are optimised for it - something you rarely find in a USB device, with the firmware often been an additional limiting factor. Unfortunately this is a problem for your plans in terms of radio distribution, as most cheap routers only come with a 2.4 GHz radio and retrofitting a 5 GHz USB wlan card appears to be the easier solution - until you fall over the troubles of using 'any' given USB wlan card as AP...

If size isn't a particular dealbreaker, consider going with a normal dual-radio router instead, rather than a dedicated/ small mobile variant.

(Last edited by slh on 15 Feb 2016, 00:52)

Its not actually that hard to find 5Ghz USB adapters that work in OpenWRT any more.  I'm currently using http://www.amazon.co.uk/gp/product/B00P … ge_o09_s00

However, I have tested a few and their range is vastly inferior to a proper router with native 5Ghz support.  I don't think they can have the same grade amplifiers in USB devices or they would overheat, plus the current limited to 500mA may also be a factor.

as long as you have RP-SMA connector on a usb device the range shouldn't be the an issue. you can always replace antenna with higher gain one.

regarding AP mode with usb device I don't think you need any special optimisations, it is enough the driver does not contain any major bugs. put my TL-WN722N card into AP mode and measured about 75Mbps with iperf which is about 50% of nominal speed. the same you will get with most wifi devices.

Which is exactly the problem, there are AP mode specific bugs unless the vendor explicitly tests AP mode - because AP mode needs features of the wlan card beyond those needed for STA mode. Now with USB devices, a significant share of features move from the driver (which can be fixed) to the firmware (which is mostly a black box) as the USB bus is a bottleneck (especially when it comes to latency),

Given that USB wlan cards are rarely used for AP mode in commercial settings, no one who has access to the firmware source or has the financial leverage to influence the chipset vendor to care provides the motivation to fix it.

(Last edited by slh on 15 Feb 2016, 03:32)

anarchy99 wrote:

as long as you have RP-SMA connector on a usb device the range shouldn't be the an issue. you can always replace antenna with higher gain one.

regarding AP mode with usb device I don't think you need any special optimisations, it is enough the driver does not contain any major bugs. put my TL-WN722N card into AP mode and measured about 75Mbps with iperf which is about 50% of nominal speed. the same you will get with most wifi devices.

Its not about the speed, its about the range and quality.

Sure I can get a good speed when on top of the router, but move further away or into another room and the signal is basically unusable.  With the 5Ghz on a PCIe card I can get a decent signal through brick walls quite easily.

We are talking about the difference between about -70dBm and -50dBm signal when in the same room, even with high-gain antennas on the USB adapter.  Ones with only built-in antenna are even worse.

This has always been the case in my experience.  PCI/PCIe adapter have vastly superior range to any USB device.  I have even tried those USB adapters combined with directional antennas and any half decent router with a couple of dipole antennas on beat the pants off it, even when both were in line of sight.

well, 5GHz is less used so there is less support for it. maybe your card driver has some bugs and we don't even know what chipset it is so it's just a guess. not so long ago even the 2.4GHz devices which are suppose to have good support had bug that affected range -> https://bugzilla.redhat.com/attachment.cgi?id=742693

another problem are stubborn manufacturers who fill out low values into EEPROM and then sell these adapters cheap claiming they are 20dBm or 27dBm output.

@slh - Yes, overall size is pretty important to me. I want to tuck this into a small pocket in my computer bag, which is already far to heavy. I'm now using a 2.4 GHz Zuni that is 15x40x55 mm and maybe 50 g.
RE the AP bugs - that's why I shelved my Raspbian development effort and am now looking at OpenWRT. I was hoping the AP implementation in OpenWRT would be better. But you're saying it might not help because of fundamental bugs or missing features in the USB devices.

@Alex Atkin UK, so are there any travel-size router platforms that have a PCIe slot? Maybe that's the way to approach this rather than USB for the AP? I have a dual band PCIe WLAN module taken out of a notebook, which is about the size of a postage stamp.

To answer my own question, yes there is a small platform with PCIe - the Intel Gallileo.
Of course driver support is still a question. 

Then there is the Intel Edison platform - dual band Wi-Fi built in.  I wonder if anyone has a working AP implementation?

GLI has this board right now.  http://www.gl-inet.com/m9331-mifi/
They are working on a case. http://www.gl-inet.com/forums/topic/gl-mifi-case/
It is intended for a 3G/4G pci-e card, but I don't see why one would not work.
More info: http://www.gl-inet.com/forums/topic/mif … art-guide/
http://www.gl-inet.com/download/mifi/

This is the only travel device that I am aware of with this support.

Regarding functionality, I am using this solution which offers the ability to store a list of known APs and recover to those APs when in range, otherwise it will disable the current AP.  It's as close to the functionality one generally expects on a wireless client that I have found in OpenWrt.  It has some issues that are beyond my ability to resolve, however they have workarounds.  It's designed for a single radio solution, not sure how it will work with a multi-radio solution.  I think it will work as long as the STAtion is the last (second) wifi-iface.
http://www.gl-inet.com/forums/topic/wif … saved-aps/

Yes, the GLI mifi looks attractive.  How would I go about finding a dual-band Wi-Fi PCIe module that is supported?  Is support determined only by OpenWRT, or also based on the CPU (Atheros AR9331)?

This article claims the Intel 6300 Ultimate N 633ANHMW (which I have a spare) is supported by Linux. But which Linux? On which CPU?

first check if the GLI supports both WLAN and WWAN cards. from a quick look at the picture it is obvious it has USB D+ and D- lines that are used for WWAN cards via USB protocol but the question is are the rest of connected pins enough for WLAN cards that use PCI protocol.

I am telling you this from my own experience. first router I managed to run openwrt on was 3G but could not detect WLAN card in mPCIe slot.

even more dumber than it's manufacturer was HP who didn't provide USB lines in a laptop's mPCIe slot I'm using so my new WLAN+BT card's bluetooth doesn't work..

timg11 wrote:

How would I go about finding a dual-band Wi-Fi PCIe module that is supported?

I would post a new topic for "MyFi Wireless Adapters and Drivers" on the GLI forum.  I know they understand the radio issues and are probably best able to tell you what (may) work or has been tested (if any).

I wanted to report back on what I learned at GLI forum. In summary, their PCI-e board design is really just USB in a PCI-e form factor.  So there is no benefit over normal USB dongles (as far as I can tell).

The discussion might have continued from here.