{"id":2055,"date":"2017-09-16T11:46:30","date_gmt":"2017-09-16T16:46:30","guid":{"rendered":"http:\/\/osric.com\/chris\/accidental-developer\/?p=2055"},"modified":"2017-09-16T11:46:30","modified_gmt":"2017-09-16T16:46:30","slug":"wifi-on-raspberry-pi-3","status":"publish","type":"post","link":"https:\/\/osric.com\/chris\/accidental-developer\/2017\/09\/wifi-on-raspberry-pi-3\/","title":{"rendered":"Wifi on Raspberry Pi 3"},"content":{"rendered":"<p>I don&#8217;t run a GUI\/Desktop on my Raspberry Pi devices. I don&#8217;t have monitors or keyboards connected to them &#8212; typically I log into them via SSH and manage them that way. I recently wanted to activate multiple network connections on my Raspberry Pi 3 Model B, so I decided to activate the wireless connection in addition to the wired connection that was already configured.<\/p>\n<p>I tried following the steps at <a href=\"https:\/\/www.raspberrypi.org\/documentation\/configuration\/wireless\/wireless-cli.md\">Setting WiFi up via the command line<\/a> but got an error after the first step:<\/p>\n<pre><code>$ sudo iwlist wlan0 scan\r\nwlan0     Interface doesn't support scanning : Network is down<\/code><\/pre>\n<p>I decided to check an see what devices were available via <code>ifconfig<\/code>:<\/p>\n<pre><code>$ ifconfig\r\neth0 ...\r\nlo ...<\/code><\/pre>\n<p>No wireless device is listed there. I checked for all devices using the <code>-a<\/code> switch:<\/p>\n<pre><code>$ ifconfig -a\r\neth0 ...\r\nlo ...\r\nwlan0 ...<\/code><\/pre>\n<p>It&#8217;s there, <code>wlan0<\/code>, but it wasn&#8217;t active. I tried to bring the device up:<\/p>\n<pre><code>$ sudo ifconfig wlan0 up\r\nSIOCSIFFLAGS: Operation not possible due to RF-kill<\/code><\/pre>\n<p>That error message is completely indecipherable to me! Fortunately, someone else had this error message too:<br \/>\n<a href=\"https:\/\/askubuntu.com\/questions\/62166\/siocsifflags-operation-not-possible-due-to-rf-kill\">\u201cSIOCSIFFLAGS: Operation not possible due to RF-kill\u201d?<\/a><\/p>\n<p>From that post I was able to determine that the wireless device was <em>soft blocked<\/em>:<\/p>\n<pre><code>$ sudo rfkill list\r\n0: phy0: Wireless LAN\r\n        Soft blocked: yes\r\n        Hard blocked: no\r\n1: hci0: Bluetooth\r\n        Soft blocked: yes\r\n        Hard blocked: no<\/code><\/pre>\n<p>How to unblock it? The following, described at the aforementioned post, worked. Although I&#8217;m not sure why I&#8217;m unblocking <code>wifi<\/code> instead of <code>phy0<\/code>:<\/p>\n<pre><code>$ sudo rfkill unblock wifi\r\n$ sudo rfkill list\r\n0: phy0: Wireless LAN\r\n        Soft blocked: no\r\n        Hard blocked: no\r\n1: hci0: Bluetooth\r\n        Soft blocked: yes\r\n        Hard blocked: no\r\n\r\n$ sudo ifconfig wlan0 up\r\n$ ifconfig\r\neth0 ...\r\nlo ...\r\nwlan0 ...<\/code><\/pre>\n<p>The device is now active, but we still need to connect. First, I generated an encrypted passphrase:<\/p>\n<pre><code>$ wpa_passphrase \"my_network_id\" \"my_network_password\"\r\nnetwork={\r\n        ssid=\"my_network_id\"\r\n        psk=8a9b456b28ef0707987622421592d3cc2fd22544ac281bced0f2028f4f4fcb85\r\n}<\/code><\/pre>\n<p>Next, I appended that block of text to <code>\/etc\/wpa_supplicant\/wpa_supplicant.conf<\/code><\/p>\n<p>Based on what I&#8217;ve read, that should be sufficient. The system should periodically detect changes to the <code>wpa_supplicant.conf<\/code> file and load the new settings automatically. I was impatient and rebooted. Apparently the following command should work too:<\/p>\n<pre><code>$ sudo wpa_cli reconfigure<\/code><\/pre>\n<p>After the reboot, I checked <code>ifconfig<\/code> for the <code>wlan0<\/code> interface:<\/p>\n<pre><code>$ ifconfig wlan0 | grep 'inet addr'\r\n          inet addr:192.168.0.23  Bcast:192.168.0.255  Mask:255.255.255.0<\/code><\/pre>\n<p>It has an address &#8212; success!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I followed the documented steps to enable wifi via the command line on my Raspberry Pi 3, but ran into errors right away. This post documents the steps I took to get wifi enabled.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[459,460],"class_list":["post-2055","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-raspberry-pi","tag-wifi"],"_links":{"self":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts\/2055","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/comments?post=2055"}],"version-history":[{"count":8,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts\/2055\/revisions"}],"predecessor-version":[{"id":2067,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/posts\/2055\/revisions\/2067"}],"wp:attachment":[{"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/media?parent=2055"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/categories?post=2055"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/osric.com\/chris\/accidental-developer\/wp-json\/wp\/v2\/tags?post=2055"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}