element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • Experts & Guidance
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • Product Groups
  • Store
    Store
    • Visit Your Store
    • 'Choose another store...'
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Personal Blogs
  • Members
  • More
Personal Blogs
Legacy Personal Blogs Adding WiFi to a Raspberry Pi
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Former Member
  • Date Created: 27 Jul 2013 2:56 PM Date Created
  • Views 508 views
  • Likes 0 likes
  • Comments 0 comments
  • wifi
  • raspberry_pi_network
  • raspberry_pi
  • wireless
  • raspberry_pi_accessories
Related
Recommended

Adding WiFi to a Raspberry Pi

Former Member
Former Member
27 Jul 2013

Adding a WiFi option to the Raspberry Pi is an easy way to set your raspberry free so you dont have to worry about running network cables when deploying a raspberry pi project.

This guide is based of a how-to I wrote for the raspberrypihq.com website - an execellent resource for raspberry pi projects.

Equipment

You are going to need the following:

  • A Raspberry Pi
  • A USB WiFi Adapter (I use the Edimax - Wireless 802.11b/g/n nano USB adapter)
  • A SD Card flashed with the Raspbian OS (Here is a guide if you need)
  • Access to the Raspberry either via keyboard and a monitor or remotely

 

Adding WiFi adapter to the Raspberry Pi

Plug the USB WiFi adapter into one of the free USB ports on the Raspberry Pi. Power up the Raspberry Pi - remember at this point the WiFi adapter does not work yet. You are still going to need some other means of being able to control the Raspberry Pi either via a keyboard or remotely using a wired network connection. 

 

To verify the WiFi adapter was detected after boot run the following command:

 

dmesg | more

 

You can use the spacebar to scroll down a page at a time - towards the end you will see something similar to the following lines:

 

[ 3.282651] usb 1-1.2: new high-speed USB device number 4 using dwc_otg

[ 3.394810] usb 1-1.2: New USB device found, idVendor=7392, idProduct=7811

[ 3.407489] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3

[ 3.420530] usb 1-1.2: Product: 802.11n WLAN Adapter

 

 

 

 

This means that the operating system recognized the USB WiFi Adapter. All that is left is to configure your WiFi connection.

Configuring the WiFi network

On the Raspberry Pi (and on Linux in general) you configure your network settings in the file "/etc/network/interfaces".

 

Edit the file using the following command:

 

sudo nano /etc/network/interfaces

 

To configure you wireless network you want to modify the file such that it looks like the following:

 

auto lo

iface lo inet loopback

iface eth0 inet dhcp

 

allow-hotplug wlan0 auto

wlan0 iface wlan0 inet dhcp  

wpa-ssid "Your Network SSID"  

wpa-psk "Your Password"

 

 

You will need to put your own SSID and password into the appropriate places.

 

At this point everything is configured - all we need to do is reload the network interfaces. This can be done by running the following command (warning: if you are connected using a remote connection it will disconnect now):

 

sudo service networking reload

 

To check the status of our WiFi connection after reloaded run:

 

ifconfig

 

The command should output something similar to this:

 

wlan0 Link encap:Ethernet HWaddr 80:1f:02:aa:12:58     

inet addr:192.168.1.28 Bcast:192.168.1.255 Mask:255.255.255.0    

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1     

RX packets:154 errors:0 dropped:173 overruns:0 frame:0     

TX packets:65 errors:0 dropped:0 overruns:0 carrier:0     

collisions:0 txqueuelen:1000     

RX bytes:32399 (31.6 KiB) TX bytes:13036 (12.7 KiB)

 

 

If you see a valid IP address under "inet addr" you are good to go!

 

For more a few more details take at How-To: Add WiFi to the Raspberry Pi over at raspberrypihq.com.

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2023 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube