Wifi USB adapter N300 in Ubuntu server

In my living room, I have a home theatre PC that runs Ubuntu 14.04 with Kodi (formerly XBMC). I wanted to reduce the amount of cables under my TV, so I bought a Sitecom N300 Wi-Fi USB adapter.

It turned out to be pretty easy to configure it from the command-line. Here’s a short guide for you to follow.

First make sure that the kernel drivers are loaded via lsmod | grep rtl and seeing rtl8192cu  in the output. Then you need to install the wpasupplicant  package, which can manage connections to WiFi base stations:

towel:~$ sudo apt-get install wpasupplicant

We need to create a config file for this package, as follows.

towel:~$ sudo wpa_passphrase Blauwmutsenpad > /etc/wpa_supplicant.conf
# reading passphrase from stdin
typeyourpassword
network={
	ssid="Blauwmutsenpad"
	#psk="aoeuaoeu"
	psk=52e832cb10afa74d405f66c12629d79e06da0a8abc3f6f963e4f617217fdd1b5
}

You should replace Blauwmutsenpad by your own network’s SSID, and typeyourpassword by the password to your network.

Make sure you remove the line with the plaintext password from the file /etc/wpa_supplicant.conf  after you’ve created it.

Then we need to tell the network system that there is a wireless network card. To do that, we add the following to /etc/network/interfaces :

auto wlan0
iface wlan0 inet dhcp
wpa-driver nl80211
wpa-conf /etc/wpa_supplicant.conf

After that, you can activate the wireless connection with:

ifup wlan0

The wireless connection will also be activated automatically after booting.

This entry was posted in linux and tagged , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *