How to config USB wifi adapter for Raspberry Pi

From TIAO's Wiki
Revision as of 23:00, 3 November 2012 by Admin (talk | contribs) (Background)
Jump to: navigation, search

10 PCS, 10cm x 10cm, 2 layers prototype for $38.80 shipped!








Buy Game Console Adapters from http://www.easymg.com or http://www.diygadget.com

Background

This tutorial helps you to manually config USB Wifi adapter purchased from 2012-10-28-wheezy-raspbian.zip on your Raspberry Pi.

These are the wifi adapters works with Raspberry Pi:

802.11b/g/n Nano USB Wifi Adapter Dongle with External Antenna for Raspberry Pi (Ralink RT5370)

802.11b/g/n Nano USB Wifi Adapter dongle for Raspberry Pi (Ralink RT5370)

802.11b/g/n Nano USB Wifi Adapter dongle for Raspberry Pi (REALTEK 8188CU)

This tutorial uses 2012-10-28-wheezy-raspbian.zip Raspbian image.

Before proceed to the steps, please have a working Raspberry Pi with above image installed.

Pre-setup

  • Power off Raspberry Pi
  • Insert the wifi adapter purchased from http://www.diygadget.com into one of the usb port on Raspberry Pi.
  • Connect your USB keyboard.
  • Connect your monitor with the HDMI cable.
  • Power on Raspberry Pi

USB wifi adapter needs additional power to work, if your power supply cannot provide enough power to your Pi, you can either switch to a better power supply or use a powered usb hub.

Config interfaces file

In console, run the following command:

sudo nano /etc/network/interfaces

This is the original content of the interfaces file:

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

If you want your router to assign an IP address automatically to your Pi, modify interfaces file to:

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
wpa-ssid <your wireless access point ssid name>
wpa-psk <your wireless access point password>
# wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
# iface default inet dhcp

If you want to have a static IP address of your Pi, modify interfaces file to:

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.0.1
wpa-ssid <your wireless access point ssid name>
wpa-psk <your wireless access point password>
# wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
# iface default inet dhcp

(Change 192.168.1.100 to the IP you want to use).


Buy Game Console Adapters from http://www.easymg.com or http://www.diygadget.com

Reference:

  1. Installing FreeNX server and NX Open Source Components


10 PCS, 10cm x 10cm, 2 layers prototype for $38.80 shipped!