It’s still technically Thanksgiving break and I recently discovered this wonderful little “computer,” the Raspberry Pi. I thought, why not see if I can grab one to play with this weekend. For those reading who don’t know what a Raspberry Pi is I suggest you google it, get one, and start learning/playing around with it. Today I picked a used one up off of craigslist for < $20 (USD).
The seller was kind in providing me with a 16GB SD card and a clear case for it, leaving my other SD cards to stay in their own respective devices. All I know is that it’s a model B. I will have to get more specification info off of it once I get it booted up. I figured I would create a blog post showing how I do it.
I’m configuring the SD card with my Macbook Pro.
Wiping the SD card
As I said, the seller provided me with an SD card to use. However, I don’t know this person, so the first thing I wanted to do was completely wipe it. For this I used the Disk Utility.
Select the SD card.
Go to Erase
Make sure the Format is ‘MS-DOS (FAT)’
Give it a fun name, I used ‘RPI’
Now erase it
Downloading and Installing the OS for my Raspberry Pi
I’m installing the latest version of Raspbian.
ryan$ wget http://downloads.raspberrypi.org/raspbian_latest
ryan$ tar -xzvf 2015-11-21-raspbian-jessie.zip
Now we have to write the OS onto the SD card. For this I’m going to use the ‘dd’ command. First I used diskutil list, which gave me the path to the SD card; my path is /dev/disk2. Now I’m going to unmount the disk before I write to it.
ryan$ diskutil unmountdisk /dev/disk2 Unmount of all volumes on disk2 was successful
Now I’m writing Raspbian to the SD card.
ryan$ sudo dd if=2015-11-21-raspbian-jessie.img of=/dev/disk2 bs=2m
This takes quite a while. I’m making some Paprika Goulash for dinner so I will get that started while this is going.
ryan$ sudo dd if=2015-11-21-raspbian-jessie.img of=/dev/disk2 bs=2m 1876+0 records in 1876+0 records out 3934257152 bytes transferred in 1991.528628 secs (1975496 bytes/sec) ryan$
…And now we should be all set. Now for the fun part.
Powering up Raspbian on my Raspberry Pi
Now this part is the trickier part. I don’t have a wired keyboard or mouse laying around so I’m going to have to get the Raspberry Pi connected up to my network and then access it from my Macbook Pro. If you have a keyboard and mouse laying around to use then that’s great! Personally, everything I want to do with this Raspberry Pi is going to require the command line almost exclusively.
It was suggested to me that the power source needs to be within a pretty tight range around 700mA. I have lots of wires laying around and luckily had some power sources that do the trick. I used a 1000mA output, it seems to work thus far.
Now that it’s plugged into my router I need to find out the IPv4 address of the Raspberry Pi.
This took me a little while. First find out the IP address of your router:
ryan$ netstat -nr | grep default default 'ip_address_here' UGSc 90 0 en0
Now go to a browser and put your IP address into the bar and you should get a screen requesting your routers name and password.
After logging in you should see the device listed for your Raspberry Pi. Write down the IPv4 address for it.
Now we can go to our terminal and login via an SSH connection. The default username is ‘pi’ and the default password is ‘raspberry’, when you are asked ‘Are you sure you want to continue connecting (yes/no)?’ type yes:
ryan$ ssh pi@'your_ip_address_here' The authenticity of host 'ip_address_here' cant be established. RSA key fingerprint is 'a bunch of numbers'. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'ip_address_here' (RSA) to the list of known hosts. pi@'ip_address_here's password:
And now we are logged in and can begin using our Raspberry Pi!!!
The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Sat Nov 21 21:36:27 2015 pi@raspberrypi:~ $
Let’s see which Raspberry Pi I have:
pi@raspberrypi:~ $ cat /proc/cpuinfo processor : 0 model name : ARMv6-compatible processor rev 7 (v6l) BogoMIPS : 2.00 Features : half thumb fastmult vfp edsp java tls CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xb76 CPU revision : 7 Hardware : BCM2708 Revision : 000d Serial : 000000000de9ec62
After a quick google search for that Revision ID, I found that I have a Raspberry Pi Model B Revision 2.0 512MB.
Stay posted to see what I end up doing with it. It was pretty fun getting it up and started. Naturally, I have already explored a bit of what is included in the OS that I installed. It has some python games so I will have to explore the compilers that the OS has.