How Mac users can set-up a Raspberry Pi, the Adafruit way.

Raspberry Pi is an awesome little single board computer for around $35. Adafruit is a one-stop-shop diy electronics supplier. Adafruit rolled it’s own Linux distro to run the Raspberry Pi, called Occidentalis, and has recently alpha released the Raspberry Pi WebIDE that allows you to program your Pi with Chrome or Firefox on your Mac or PC.

The documentation to get things rolling is a bit spread out, so here are steps that Mac users need to use to run Occidentalis with the WebIDE on your Raspberry Pi.

What you’ll need:

  • 1 x Raspberry Pi
  • 1 x >=4Gb SD or Micro SD Card and card reader
  • 1 x Ethernet Cable
  • 1 x 5v powersource for your Pi
  • basic comfort with navigating Terminal and SSH

Get things rolling:

  1. Download Occidentalis by clicking here
  2. Unzip the file
  3. Fire up Terminal
  4. Type df -h into Terminal to list the mounted drives on your Mac
  5. Connect the SD card to your Mac.
  6. Use the df -h command in Terminal again. Note the new listing, something like /dev/disk3s1 This is your SD card!
  7. In Terminal type sudo diskutil unmount /dev/disk{disk #}s1. This unmounts the SD card.
  8. Please be extremely careful with this step! In Terminal type the following command:

    sudo dd bs=1m if=~/{path to the .img file}/Occidentalis_v02.img of=/dev/rdisk{disk #}

    Let’s review a bit of this because it is extra important.

    • {path to the .img file} = Desktop or Downloads or wherever you unzipped the Occidentalis file
    • rdisk{disk #} = the disk name you noted before with “r” prepended and “s1″ omitted. e.g. /dev/disk3s1 = /dev/rdisk3
    • check this command 3 times for errors before you hit return. If you reference the wrong disk, that disk will be erased, including your primary hard drive!
  9. Hit return and let the file copy. This will take at least a few minutes.
  10. When Terminal displays 2600000000 bytes transferred in 449.441242 secs (5784961 bytes/sec)(or similar), eject your SD card.
  11. You’re now ready to fire up your Raspberry Pi!
  12. Plug the Ethernet cable into your Pi and the other end into your router. The Pi and your Mac need to be on the same network!
  13. Insert the SD card into your Raspberry Pi
  14. Plug in your 5v power source
  15. In Terminal type ssh pi@raspberrypi.local (your SSH password is “raspberry”)
  16. Boom. You’re in.
  17. Again in Terminal type sudo raspi-config to change your SSH password
  18. After your password is changed, it’s time to install Adafruit’s Raspberry Pi WebIDE
  19. Type curl https://raw.github.com/adafruit/Adafruit-WebIDE/release/scripts/install.sh | sh into Terminal and hit return.
  20. Make a cup of coffee, cause this is going to take a while.
  21. When the installation is complete Terminal will display:
    **** Starting the server...(please wait) ****
    **** The Adafruit WebIDE is installed and running! ****
    **** Commands: service adafruit-webide.sh {start,stop,restart} ****
    **** Navigate to http://raspberrypi.local:3000 to use the WebIDE
  22. You’re done! Open http://raspberrypi.local:3000 in Chrome or Firefox and set-up your WebIDE.

I hope this tutorial put you on the right track. The steps for this tutorial were cobbled together from the following sources:

http://learn.adafruit.com/adafruit-raspberry-pi-educational-linux-distro/occidentalis-v0-dot-2
http://elinux.org/RPi_Easy_SD_Card_Setup
http://learn.adafruit.com/webide/installation

Best of luck with your Raspberry Pi projects.