Edit: 0.9.0+ has now been released. Please follow the standard Raspberry Pi setup guide on the download page for 0.9.0+ (for 0.8.4 keep reading below …)
Hello all, I finally got a Raspberry Pi 2 and wanted to post a quick how-to. Since Raspberry Pi 2 uses the armv7 architecture, there are a few extra (but simple) steps to getting the latest release of openFrameworks (0.8.4) working. This is a followup to another thread here.
- Begin by installing the latest Raspbian Image on your SD card.
- Plug the Raspberry Pi 2 into into an ethernet connection, HDMI monitor, keyboard and mouse. Then plug it in to power (if you must use wifi see the comment below).
- Assuming this is your first time starting with the fresh Raspbian image from step 1, make the initial Raspbian configurations. If it isn’t your first time, you can get back to the Raspbian configuration screen by calling
sudo raspi-config). We recommend that you configure the following:
- Expand the file system.
- Change User Password
- Set your preferred internationali(s/z)ation preferences (this is particularly important if you are not using a British English keyboard).
- Reboot the Raspberry Pi 2. If it doesn’t happen automatically, call
- Once rebooted, log in with username
raspberry(unless you changed it above).
- On the Raspberry Pi 2 command line, download the OF 0.8.4 linuxarmv7 distribution. Note this is the linux armv7 distribution, NOT the linux armv6 (which is what you would use for any Raspberry Pi before version 2).
curl -O http://www.openframeworks.cc/versions/v0.8.4/of_v0.8.4_linuxarmv7l_release.tar.gz
- Unpack the release:
tar xvf of_v0.8.4_linuxarmv7l_release.tar.gz
- Add the updated Raspberry Pi 2 makefiles to the release:
curl https://raw.githubusercontent.com/openframeworks/openFrameworks/master/libs/openFrameworksCompiled/project/linuxarmv7l/config.linuxarmv7l.default.mk -o of_v0.8.4_linuxarmv7l_release/libs/openFrameworksCompiled/project/linuxarmv7l/config.linuxarmv7l.rpi2.mk
- Install the linux dependencies:
- Set an environmental variable. This must be done before using the makefile system each time you enter a new terminal or restart the Raspberry Pi 2. It can be automated by adding it to the end of your bash init script (e.g. your bash
~/.profilefile). The following tells the make system to use all 4 cores for compiling and to use the Raspberry Pi 2 variant of the armv7 makefiles (you manually added it in step 8).
export MAKEFLAGS=-j4 PLATFORM_VARIANT=rpi2
- Compile an example:
- Run the example: