morrownr / USB-WiFi

USB WiFi Adapter Information for Linux
2.65k stars 175 forks source link

USB WiFi Adapter Recommendation #241

Open niturk opened 1 year ago

niturk commented 1 year ago

Hello, I am developing a device using Debian Bookworm and I need to use a USB WiFi adapter since my device does not have built-in WiFi. The USB WiFi adapter I am looking for should meet the following requirements:

I have tried;

all worked well.

Download: 145.30 Mbps (data used: 109.6 MB) 171.98 ms (jitter: 50.25ms, low: 14.76ms, high: 366.42ms) Upload: 130.19 Mbps (data used: 184.6 MB) 23.31 ms (jitter: 4.48ms, low: 13.59ms, high: 51.74ms)

Stability is my top priority, and I do not want to encounter any driver issues or compatibility problems with future kernel updates.

Could you kindly recommend the most stable USB WiFi adapter that meets my requirements and is easy to purchase and widely available?

Thank you for your assistance.

morrownr commented 1 year ago

Hi @niturk

Stability is my top priority, and I do not want to encounter any driver issues or compatibility problems with future kernel updates.

This is the statement I will focus on. I take this to mean 24/7/365 operation with little to no downtime. This is possible.

To avoid driver issues, it will be necessary to eliminate all Realtek out-of-kernel drivers so take the following chipsets off your list:

rtl8821au - only driver is Realtek out-of-kernel and you do not want a multi-function (wifi and bt) adapter anyway. rtl8811au - only driver is Realtek out-of-kernel. rtl8812au - only driver is Realtek out-of-kernel. rtl8814au - only driver is Realtek out-of-kernel and it is not a very good driver. rtl8822bu - you do not want a multi-function (wifi and bt) adapter as they are more problematic. rtl8821cu - you do not want a multi-function (wifi and bt) adapter as they are more problematic. rtl8852/32au - only driver is Realtek out-of-kernel and it is not a very good driver. rtl8852/32bu - only driver is Realtek out-of-kernel and it is not a very good driver.

You mentioned the rtl8192eu chipset but that is single band only, right? Your first requirement was the ability to connect to 2.4 and 5 GHz bands so eliminate the rtl8192eu.

The rtl8812bu and rtl8811cu are single-function, single-state and as of kernel 6.2, have in-kernel drivers. I have been testing and the rtl8812bu in-kernel driver is stabilizing nicely in kernel 6.3 but likely will not be fully stable and support WiFi Direct until the next LTS kernel late this year.

Given that you are looking for good range and super stability, right now, the single best adapter that seems to meet most of your needs is the ALFA AWUS036ACHM. It has the stability, dual band capability, long range and 24/7/365 uptime capability. You can see it if you scroll down to the mt7610u section in the Plug and Play list:

ALFA AWUS036ACHM

It does not meet your $20 USD requirement but it is available from many retailers around the world.

Overall, the best chipsets to meet your requirements right now are the mt7610u and mt7612u and there are adapters with those chipsets down in the $20 USD area but they may not have the superb range of the ALFA adapter. There is also the new mt7921au chipset and you can see some in the Plug and Play list. The driver for the mt7921au chipset went into kernel 5.18 and has stabilized nicely but I don't think it has WiFi Direct capability yet. Features are still being added.

@morrownr

niturk commented 1 year ago

hello @morrownr

First of all, thank you for taking my message into consideration and responding to it.

I have one more question. As far as I understand, the best option for now is to proceed with an adapter that has the mt7610u and mt7612u chipsets.

So, if I install the drivers for adapters with rtl8821au, rtl8811au, and rtl8812au chipsets myself, would there be any problem if I use them with Debian and build a kiosk device using xorg and openbox? Your answer made me feel that you removed the Realtek drivers because they were not included in the kernel.

As for stability issues, you know sometimes you can't connect to the internet and you have to reset it, and it gets fixed. You never understand why the chipset is unstable, and sometimes you have to keep unplugging and plugging it in to get it to work. I don't want to experience these types of issues. As for signal stability, I will use a custom antenna placed on the top of my kiosk device. By stability, I mean that the device can connect smoothly to the Wi-Fi in the area where it is placed, which includes different types of networks such as open, web, WPA, WPA2, WPA3, and operate on 2.4 GHz and 5 GHz frequencies. I just want this device to connect and upload/download data smoothly. Would there be any disadvantages if I install these 3 drivers myself? It doesn't necessarily have to be plug and play.

morrownr commented 1 year ago

@niturk

Your answer made me feel that you removed the Realtek drivers because they were not included in the kernel.

This is correct but there is more to it than just this issue. Let me explain. I've been using Linux since about 1994 so have watched as it progressed over the years. The development models of Linux and Windows are very different and need to be understood to fully understand why Realtek's out-of-kernel drivers are problematic.

Microsoft has many full time employees working on Windows. These employees meet deadlines, code is tested and then a new version of Windows is born. At this point, many API's are locked until the next version of Windows is released. That is why Windows 7 drivers won't work on Windows 11. On the other hand, the development model of Linux is a result of making the most of the human resources that are available most Linux driver devs have day jobs and can't be forced into a deadline. To make progress and test the results, the Linux development model is such that little bites are taken instead of a big bite. That is, Linux is more or less under constant development with new stable released every 2-2.5 months.

I maintain 5 Realtek out-of-kernel drivers here at this site. During most dev cycles, the 2-2.5 month thing, I have to make changes to the code in the drivers so that they will continue to work on the newly released kernels. So, Realtek drivers require constant maintenance to continue to work. One would think that maybe Realtek would keep a download location so that newly updated drivers are available but no, they don't do that. In fact, it is very hard to find Realtek drivers and submitting an issue that needs to be fixed... ha ha ha... good luck with that. Realtek more or less uses a Windows dev model to support Linux and it works poorly.

On the other hand, Mediatek follows Linux Wireless Standards and supports their drivers in kernel. Therefore it is very possible to report bugs, submit fixes, request new features and follow along with development. You see a lot of folks submitting patches on linux-wireless that have email addresses that end with @mediatek.com. As a result, Mediatek's drivers automatically upgrade as each new kernel is released.

If your project is such that the kernel will be locked, you can get by with Realtek driver but what if you need to update kernels for security reasons? You may not be happy.

You never understand why the chipset is unstable, and sometimes you have to keep unplugging and plugging it in to get it to work. I don't want to experience these types of issues.

I understand. That is why I am recommending you use an adapter based on a mt7612u or mt7610u chipset. The in-kernel drivers meet Linux Wireless Standards and are constantly maintained and you can watch it happen.

if I install the drivers for adapters with rtl8821au, rtl8811au, and rtl8812au chipsets myself, would there be any problem if I use them with Debian and build a kiosk device using xorg and openbox?

If those are your only 3 choices, I would go with:

  1. rtl8812au
  2. rtl8811au

Try it out and see what happens. It might work well, at least for a while.

As for stability issues, you know sometimes you can't connect to the internet and you have to reset it, and it gets fixed. You never understand why the chipset is unstable, and sometimes you have to keep unplugging and plugging it in to get it to work. I don't want to experience these types of issues.

I have about 35 USB WiFi adapters. I regularly test and development things for users here. I have a guide for AP mode and some scripts for monitor mode. I have a little lab that I use to test. I understand that you want stability. For the reliability and stability to want, my answer remains, get adapters with the mt7612u or mt7610u chipsets. If you are concerned with price or availability, give me some links to places you can order from and I will suggest some adapters.

@morrownr

niturk commented 1 year ago

@morrownr

Thank you, I completely understand you. You're awesome, you wrote a very nice response. I have decided to proceed with Mediatek mt7612u. I have ordered ALFA AWUS036ACM to try it out. After using it for a long time and finishing it, I will write my experiences and feedback here.

What do you think about Realtek rtl8812bu? I have some time, and kernel 6.3 will be released very soon. Honestly, I have six months to finish the project. Should I wait and consider it as an alternative, or should I stick with mt7612u without taking any risks?

I will try mt7610u, but the lack of IEEE 802.11ac support is concerning.

bjlockie commented 1 year ago

The mt7612u has been around for many years, I would use that.

morrownr commented 1 year ago

I will try mt7610u, but the lack of IEEE 802.11ac support is concerning.

The mt7610u chipset supports IEEE 802.11ac.

The mt7612u chipset is an AC1200 class chipset. The mt7610u is a AC600 class chipset.

AC1200 supports a maximum link speed of 866 Mbps. AC600 supports a maximum link speed of 433 Mbps, On DFS channels i routinely get iperf3 speeds of around 400 Mbps with the mt7612u chipset and 200 Mbps with the mt7610u chipset. That makes sense since this is a half duplex technology.

Last note: Given your project, using adapters with removable antennas is probably a good idea as your can get antennas extender cables so you can relocate the antenna to a suitable location.

@morrownr

morrownr commented 1 year ago

What do you think about Realtek rtl8812bu?

Of the available dual band Realtek chipsets, there are two that should be of more interest to Linux users: rtl8812bu (AC1200) and rtl8811cu (AC600). Both perform well and have the advantage of having a new in-kernel driver which means they may be good devices for Linux users for many years. Once a device driver is accepted into the Linux kernel, it tends to stay there for a LONG time. I have equipment that is over 20 years old that still works fine and the drivers are still being maintained. I'm talking about equipment that had no Windows driver beyond maybe Windows XP and maybe not that. What do Windows users do when they upgrade to a version of Windows where there is no version of a driver for their hardware? A lot of good hardware goes in the trash is what happens. I am pushing in various places at this site to encourage Linux users to avoid certain usb wifi chipsets as I see the writing on the wall. The rtl8814au should be avoided. Yes, I have an out-of-kernel driver here for that chipset but it is old and not being maintained by Realtek. I is hard for me to maintain. There will almost certainly never be an in-kernel driver for that chipset. It can't even do WPA3.

The rtl8812au and rtl8811au chipsets have somewhat more modern out-of-kernel drivers but, like the rtl8814au, they are probably a dead end as they will likely never see an in-kernel driver.

Here is the backstory on the in-kernel drivers for the rtl8812bu and rtl8811cu:

Realtek does have a team that works on their non-usb wifi drivers as in-kernel. Their in-kernel rtw88 driver supports several Realtek WiFi 5 chipsets much like the mt76 supports several in-kernel Mediatek chipsets. The rtw88 was only for the non-usb chipsets but an individual did a lot of work to add usb support on his github site using the rtw88 code from the kernel. Another person took on the project to get the usb support in the kernel about a year ago. It finally was accepted into the kernel with kernel 6.2. My hat is off to the guy who did this.

As of kernel 6.3, the rtl8812bu in-kernel driver is looking pretty good. There are a couple of pending patches that may make it in before 6.3 is released. As time passes, the driver will likely be good. What is really encouraging is that one of the Realtek kernel devs that works on the non-usb drivers is actually helping with this effort by checking things against internal docs and making code suggestions. This is a big help and maybe someday Realtek will have their usb team working with the kernel devs to do things the right way. You, there is a BIG difference in how Realtek and Mediatek handle their usb drivers. If you follow linux-wireless, you will see a constant stream of patches coming from kernel devs that have email addresses that end with @mediatek.com. This is similar to what your see with Intel and Qualcomm with their wifi drivers. So, the message I am trying to make is that there is a BIG difference between Mediatek usb wifi support for Linux and Realtek's.

I hope this information has been helpful.

@morrownr

morrownr commented 1 year ago

I was just thinking: Since you have a long period of time to complete your project, maybe you should look into the mt7921au chipset as well. I did not include it as a recommendation since your priority seemed to be rock solid stability. While a lot of work is still ongoing on the mt7921u (for the mt7921au and mt7922u chipsets), I find the chipset and driver to be really stable for the things I do which mostly included managed, AP and monitor modes. One guy here was reporting a couple of things i could not duplicate so far but I think most people are seeing really stable results at this point. The mt7921au chipset is a tri-band WiFi 6 chipset. There are 6 known adapters available and 4 of those are listed in the Plug and Play list (Menu Menu item 2). The high end Netgear and Alfa adapters are not cheap. I can't wait until we see adapters based on the mt7922u... tr-band plus 160 MHz channel width but the prices could be really high.

I must say that the mt7921au chipset is fast. You can see my speed test in Main Menu item 13.

niturk commented 1 year ago

I will continue with mt7612u for now. I will use the ALFA AWUS036ACM card in all my tests. There is no rush for the WiFi adapter at the moment, but when I am closer to finishing my project, I will check your list again and get any updates. Maybe we'll see different adapters on the market by then.

I am grateful for all your help. You're awesome.

morrownr commented 1 year ago

@niturk

You are welcome. Stop by anytime and let us know how your project turns out.

I am going to reopen this issue as it contains good information for others. If you prefer that the issue is closed, please close it again and I will leave it alone.

Regards

@morrownr

punkplayer1 commented 1 year ago

What about COMFAST CF-953AX? Actually work ootb mit kali. Anyone tested it yet

bjlockie commented 1 year ago

I think there are a few COMFAST CF-953AX with different usb ids.

Mine is:

$ lsusb  Bus 001 Device 006: ID 0e8d:7961 MediaTek Inc. Wireless_Device

There are newer ones that require of 6.1? kernel.

I think some are 0e8d:6211 (I don't remember).

morrownr commented 1 year ago

Hi @punkplayer1

I've been moving and my lab is not setup yet so it will be a while before I can test Kali but...

I do have two adapters with the same chipset as the cf-953ax and I can do some testing if you tell me what to test.

It might be a good idea to start a new issue so that this question gets more exposure. I've seen reports that the driver, mt7921u, is doing well with monitor mode.

morrownr commented 1 year ago

I think there are a few COMFAST CF-953AX with different usb ids. Mine is: $ lsusb  Bus 001 Device 006: ID 0e8d:7961 MediaTek Inc. Wireless_Device There are newer ones that require of 6.1? kernel. I think some are 0e8d:6211 (I don't remember).

If you go to Main Menu item 2, the Plug and Play list, and go down to the CF-953AX entry, I have an explanation about the multiple VID/PID's and some options.

punkplayer1 commented 1 year ago

Hi @punkplayer1

I've been moving and my lab is not setup yet so it will be a while before I can test Kali but...

I do have two adapters with the same chipset as the cf-953ax and I can do some testing if you tell me what to test.

It might be a good idea to start a new issue so that this question gets more exposure. I've seen reports that the driver, mt7921u, is doing well with monitor mode.

I am interested in pentesting especially monitor mode and packet injection. Yesterday i managed to install rtl8812au drivers on vm. I wonder if mediatek drivers are really plug and play. The alfa awus036axml is also interesting but not really available in europe.

morrownr commented 1 year ago

I am interested in pentesting especially monitor mode and packet injection.

15:22:16  Trying broadcast probe requests...
15:22:16  Injection is working!
15:22:18  Found 11 APs

15:22:18  Trying directed probe requests...
15:22:18  10:33:BF:60:FA:3C - channel: 44 - ''
15:22:19  Ping (min/avg/max): 1.261ms/3.362ms/4.508ms Power: -35.00
15:22:19  28/30:  93%

15:22:43  10:33:BF:60:FA:3B - channel: 44 - 'CoxWiFi'
15:22:43  Ping (min/avg/max): 0.814ms/3.473ms/4.399ms Power: -35.00
15:22:43  30/30: 100%

15:22:49  10:33:BF:60:FA:3A - channel: 44 - ''
15:22:49  Ping (min/avg/max): 1.222ms/3.437ms/4.872ms Power: -35.00
15:22:49  28/30:  93%

15:22:49  10:33:BF:60:FA:3E - channel: 44 - ''
15:22:50  Ping (min/avg/max): 1.340ms/3.363ms/4.492ms Power: -35.04
15:22:50  27/30:  90%

...

I wonder if mediatek drivers are really plug and play.

If you go to Main Menu item 2 and start reading, you will have guidance.

The alfa awus036axml is also interesting but not really available in europe.

Have you checked with the Alfa dealers in Europe? You can go to Main Menu item 2 and scroll down to the Alfa awus036acm as it will show links to multiple European Alfa dealers.

Alfa ACM

Amazon.it - 51 EUR - Italy - Alfa AWUS036ACM

getic - 32 plus VAT EUR - Latvia - Alfa USB Adapter AWUS036ACM

(out of stock) Varia - 42 EUR - Germany - AWUS036ACM - 802.11ac Dualband-WLAN-USB-Adapter 2,4/5 GHz

There are other Alfa dealers so a search might be in order. I don't list all as this is already a big job.

punkplayer1 commented 1 year ago

Thanks for showing the injection tests!

Actually i mean the awus036axml which doenst have same driver like acm. Your right acm is available often

morrownr commented 1 year ago

Actually i mean the awus036axml which doenst have same driver like acm. Your right acm is available often

I worded myself poorly. Any Alfa dealer that carries the ACM can get the AXML. You can call or email Varia or the other European Alfa dealers to ask when they will or can get the AXML in stock.