Raspberry Pi
From charlesreid1
Ordered the CanaKit Raspbery Pi starter kit from Amazon, mainly because it came with a breadboard and a case.
NOTE: "cronus" refers to my Mac OS X laptop.
Installing Operating System
The kit came with an 8GB SD card with the NOOBS operating system (for beginners at raspberry pi) pre-installed. Nice touch, but I didn't want to use NOOBS, I wanted to use a Raspbery Pi version of Debian so that I can hack this thing up. I downloaded an image file from http://www.raspberrypi.org/ (it was a zip file, containing an img file).
Step 0: Plug the SD card in
You're going to be installing the operating system for the Raspberry Pi onto an SD card, so pick an SD card that you'll use, and plug it into your laptop.
Step 1: Find your SD card
I plugged my SD card into my Mac OS X (running 10.8), and ran this command to list all the devices:
$ diskutil list dyld: DYLD_ environment variables being ignored because main executable (/usr/sbin/diskutil) has __RESTRICT/__restrict section /dev/disk0 #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *250.1 GB disk0 1: EFI 209.7 MB disk0s1 2: Apple_HFS Cronus 249.2 GB disk0s2 3: Apple_Boot Recovery HD 650.0 MB disk0s3 /dev/disk1 #: TYPE NAME SIZE IDENTIFIER 0: FDisk_partition_scheme *7.9 GB disk1 1: DOS_FAT_32 NOOBS 7.9 GB disk1s1 /dev/disk2 #: TYPE NAME SIZE IDENTIFIER 0: Apple_partition_scheme *16.7 MB disk2 1: Apple_partition_map 32.3 KB disk2s1 2: Apple_HFS Flash Player 16.7 MB disk2s2
That means my sd card is at /dev/disk1.
Step 2: Unmount card
Now I unmount the SD card:
$ diskutil unmountDisk /dev/disk1 Unmount of all volumes on disk1 was successful
Step 3: Write image to SD card
For the last step, you use dd (disk formatter utility) to write that image to your SD card:
$ sudo dd bs=1m if=2014-06-20-wheezy-raspbian.img of=/dev/disk1 2825+0 records in 2825+0 records out 2962227200 bytes transferred in 1571.202055 secs (1885325 bytes/sec)
The above command took 27 minutes on my system.
Resources
- http://www.raspberrypi.org/documentation/installation/installing-images/mac.md
- http://elinux.org/RPi_Easy_SD_Card_Setup
Interfacing with Headless Raspberry Pi
Step 1: Modify Raspberry Pi boot sequence
Following http://pihw.wordpress.com/guides/direct-network-connection/
Plug the SD card back into your computer. Edit the file cmdline.txt to include a directive to hard-code an IP address.
If your laptop finds an IP address automatically, then you can specify any IP address you want for your RPi, as long as it is in the range 169.254.X.Y (anything between 169.254.0.0 to 169.254.254.254).
I added this to the end of cmdline.txt:
ip=169.254.113.200
Then I ran
$ cp cmdline.txt cmdline.direct
Now plug the SD card into the RPi and boot with a hard-coded IP address. This will work because we're connecting the computer and the RPi directly.
Step 2: Cat5 Network Cable
Get a standard network cable and connect the laptop to the RPi. Remove the SD card from the laptop once you've modified cmdline and put it in the RPi to boot it up.
Step 3: SSH
Now you can SSH to the IP address you specified:
First Steps with Raspberry Pi
Configuring your RPi
When you first SSH into your RPi, it will notify you that you have to run a config program to set up your RPi initially.
I picked the first menu item, and that required a system reboot:
Putting RPi on a Network
As a next step, we'll want RPi to be internet-capable so we can use aptitude to install some packages and get this operating system tuned up.
First, you'll keep your network cable plugged into your RPi.
Then you'll plug the other end of the network cable into a network router or a network wall jack (see IMPORTANT CAVEAT below).
Once you plug your RPi into the network router, it'll still have the same IP address, so you can still SSH to it the same way:
$ ssh pi@169.254.113.200
but now the RPi will have internet connectivity:
IMPORTANT CAVEAT: If you plug your RPi into a wall jack and you're on a local area network administered by someone else, you may have internet connectivity issues. This is because you're hard-coding an IP address, but some networks must assign IP addresses themselves in order to allow a computer to get outside the local area network. In this case, you'll have to contact a network administrator and ask them to reserve an IP address for your Raspberry Pi.
Software Installation
A list of commands that I ran on the RPi to get things installed:
sudo apt-get update sudo apt-get install python-dev wget http://python-distribute.org/distribute_setup.py python distribute_setup.py wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py sudo python get-pip.py sudo pip install virtualenv sudo apt-get install build-essential sudo pip install flask sudo pip install cython sudo pip install numpy sudo pip install pandas sudo pip install scipy



