Raspberry Pi

What is it?

  • A small and inexpensive embedded linux platform.
  • Runs a full operating system, we use Raspbian, a version of the debian linux distribution.
  • Supports a wide range of programming environments and peripherals.
  • More powerful than a micro controller, such as Arduino.
  • Can process audio and graphics live.
  • Has built in HDMI, composite, stereo audio out, USB, ethernet, GPIO.
  • But: slower to boot and more complex in behavior than a micro controller, and lacks analog inputs out of the box.

Because you are given admin rights to the raspberry pi, it is completely possible to break the operating system beyond repair. Thankfully everything is stored on the SD card and it can be rewritten if necessary, to start on a clean slate. So don’t be afraid to experiment!

Exercise 1: connect to the raspberry pi from your class iMac and change the admin password

Your raspberry pi’s have an operating system preinstalled, and they should be able to connect to the media lab intranet with the ip address that is written on a sticker that is attached to the bottom of each board. Now we’ll try to open an SSH-connection to the device, so that we can control it remotely, without attaching a keyboard, mouse or display.

  1. Make sure that the SD card is properly in its slot on the raspberry pi.
  2. Take one of the ethernet cables in the class and attach it to the raspberry pi.
  3. Turn on the raspberry pi by attaching it to the power source, and wait for around 20 seconds for it to boot up.
  4. On your Mac, open the Terminal from Utilities -> Terminal.
  5. Type in “ssh -X pi@123.456.789.000” and press enter, but replace “123.456.789.000” with the ip-adress that’s written on the box of your Raspberry pi. This command will try to open an SSH connection to your raspberry pi, with the user name pi. If you are prompted about saving the public key, answer by typing “yes” and pressing enter.
  6. When prompted for password, type “raspberry
  7. You are now at the raspberry pi’s terminal, and can control it remotely!
  8. Type “passwd” and press enter. Follow the instructions on screen to change the password for the user pi.
  9. When you are done, type “sudo shutdown -h now” and press enter. This will tell the Raspberry pi to shutdown in the proper way, you should not just plug out the power chord while it’s running!

Exercise 2: Run pure data remotely on the raspberry pi

Course raspberry pi’s come preinstalled with pd-extended. Instructions for installing it on Raspbian can be found here.

  1. Connect headphones to the Pi’s audio output.
  2. Repeat steps 1 through 6 from exercise 1, substituting the password with the one you defined.
  3. In the Pi’s terminal, type “pd-extended” and press enter. This will run pure data on the raspberry pi, but the GUI window will appear on your mac by the magic of X-forwarding!