This is the second time around with my PI 2. The first installation ran fine for about a month, but then crashed and I wasn’t able to recover it. I am going to document the process from the start..
When you first boot, you are presented with the raspi-config utility. This gives you the ability to change many of the internals of the PI, such as overclocking and enabling the camera. What I need to do first is to present the microSD to the OS, so choose the Expand Filesystem option. This happens fast, so after the success dialog I am going to change the boot option. I don’t need the desktop, so I am going to tell the PI to boot into the command line. Choose the Enable Boot to Desktop/Scratch option. Choose the Console option when the dialog appears. Now I am ready to reboot, so I am going to exit out of this tool.
Now that I have rebooted into the console, I can get started with setting it up. The first thing I want to do is get the wifi working so I can ssh in and go back to watching tv. You can login with the default username/ password pi/raspberry.
Setting up the wifi.
When I set this up the first time, I had a lot of trouble with the different examples that I found on the interwebs. Until I checked with Adafruit (awesome site), which I should have started with. Their tutorial worked the first time. I will regurgitate their instructions just in case it 404s in the future.
You need to open up the interfaces file in an editor with root permissions. I am going to use nano for this
sudo nano /etc/network/interfaces
In order for the OS to initialize the wifi, so you have to tell it how to do it. You can update this file to look like this:
auto lo iface lo inet loopback iface eth0 inet dhcp allow-hotplug wlan0 auto wlan0 iface wlan0 inet dhcp wpa-ssid "ssid" wpa-psk "password"
One thing that they noted (which saved me), was the SSID configuration above doesn’t work if you hide your SSID. For obvious reasons mine are hidden. To make it work with the hidden SSID, so need to make a few more changes.
auto lo iface lo inet loopback iface eth0 inet dhcp auto wlan0 allow-hotplug wlan0 iface wlan0 inet dhcp wpa-scan-ssid 1 wpa-ap-scan 1 wpa-key-mgmt WPA-PSK wpa-proto RSN WPA wpa-pairwise CCMP TKIP wpa-group CCMP TKIP wpa-ssid "My Secret SSID" wpa-psk "My SSID PSK" iface default inet dhcp
You should be good to go at this point. Reboot the system (sudo reboot). When it reboots, you can run
You should see something like this:
wlan0 Link encap:Ethernet HWaddr 00:0f:60:04:0e:c6 inet addr:192.168.1.16 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:73422 errors:0 dropped:0 overruns:0 frame:0 TX packets:22161 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:109230487 (104.1 MiB) TX bytes:1973384 (1.8 MiB)
This gets me started so that I can start getting the server ready to serve traffic.
Next up, getting Mono installed with a sample http server.