<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[Raspberry Pi - Bacon Applications]]></title><description><![CDATA[Follow me while I share with the world useful things I have learned and projects I am working on.]]></description><link>http://www.baconapplications.com/</link><image><url>http://www.baconapplications.com/favicon.png</url><title>Raspberry Pi - Bacon Applications</title><link>http://www.baconapplications.com/</link></image><generator>Ghost 3.7</generator><lastBuildDate>Wed, 19 Mar 2025 22:43:25 GMT</lastBuildDate><atom:link href="http://www.baconapplications.com/tag/raspberry-pi/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Setting Up WPA2 on Raspberry Pi Running Raspbian Jessie Lite]]></title><description><![CDATA[There are several years' worth of setting up the Edimax EW-7811N Wi-Fi adapter on a Raspberry Pi B on the internet.  By now (2017) most of it is out of date]]></description><link>http://www.baconapplications.com/setting-up-wpa2-on-raspberry-pi-running-raspbian-jessie-lite/</link><guid isPermaLink="false">5e535ef4ba89970001e0b062</guid><category><![CDATA[Debian]]></category><category><![CDATA[Raspberry Pi]]></category><dc:creator><![CDATA[Randy Bacon]]></dc:creator><pubDate>Tue, 07 Feb 2017 05:06:00 GMT</pubDate><media:content url="http://www.baconapplications.com/content/images/2020/02/cover.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="http://www.baconapplications.com/content/images/2020/02/cover.png" alt="Setting Up WPA2 on Raspberry Pi Running Raspbian Jessie Lite"><p>There are several years' worth of setting up the Edimax EW-7811N Wi-Fi adapter on a Raspberry Pi B on the internet.  By now (2017) most of it is out of date and wrong.  Last week, I wasted several hours trying to make WPA2 authentication work on my Raspberry Pi B.  Hopefully this guide will save someone (or future me) some time.</p>
<h2 id="myhardware">My Hardware</h2>
<img style="height:150px;padding-right:50px;display:inline-block;" align="left" src="http://www.baconapplications.com/content/images/posts/piwpa2wifi/box.png" alt="Setting Up WPA2 on Raspberry Pi Running Raspbian Jessie Lite">
<ul>
<li>Edimax EW-7811N</li>
<li>Raspberry Pi B Revision 2</li>
<li>Rapbian Jessie Lite 1/11/2017</li>
</ul>
<p><br><br><br><br></p>
<h2 id="gettingstarted">Getting Started</h2>
<p>Roll back any changes you have made to the /etc/network/interfaces or /etc/wpa_supplicant/wpa_supplicant.conf files.  I usually make .bak copies of config files before I make changes.  However, if you did not make backups of these files, the contents of each original file is below.</p>
<h3 id="etcnetworkinterfaces">/etc/network/interfaces</h3>
<pre><code># interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

#iface eth0 inet manual

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

allow-hotplug wlan1
iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
</code></pre>
<h3 id="etcwpa_supplicantwpa_supplicantconf">/etc/wpa_supplicant/wpa_supplicant.conf</h3>
<pre><code>country=US                                                
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev   
update_config=1                                           
</code></pre>
<p>Additionally, I had installed WICD at some point while trying to configure the adapter.  WICD will eat up to 5% of CPU in idle so you will want to uninstall it if you journeyed down the same rabbit hole I did...</p>
<h3 id="restart">RESTART</h3>
<p>Before continuing (and wasting more of your precious time) RESTART your Pi  (sudo reboot or sudo shutdown -r now).  I probably wasted another 30 minutes with a working solution because I hadn't restarted...</p>
<h2 id="usb">USB?</h2>
<p>Make sure the Wi-Fi adapter is plugged in and showing via the <em>lsusb</em> command:</p>
<img src="http://www.baconapplications.com/content/images/posts/piwpa2wifi/lsusb.png" alt="Setting Up WPA2 on Raspberry Pi Running Raspbian Jessie Lite" class="img-responsive">
<p>The Wi-Fi adapter should be show as &quot;Edimax Technology Co...&quot; as per above.  If it is not showing up, try unplugging and plugging in the adapter and/or restarting.</p>
<h2 id="settingupwpa2">Setting Up WPA2</h2>
<p>To set up WPA2 authentication, you will only need to edit the /etc/wpa_supplicant/wpa_supplicant.conf file.  Edit this file with the following:</p>
<pre><code>country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
ssid=&quot;YOURNETWORKSSIDHERE&quot;
psk=&quot;YOURPASSWORDHERE&quot;
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
group=CCMP
auth_alg=OPEN
}
</code></pre>
<p>Replace YOURNETWORKSSIDHERE with your SSID and YOURPASSWORDHERE with your Wi-Fi password.</p>
<p>At this point restart your Pi.</p>
<p>Once your Pi has restarted fully, run the <em>ifconfig</em> command to confirm your adapter is getting an IP address.  The wireless link should be next to wlan0 or wlan1 in the dump:</p>
<img src="http://www.baconapplications.com/content/images/posts/piwpa2wifi/ifconfig.png" alt="Setting Up WPA2 on Raspberry Pi Running Raspbian Jessie Lite" class="img-responsive">
<h2 id="nosleep">No Sleep</h2>
<p>Finally, if your Pi needs to have Wi-Fi on at all times, be sure to disable power management by creating or editing the /etc/modprobe.d/8192cu.conf file via sudo nano /etc/modprobe.d/8192cu.conf:</p>
<pre><code># Disable power management
options 8192cu rtw_power_mgnt=0 rtw_enusbss=0
</code></pre>
<p>After this change, restart your Pi again.</p>
<h2 id="conclusion">Conclusion</h2>
<p>I you found this guide helpful and hopefully it saved you some time!  Until next time - happy coding!</p>
<!--kg-card-end: markdown-->]]></content:encoded></item></channel></rss>