<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><title>Bozica (Posts about wifi)</title><link>http://bozica.co/</link><description></description><atom:link rel="self" type="application/rss+xml" href="http://bozica.co/categories/wifi.xml"></atom:link><language>en</language><lastBuildDate>Mon, 26 Jun 2017 13:31:06 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Enabling SSH and WiFi dongle on Raspberry Pi</title><link>http://bozica.co/posts/enabling-ssh-and-wifi-dongle-on-raspberry-pi/</link><dc:creator>Luis Ardila</dc:creator><description>&lt;div&gt;&lt;p&gt;This was done from a fresh RPi, therefore the first thing we do is updating all
the applications, then upgrading. Following step we enable the SSH and then we
install the application that manage the wifi conection. Finally we enable the
wifi con conect automatically once power has come up, therefore enabling an SSH
conection after a remote reboot.&lt;/p&gt;
&lt;ol class="arabic"&gt;
&lt;li&gt;&lt;p class="first"&gt;Follow this &lt;a class="reference external" href="https://www.youtube.com/watch?v=sUbrypvjnts"&gt;video tutorials&lt;/a&gt; for SSH&lt;/p&gt;
&lt;pre class="code console"&gt;&lt;a name="rest_code_436c72fda0fd4da1999e1c7d70b3a339-1"&gt;&lt;/a&gt;&lt;span class="go"&gt;apt-get update&lt;/span&gt;
&lt;a name="rest_code_436c72fda0fd4da1999e1c7d70b3a339-2"&gt;&lt;/a&gt;&lt;span class="go"&gt;apt-get upgrade&lt;/span&gt;
&lt;a name="rest_code_436c72fda0fd4da1999e1c7d70b3a339-3"&gt;&lt;/a&gt;&lt;span class="go"&gt;reboot&lt;/span&gt;
&lt;a name="rest_code_436c72fda0fd4da1999e1c7d70b3a339-4"&gt;&lt;/a&gt;&lt;span class="go"&gt;sudo raspi-config&lt;/span&gt;
&lt;/pre&gt;&lt;p&gt;select from menu : "expand filesystem" then "Advanced Options" and then "SSH"
--&amp;gt; Enabled --&amp;gt; "Finish"&lt;/p&gt;
&lt;pre class="code console"&gt;&lt;a name="rest_code_d32794d1a67e46c28649f35b0606504d-1"&gt;&lt;/a&gt;&lt;span class="go"&gt;reboot&lt;/span&gt;
&lt;a name="rest_code_d32794d1a67e46c28649f35b0606504d-2"&gt;&lt;/a&gt;&lt;span class="go"&gt;sudo ip addr show&lt;/span&gt;
&lt;/pre&gt;&lt;p&gt;Now you should be able to SSH to you RPi using the IP address shown in the
line that starts with "inet 192.168.X.Y   ....."&lt;/p&gt;
&lt;p&gt;On your computer do:&lt;/p&gt;
&lt;pre class="code console"&gt;&lt;a name="rest_code_7f1db2949d5e40dda7559baa446132f2-1"&gt;&lt;/a&gt;&lt;span class="go"&gt;ssh pi@192.168.X.Y         # Y is your wired address&lt;/span&gt;
&lt;/pre&gt;&lt;p&gt;type password for "pi" user (Note the default is "raspberry")&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Now we want to plug out Wifi Dongle and have it wirelessly connected,
following this tutorial do:&lt;/p&gt;
&lt;pre class="code console"&gt;&lt;a name="rest_code_f219ed12ecfc48209795a715249d7e0b-1"&gt;&lt;/a&gt;&lt;span class="go"&gt;sudo apt-get install wicd-curses&lt;/span&gt;
&lt;a name="rest_code_f219ed12ecfc48209795a715249d7e0b-2"&gt;&lt;/a&gt;&lt;span class="go"&gt;sudo wicd-curses&lt;/span&gt;
&lt;/pre&gt;&lt;p&gt;Select your wifi network, if it doesn't show then hit the key "P" (preferences)
and type "wlan0" in the field  "wireless interface" hit F10 to save&lt;/p&gt;
&lt;p&gt;Select your Wifi network, hit the right arrow to configure:
check static IP
type the IP address following the same skim as your router gateway: i.e:
IP: 192.168.X.Z      (Z is going to be your static wireless address- pick any number)
Mask: 255.255.255.0
Gateway: 192.168.X.R   (R is the ip address of your router)
at the bottom on key type your wifi password
hit F10 to save&lt;/p&gt;
&lt;p&gt;After some seconds it will connect, you can unplug the wired cable and verify
a remote SSH to the new wireless IP address&lt;/p&gt;
&lt;pre class="code console"&gt;&lt;a name="rest_code_55126f3412ae485aa97e67fe61717c6d-1"&gt;&lt;/a&gt;&lt;span class="go"&gt;ssh pi@192.168.X.Z&lt;/span&gt;
&lt;/pre&gt;&lt;p&gt;type password&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Now to allow the wifi conection to come up automatically after a remote reboot do:&lt;/p&gt;
&lt;pre class="code console"&gt;&lt;a name="rest_code_8e4f360c1bf24b5ca54a8e83f6c8f2af-1"&gt;&lt;/a&gt;&lt;span class="go"&gt;sudo nano /etc/network/interfaces&lt;/span&gt;
&lt;/pre&gt;&lt;p&gt;Change it to this:&lt;/p&gt;
&lt;pre class="code text"&gt;&lt;a name="rest_code_263cc19f27604f67928ac01119133482-1"&gt;&lt;/a&gt;auto lo
&lt;a name="rest_code_263cc19f27604f67928ac01119133482-2"&gt;&lt;/a&gt;iface lo inet loopback
&lt;a name="rest_code_263cc19f27604f67928ac01119133482-3"&gt;&lt;/a&gt;#Remove the wired network because it
&lt;a name="rest_code_263cc19f27604f67928ac01119133482-4"&gt;&lt;/a&gt;#slows down boot if it's not connected.
&lt;a name="rest_code_263cc19f27604f67928ac01119133482-5"&gt;&lt;/a&gt;#auto eth0
&lt;a name="rest_code_263cc19f27604f67928ac01119133482-6"&gt;&lt;/a&gt;#iface eth0 inet dhcp
&lt;a name="rest_code_263cc19f27604f67928ac01119133482-7"&gt;&lt;/a&gt;allow-hotplug wlan0
&lt;a name="rest_code_263cc19f27604f67928ac01119133482-8"&gt;&lt;/a&gt;auto wlan0
&lt;a name="rest_code_263cc19f27604f67928ac01119133482-9"&gt;&lt;/a&gt;iface wlan0 inet static
&lt;a name="rest_code_263cc19f27604f67928ac01119133482-10"&gt;&lt;/a&gt;address 192.168.1.20 #(IP address of RaspyFi)
&lt;a name="rest_code_263cc19f27604f67928ac01119133482-11"&gt;&lt;/a&gt;netmask 255.255.255.0
&lt;a name="rest_code_263cc19f27604f67928ac01119133482-12"&gt;&lt;/a&gt;gateway 192.168.1.2 #(IP of router)
&lt;a name="rest_code_263cc19f27604f67928ac01119133482-13"&gt;&lt;/a&gt;wpa-ssid MyWirelessNetwork
&lt;a name="rest_code_263cc19f27604f67928ac01119133482-14"&gt;&lt;/a&gt;wpa-psk MyPassword
&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;You are all done, SSH to your wirelessly connected RPi and reboot to test the
feature of auto connection after booting.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;To disable the power saving feature of the wifi module we follow this page&lt;/p&gt;
&lt;p&gt;The problem seems to be that the adapter has power management features
enabled by default. This can be checked by running the command:&lt;/p&gt;
&lt;pre class="code console"&gt;&lt;a name="rest_code_da6ba4a314884379abb8e73340f6b00d-1"&gt;&lt;/a&gt;&lt;span class="go"&gt;cat /sys/module/8192cu/parameters/rtw_power_mgnt&lt;/span&gt;
&lt;/pre&gt;&lt;p&gt;A value of 0 means disabled, 1 means min. power management, 2 means max.
power management. To disable this, you need to create a new file:&lt;/p&gt;
&lt;pre class="code console"&gt;&lt;a name="rest_code_7ac58330ce144a6baddfa34bcde83012-1"&gt;&lt;/a&gt;&lt;span class="go"&gt;sudo nano /etc/modprobe.d/8192cu.conf&lt;/span&gt;
&lt;/pre&gt;&lt;p&gt;and add the following:&lt;/p&gt;
&lt;pre class="code text"&gt;&lt;a name="rest_code_2ec8acf14f414fae9170a96bb5954029-1"&gt;&lt;/a&gt;# Disable power management
&lt;a name="rest_code_2ec8acf14f414fae9170a96bb5954029-2"&gt;&lt;/a&gt;options 8192cu rtw_power_mgnt=0
&lt;/pre&gt;&lt;p&gt;Once you save the file and reboot your RPi, the WiFi should stay on indefinitely.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;</description><category>raspberry pi</category><category>ssh</category><category>wifi</category><guid>http://bozica.co/posts/enabling-ssh-and-wifi-dongle-on-raspberry-pi/</guid><pubDate>Thu, 08 May 2014 14:45:29 GMT</pubDate></item></channel></rss>