{"id":265,"date":"2016-01-08T10:38:00","date_gmt":"2016-01-08T10:38:00","guid":{"rendered":"http:\/\/simkin.org\/wordpress\/?p=265"},"modified":"2016-01-08T10:38:00","modified_gmt":"2016-01-08T10:38:00","slug":"wifi-on-the-raspberry-pi","status":"publish","type":"post","link":"http:\/\/simkin.org\/wordpress\/?p=265","title":{"rendered":"Wifi on the Raspberry Pi"},"content":{"rendered":"<p>Had a few requests about this and there are various answers on forums around the place, but this is how I did it using a PI Hut dongle:<\/p>\n<blockquote><p><em>sudo apt-get update<\/em><br \/>\n<em>sudo apt-get upgrade<\/em><br \/>\n<em>sudo shutdown -r 0<\/em><\/p><\/blockquote>\n<p>Those three commands make sure everything is the latest it needs to be before you try anything else. Now let&#8217;s edit two files:<br \/>\nsudo nano \/etc\/network\/interfaces<\/p>\n<pre># just add or edit the wlan sections at the bottom, leave the rest of the file as you find it\nallow-hotplug wlan0\niface wlan0 inet manual\nwpa-conf \/etc\/wpa_supplicant\/wpa_supplicant.conf\nallow-hotplug wlan1\niface wlan1 inet manual\nwpa-conf \/etc\/wpa_supplicant\/wpa_supplicant.conf\n<\/pre>\n<p>sudo nano \/etc\/wpa_supplicant\/wpa_supplicant.conf<\/p>\n<pre>#This is the entire file and it gets me onto my home wifi network, but change the ssid and the psk to the password for your network\nctrl_interface=DIR=\/var\/run\/wpa_supplicant\nGROUP=netdev\nupdate_config=1\nnetwork={ ssid=\"59KnightsWay\" psk=\"afafafafafa\" }<\/pre>\n<p>&nbsp;<br \/>\nNote: If you wanted a static wifi address, the interfaces file needs a minor tweak:<\/p>\n<pre>allow-hotplug wlan0\niface wlan0 inet <strong>static\naddress 192.168.1.99\nnetmask 255.255.255.0\ngateway 192.168.1.1\n<\/strong>wpa-conf \/etc\/wpa_supplicant\/wpa_supplicant.conf<\/pre>\n<p>Reboot and use these two commands to check what did and didn&#8217;t work:<br \/>\nifconfig wlan0<br \/>\ntail -500 \/var\/log\/syslog | grep wlan<br \/>\nIf you struggle with wpa_supplicant, you can wimp out and do it all in \/etc\/network\/interfaces<\/p>\n<pre>\n# interfaces(5) file used by ifup(8) and ifdown(8)\n# Please note that this file is written to be used with dhcpcd\n# For static IP, consult \/etc\/dhcpcd.conf and 'man dhcpcd.conf'\n# Include files from \/etc\/network\/interfaces.d:\nsource-directory \/etc\/network\/interfaces.d\nauto lo\niface lo inet loopback\niface eth0 inet manual\nallow-hotplug wlan0\niface wlan0 inet static\naddress 192.168.1.99\nnetmask 255.255.255.0\ngateway 192.168.1.1\ndns-nameservers 8.8.8.8\nwpa-ssid \"MySSID\"\nwpa-psk \"mypassword\"\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Had a few requests about this and there are various answers on forums around the place, but this is how &hellip; <a class=\"more-link\" href=\"http:\/\/simkin.org\/wordpress\/?p=265\">More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[316,3],"tags":[317],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/simkin.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/265"}],"collection":[{"href":"http:\/\/simkin.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/simkin.org\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/simkin.org\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/simkin.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=265"}],"version-history":[{"count":0,"href":"http:\/\/simkin.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/265\/revisions"}],"wp:attachment":[{"href":"http:\/\/simkin.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=265"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/simkin.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=265"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/simkin.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=265"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}