{"id":185,"date":"2016-07-25T05:29:13","date_gmt":"2016-07-25T03:29:13","guid":{"rendered":"http:\/\/wp.multibabirel.ch\/index.php\/2016\/07\/25\/setting-wifi-up-via-the-command-line-raspberry-pi-documentation\/"},"modified":"2017-03-06T22:41:57","modified_gmt":"2017-03-06T21:41:57","slug":"setting-wifi-up-via-the-command-line-raspberry-pi-documentation","status":"publish","type":"post","link":"https:\/\/wp.multibabirel.ch\/index.php\/2016\/07\/25\/setting-wifi-up-via-the-command-line-raspberry-pi-documentation\/","title":{"rendered":"Setting WiFi up via the command line &#8211; Raspberry Pi Documentation"},"content":{"rendered":"<p>\n<h1>Setting WiFi up via the command line<\/h1>\n<p>This method is suitable if you don&rsquo;t have access to the graphical user interface normally used to set up WiFi on the Raspberry Pi. It&rsquo;s especially suitable for use with a serial console cable if you don&rsquo;t have access to a screen or wired Ethernet network. Note also that no additional software is required; everything you need is already included on the Raspberry Pi.   <\/p>\n<h2>Getting WiFi network details<\/h2>\n<p>To scan for WiFi networks, use the command <code>sudo iwlist wlan0 scan<\/code>. This will list all available WiFi networks, along with other useful information. Look out for:<\/p>\n<ol style=\"max-width:100%;padding-left:20px;border:0px none rgb(34, 34, 34);background-color:rgba(0, 0, 0, 0);background-image:none;box-shadow:none;width:540px;height:254px;\">\n<li>\n<p><code>ESSID:\"testing\"<\/code>. This is the name of the WiFi network.   <\/p>\n<\/li>\n<li><code>IE: IEEE 802.11i\/WPA2 Version 1<\/code>. This is the authentication used; in this case it&rsquo;s WPA2, the newer and more secure wireless standard which replaces WPA. This guide should work for WPA or WPA2, but may not work for WPA2 enterprise; for WEP hex keys, see the last example <a href=\"http:\/\/www.freebsd.org\/cgi\/man.cgi?query=wpa_supplicant.conf&amp;sektion=5&amp;apropos=0&amp;manpath=NetBSD+6.1.5\">here<\/a>. You&rsquo;ll also need the password for the WiFi network. For most home routers this is located on a sticker on the back of the router. The ESSID (ssid) for the network in this case is <code>testing<\/code> and the password (psk) is <code>testingPassword<\/code>.<\/li>\n<\/ol>\n<h2>Adding the network details to the Raspberry Pi<\/h2>\n<p>Open the <code>wpa-supplicant<\/code> configuration file in nano:<\/p>\n<p><code>sudo nano \/etc\/wpa_supplicant\/wpa_supplicant.conf<\/code><\/p>\n<p>Go to the bottom of the file and add the following:   <\/p>\n<pre><code>network={\n    ssid=\"The_ESSID_from_earlier\"\n    psk=\"Your_wifi_password\"\n}<\/code><\/pre>\n<p>In the case of the example network, we would enter:  <\/p>\n<pre><code>network={\n    ssid=\"testing\"\n    psk=\"testingPassword\"\n}<\/code><\/pre>\n<p>Now save the file by pressing <strong style=\"font-weight:700;max-width:100%;border:0px none rgb(34, 34, 34);background-color:rgba(0, 0, 0, 0);background-image:none;box-shadow:none;\">Ctrl+X<\/strong> then <strong style=\"font-weight:700;max-width:100%;border:0px none rgb(34, 34, 34);background-color:rgba(0, 0, 0, 0);background-image:none;box-shadow:none;\">Y<\/strong>, then finally press <strong style=\"font-weight:700;max-width:100%;border:0px none rgb(34, 34, 34);background-color:rgba(0, 0, 0, 0);background-image:none;box-shadow:none;\">Enter<\/strong>.  <\/p>\n<p>At this point, <code>wpa-supplicant<\/code> will normally notice a change has occurred within a few seconds, and it will try and connect to the network. If it does not, either manually restart the interface with <code>sudo ifdown wlan0<\/code> and <code>sudo ifup wlan0<\/code>, or reboot your Raspberry Pi with <code>sudo reboot<\/code>.   <\/p>\n<p>You can verify if it has successfully connected using <code>ifconfig wlan0<\/code>. If the <code>inet addr<\/code> field has an address beside it, the Pi has connected to the network. If not, check your password and ESSID are correct.   <\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Setting WiFi up via the command line<br \/>\nThis method is suitable if you don&rsquo;t have access to the graphical user interface normally used to set up WiFi on the Raspberry Pi. It&rsquo;s especially suitable for use with a serial console cable if you don&rsquo;t have access to a screen or wired Ethernet network. Note also that no additional software is required; everything you need is already included on the Raspberry Pi.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[3,10],"tags":[],"class_list":["post-185","post","type-post","status-publish","format-standard","hentry","category-posts","category-raspberry"],"_links":{"self":[{"href":"https:\/\/wp.multibabirel.ch\/index.php\/wp-json\/wp\/v2\/posts\/185","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.multibabirel.ch\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.multibabirel.ch\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.multibabirel.ch\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.multibabirel.ch\/index.php\/wp-json\/wp\/v2\/comments?post=185"}],"version-history":[{"count":1,"href":"https:\/\/wp.multibabirel.ch\/index.php\/wp-json\/wp\/v2\/posts\/185\/revisions"}],"predecessor-version":[{"id":186,"href":"https:\/\/wp.multibabirel.ch\/index.php\/wp-json\/wp\/v2\/posts\/185\/revisions\/186"}],"wp:attachment":[{"href":"https:\/\/wp.multibabirel.ch\/index.php\/wp-json\/wp\/v2\/media?parent=185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.multibabirel.ch\/index.php\/wp-json\/wp\/v2\/categories?post=185"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.multibabirel.ch\/index.php\/wp-json\/wp\/v2\/tags?post=185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}