Search This Blog

Tuesday, June 5, 2018

Wireless usb CentOS Fail

I have an Edimax usb wifi (EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS], uses the rtl8192cu driver) adapter for my headnode (because the router is too far from it to run a network cable easily). It works most of the time, but will randomly cut out. I have to either bring the interface down and up again, or unplug and plug it back in every time it does that, which is annoying. I wrote a script that monitors the wifi with ping and brings the interface down and up whenever it stops working, but it's an ugly fix. It sounds like a power saving issue, but the network manager power save feature was already off: iw dev wlan0 get power_save. If yours isn't already off, you can set it off with that command: iw dev wlan0 set power_save off, but it won't be persistent across reboots. I went ahead and followed these instructions anyways. I created a wifi-powersave-off.conf file under /etc/NetworkManager/conf.d with the following in it:
# File to be place under /etc/NetworkManager/conf.d [connection]
# Values are 0 (use default), 1 (ignore/don't touch), 2 (disable) or 3 (enable).
wifi.powersave = 2
This didn't seem to do anything, as expected. The next thing I tried was a kernel setting. These particular usb wifi adapters were pretty popular for the raspberry pi a few years ago, and they had the exact problem I've been having. I followed these instructions (link) to create a 8192cu.conf file in /etc/modprobe.d/ with the following lines:
# prevent power down of wireless when idle
options 8192cu rtw_power_mgnt=0 rtw_enusbss=0
I then unloaded and loaded the driver using rmmod rtl8192cu and modprobe rtl8192cu. Besides that, I and google seem to be completely out of ideas. Update (a few months later): this usb adapter finally died on me. May have gotten a bad one, which could account for the above problems.

I purchased a TP-Link TL-WN722N wifi usb adapter because a lot of people said it works well with Linux. It works without doing anything in Ubuntu 18.04, but it does not work well with CentOS. lsusb sees a device, but there aren't any compatible drivers installed. This particular one has a "V2" next to the FCC ID, but a "V3" in the serial number box. I tried downloading both V3 and the V2 linux drivers from TP-Link and compiling them, but they won't compile due to what looks like various syntax or coding errors. CentOS7.5's kernel version is within the supported range, so that's not the problem. I tried a bunch of fixes from google, including some sort of kernel driver firmware htc thing and a elrepo kmod package, but neither worked because I think they're only for the V1 version. I ended up giving up on it.

There are very few USB wifi adapters that will actually work with CentOS. Aside from the partially working Edimax one and thinkpenguin ones, I haven't found any others.

I also tried a cheapo usb wifi adapter based on the MT7601u. There is a linux driver, but again, I couldn't get it to compile on CentOS7.5. I'm probably doing something wrong, though. I don't understand toolchains and linux source and all of that stuff, though I do have gcc and the kernel source/headers installed.

I also tried a TP-Link TL-WN823N v3. Many of the reviews on amazon said it would work with various linux distros. No luck. lsusb sees a device, but no pre-installed drivers. I downloaded the drivers from jan 2018 for linux, and managed to compile and install them after following the instructions and editing the makefile. However, centos thought it was a usb-ethernet, not usb-wifi device. No matter what I tried to do with network scripts, I couldn't get it to come up as a wifi adapter, so I couldn't select the network and enter the password, so it didn't work. UGH

I caved and purchased a Think Penguin Wireless-N usb wifi adapter. They're about $27 on US eBay. It just works with CentOS 7. However, I had to use nmtui to delete the old wifi connections before plugging it in, or no wifi adapters would work. Probably some sort of conflict from trying to connect to the same wifi network with different hardware. The only downside is that it doesn't work with windows, so if I boot my windows drive, I have to switch USB adapters. Can't win 'em all I guess....

No comments:

Post a Comment