{"id":1945,"date":"2017-04-29T22:47:08","date_gmt":"2017-04-30T03:47:08","guid":{"rendered":"http:\/\/swildow.darktech.org\/wp\/?p=1945"},"modified":"2017-04-29T22:47:08","modified_gmt":"2017-04-30T03:47:08","slug":"configure-wifi-on-raspberry-pi-raspbian-debian-linux-via-command-line","status":"publish","type":"post","link":"https:\/\/www.wildow.com\/blog\/?p=1945","title":{"rendered":"Configure WiFi on Raspberry Pi Raspbian \/ Debian Linux via Command Line"},"content":{"rendered":"<header class=\"entry-header\">\n<h1 class=\"entry-title\">Configure WiFi on Raspberry Pi Raspbian \/ Debian Linux via Command Line<\/h1>\n<div class=\"below-title-meta\">\n<div class=\"adt\">By <span class=\"vcard author\"><span class=\"fn\"><a title=\"Posts by Scott Miller\" href=\"https:\/\/scottlinux.com\/author\/admin\/\" rel=\"author\">Scott Miller<\/a><\/span> <\/span><span class=\"meta-sep\">|<\/span> <span class=\"date updated\">2016\/01\/17<\/span><\/div>\n<div class=\"adt-comment\"><a class=\"link-comments\" href=\"https:\/\/scottlinux.com\/2016\/01\/17\/configure-wifi-on-raspberry-pi-raspbian-debian-linux-via-command-line\/#comments\">2 Comments<\/a><\/div>\n<\/div>\n<\/header>\n<div class=\"entry-content\">\n<div align=\"center\"><img decoding=\"async\" src=\"https:\/\/scottlinux.com\/wp-content\/uploads\/2016\/01\/Raspberry-Pi.jpg\" alt=\"\" \/><\/div>\n<p>To easily scan for wireless networks and connect on a Raspberry Pi, use the command line app <b><a href=\"http:\/\/linux.die.net\/man\/8\/wpa_cli\">wpa_cli<\/a><\/b>. Check it out!<\/p>\n<hr \/>\n<p>Here is how to scan for and connect to wireless networks from the command line on a Raspberry Pi!<\/p>\n<p>1. Run:<\/p>\n<pre>sudo wpa_cli<\/pre>\n<p>This will open up an interactive mode.<\/p>\n<pre>wpa_cli v2.3\r\nCopyright (c) 2004-2014, Jouni Malinen &lt;j@w1.fi&gt; and contributors\r\n\r\nThis software may be distributed under the terms of the BSD license.\r\nSee README for more details.\r\n\r\n\r\nSelected interface 'wlan0'\r\n\r\nInteractive mode\r\n\r\n&gt;\r\n<\/pre>\n<p>Next, type the following commands at the &gt; prompt to scan for available networks:<\/p>\n<hr \/>\n<pre>scan<\/pre>\n<pre>scan_results<\/pre>\n<p>Ex. output:<\/p>\n<pre>&gt; scan_results\r\nbssid \/ frequency \/ signal level \/ flags \/ ssid\r\n30:e2:c2:0b:73:23       2412    100     [WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP+TKIP][ESS]    scottlinux\r\n<\/pre>\n<hr \/>\n<p>2. Add a network:<\/p>\n<pre>add_network 0<\/pre>\n<hr \/>\n<p>3. Set this network to the desired SSID you wish to connect to.<\/p>\n<pre>set_network 0 ssid \"scottlinux\"<\/pre>\n<p>4. Set the passphrase for that SSID.<\/p>\n<pre>set_network 0 psk \"averycoolpassphrase\"<\/pre>\n<hr \/>\n<p>5. Enable then save the network and settings.<\/p>\n<pre>enable network 0<\/pre>\n<pre>save_config<\/pre>\n<hr \/>\n<p>Done.<\/p>\n<hr \/>\n<p>Below is an example full output:<\/p>\n<pre>pi@raspberrypi ~ $ sudo wpa_cli\r\nwpa_cli v2.3\r\nCopyright (c) 2004-2014, Jouni Malinen &lt;j@w1.fi&gt; and contributors\r\n\r\nThis software may be distributed under the terms of the BSD license.\r\nSee README for more details.\r\n\r\n\r\nSelected interface 'wlan0'\r\n\r\nInteractive mode\r\n\r\n&gt; scan\r\nOK\r\n&lt;3&gt;CTRL-EVENT-SCAN-RESULTS \r\n&lt;3&gt;WPS-AP-AVAILABLE \r\n&gt; scan_results\r\nbssid \/ frequency \/ signal level \/ flags \/ ssid\r\n30:e2:c2:0b:73:23       2412    100     [WPA-PSK-CCMP+TKIP][WPA2-PSK-CCMP+TKIP][ESS]    scottlinux\r\n46:52:3a:b2:3b:51       2457    7       [WPA2-EAP-CCMP][ESS]    TWCWiFi-Passpoint\r\na8:3c:59:7b:15:f7       2412    68      [WPA2-PSK-CCMP][WPS][ESS]\r\n&gt; add_network\r\n0\r\n&gt; set_network 0 ssid \"scottlinux\"\r\nOK\r\n&gt; set_network 0 psk \"averycoolpassphrase\"\r\nOK\r\n&gt; enable network 0\r\nOK\r\n&lt;3&gt;CTRL-EVENT-SCAN-RESULTS \r\n&lt;3&gt;WPS-AP-AVAILABLE \r\n&lt;3&gt;Trying to associate with 30:e2:c2:0b:73:23 (SSID='scottlinux' freq=2412 MHz)\r\n&lt;3&gt;Association request to the driver failed\r\n&lt;3&gt;Associated with 30:e2:c2:0b:73:23\r\n&lt;3&gt;WPA: Key negotiation completed with 30:e2:c2:0b:73:23 [PTK=CCMP GTK=TKIP]\r\n&lt;3&gt;CTRL-EVENT-CONNECTED - Connection to 30:e2:c2:0b:73:23 completed [id=0 id_str=]\r\n&gt; save_config\r\nOK\r\n&gt; quit\r\npi@raspberrypi ~ $<\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Configure WiFi on Raspberry Pi Raspbian \/ Debian Linux via Command Line By Scott Miller | 2016\/01\/17 2 Comments To easily scan for wireless networks and connect on a Raspberry Pi, use the command line app wpa_cli. Check it out! &#8230; <a class=\"more-link\" href=\"https:\/\/www.wildow.com\/blog\/?p=1945\">Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-1945","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1945","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1945"}],"version-history":[{"count":2,"href":"https:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1945\/revisions"}],"predecessor-version":[{"id":1947,"href":"https:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1945\/revisions\/1947"}],"wp:attachment":[{"href":"https:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1945"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1945"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1945"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}