Mirror of the Rel4tion website/wiki source, view at <http://rel4tion.org>

[[ 🗃 ^yEzqv rel4tion-wiki ]] :: [📥 Inbox] [📤 Outbox] [🐤 Followers] [🤝 Collaborators] [🛠 Commits]

Clone

HTTPS: git clone https://vervis.peers.community/repos/yEzqv

SSH: git clone USERNAME@vervis.peers.community:yEzqv

Branches

Tags

master :: people / fr33domlover /

jfm-wifi.mdwn

I work/ed with a laptop at job-for-money whose wifi hardware requires proprietary software to work. I decided to buy an adapter to solve this problem:

https://www.thinkpenguin.com/gnu-linux/penguin-wireless-n-usb-adapter-gnu-linux-tpe-n150usb

There are several other adapters there.

On Trisquel 7, it seems to work out of the box. But on Debian 7, I needed to do some extra steps to make it work. I didn’t thoroughly check which ones are strictly required and which depend on your computer model and so on - this page is here simply to help you and me do the same process by listing some useful steps. I struggled with it a bit and got help from nice people on IRC (I first tried #fsf without much success, but on #debian I got help), so I realized it could be useful to document what I eventually did to make it work.

First of all, the following pages on the ThinkPenguin website provider a starting point. After following their instructions I still didn’t have working WiFi - perhaps because I don’t use NetworkManager - so I’m just listing here everything I did.

The following is for Debian 7 stable. For Trisquel 7, I just needed to insert the adapter and configure the wlan1 interface (if you use NetworkManager, you can probably just click in the panel, choose a wireless network and connect).

The Steps

Upgrade the Kernel

First, I upgraded the kernel. The pages linked above say that at least Linux 3.5 is required for one of the adapters. Not the one I use, but I decided I could upgrade the kernel anyway in case it does matter. 3.2 is somewhat old anyway and it’s just a laptop, so stability isn’t as critical as on a server. If you do use the NUSBDB adapter, you’ll probably need this. So here’s the easiest way to do it.

If you don’t use the backports repository yet, enable it by adding the following line to /etc/apt/sources.list.

deb http://http.debian.net/debian wheezy-backports main

Now update the local package list:

# apt-get update

At the time of writing, the backports kernel is Linux 3.16. You can install it easily alongside the current one, and choose which one to boot in the GRUB menu. After installation, the new kernel will become the default, but that can probably be changed easily.

# apt-get -t wheezy-backports install linux-image-3.16.0-0.bpo.4-amd64

There are several other packages such as the linux-headers and the linux-tools. If you’ve been using them, you can install them too.

Get Free Firmware

According to packages.debian.org, there is proprietary software in Debian’s nonfree repository, including some firmware that could make your adapter work. Don’t use it - it’s proprietary! Instead, ThinkPenguin.com provides free firmware for the adapter. Possibly it’s been packaged for later version(s) of Debian, but not for Wheezy. You can download and “install” it like this:

# cd /lib/firmware
# wget https://www.thinkpenguin.com/files/ath9k_firmware_free-version/htc_9271.fw
# wget wget https://www.thinkpenguin.com/files/ath9k_firmware_free-version/htc_7010.fw

The first file has a more recent (currently beta) version that solves issues on some computers. You can wget it from here.

Set the Regularity Domain

I’m not sure it’s required, but the website recommends it to avoid connection speed issues. You’ll need to know your country code. For example, it’s US for the united states and IL for israel. For the example I’m assuming IL.

# apt-get install iw
# iw reg set IL

Then go to /etc/default/crda and set REGDOMAIN=IL.

Blacklist Proprietary Modules

You will hopefully be able soon to remove any proprietary software your wifi software required. If it never did, you can skip to the next step. Otherwise, a first step towards removing nonfree software is to blacklist the kernel module of the wifi hardware. You’ll need to find out which module to blacklist. You can run

# lspci -v

find the wifi device and see which kernel module is in use for it. Let’s assume the module is called wl. Then you can blacklist it by creating a file /etc/modprobe.d/my-blacklist.conf which contains the text blacklist wl. You can list more modules if needed - see the other files in that folder, or the Debian wiki.

Reboot

You can reboot from the terminal like this:

# reboot

Configure the Network

If you use NetworkManager, you should be able to see the wireless networks in the GUI applet (if not, perhaps you need the beta version of the firmware). Otherwise, let’s proceed.

If you haven’t already, plug the adapter into a USB port. Then see if it works by running:

# ifconfig -a

You should see wlan0 for the internal wifi device and wlan1 for the new USB adapter. If you don’t see the adapter, try

# lsmod

and see if the required modules are there. You can pipe it to grep htc or grep ath9 and see if you see familiar names. If you do, go to

# dmesg | less

And look for errors related to the adapter. You can for example search for “ath9” by typing /ath9 and hitting Return while in less. If you use “failed to allocate URBs” or a similar error, either you missed some step or you need the beta version of the firmware or I have an error here in this guide or your hardware requires some extra step which my didn’t. Try IRC and web search, or contact ThinkPenguin if none of that helps.

If you do see the new adapter, great. Just in case your interface numbering is different from mine, you can see which device got which number in the file /etc/udev/rules.d/70-persistent-net.rules.

If you use wicd or some monitoring applet that needs to have the network interface set manually (e.g. on XFCE or LXDE), make sure yo set it to the correct value, i.e. the adapter’s interface. In my case, it’s wlan1 while wlan0 is the computer’s integrated wifi chip.

If you don’t use any connection manager, not even wicd, you’re probably familiar with /etc/network/interfaces. In that file, make sure you use the adapter’s interface number and have the correct settings. Networks, usernames, passwords and so on. You’ll probably just want to fix the interface number, e.g. replace wlan0 with wlan1.

Connect

If you use some connection manager, use whatever UI it provides. Otherwise, the command

# ifdown wlan0

should bring down the current interface. If you’ve been using a wired connection, you probably want:

# ifdown eth0

Now it’s time to start the adapter’s interface:

# ifup wlan1

Of course the command may be slighly different depending on your interface numbers and interface configuration, but if you manage these things manually you probably know what to do. Anyway remember man is your friend, and the Debian wifi is often too.

Issues

If you need to get the integrated wifi device to work, you’ll need to load the blacklisted module(s) manually. The following loads the wl module:

# modprobe wl

and the following unloads it:

# modprobe -r wl

I’m using the beta firmware and from time to time the connection is suddenly lost. One or two unplugs-replugs of the adapter and ifups bring the connection back. Whether it’s because the firmware is beta or because of USB issues or something else, I have no idea. The ThinkPenguin pages have more info and you can always contact them if nothing else helped. Since I just got the adapter myself, I don’t have any long time experience yet, but I’m always open to any questions and comments.

Comments and Thanks

Thanks to ThinkPenguin for their wonderful freedom respecting products. Thanks to the people on IRC for helping me figure things out.

This website is a wiki, so feel free to make improvements and send me comments and suggestions and errors you noticed and so on - everything is very welcome. If you have a big change to make, and you’re not sure it’s okay to make it in the wiki without asking, you can either ask me first or make it in a local text file and send me (tabs at the top of each page can take you do the source) or work on a local git clone (this wiki is a git repo with markdown files) and send me a patch. See [[here|fr33domlover#Contact_Information]] for ways to contact me.

[See repo JSON]