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 sudo reboot.
Once rebooted, log in with username pi and password 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).
cd ~/of_v0.8.4_linuxarmv7l_release/scripts/linux/debian/
sudo ./install_dependencies.sh
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 ~/.profile file). 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:
cd ~/of_v0.8.4_linuxarmv7l_release/examples/3d/3DPrimitivesExample/
This worked perfectly for me with a few modifications because I was using wifi - and wanted to use SSH so that I could quickly cut and paste some of the longer commands. For newbies here is how to do that:
Enable SSH in the advanced settings of the configuration screen.
To setup WIFI type startx on the commandline. This will start the gui. To to preferences ‘wifi configuration’ and scan for networks. You will need to select your network and enter the password in the PSK field. It will display a connected status once you are online.
To exit the gui select the shutdown option and choose logout. This will put you back on the commandline. Type ifconfig to get your IP address. It will be under “wlan0” if you are using WIFI after “inet addr:”.
Assuming your PC is on the same wifi network as your Pi, you can now SSH into the terminal by typing this on your PC commandline ssh pi@xx.x.x.xx (substitute your IP address) and enter the password.
I keep running into an error when I try to compile an example. I’m not sure where the error starts, so here is the output from the earliest place I think it starts:
I erased all the oF-related directories and re-followed the instructions. I even copied and pasted into the terminal to avoid typos, but I’m still getting the same errors. Could this be a problem with my SD card?
I had been using ssh, but I just tried it on the pi directly and I got the same error. And when I tried g++ in the command line I got -bash: g++: command not found
awesome. worked flawlessly - thanks! the compile is so much faster now: took about 20 minutes, as opposed to ~45 minutes previously.
next step: get the cross compile to work. my understanding is that the existing compiler should work, but it would be nice to be able to add in the options for the newer chip (at the cost of not being backwards compatible). will experiment and see!
Dunno which sdcard you’re using, but with my brand new PI 2 I use a class 10 card, and the PI2 is overclocked to 1Ghz : compiling OF took far less than 20 minutes, I don’t remember precisely how much time, but it seemed very fast to me… (may be less than 10 minutes).
About the sdcard : it cutted down the boot time by 30% - And epiphany became usable which is wasn’t with the old Class4 sdcard…
thats a huge difference between the real/user values.
using a class 4 card, as my class 10 ones (ADATA branded) happen to be non-compatible with the RPi2 (works fine with the B+ band B models, just not the new one).
I tried reinstalling g++, but it said that it was up to date. After a while, I just decided to re-flash the sd card and start over with a completely clean slate. At first, I was getting an error similar to the one that started this thread, but after some head scratching, I rebooted and the 3dPrimitivesExample now compiles and runs. Thanks for your help, everyone!
ahh… after looking at it a bit further, the user time is basically the total amount of processing time, which due to the 4 cores being used, is roughly 4x the “real” time. so that seems to make sense. it shows the compilation is making full use of all the cores!
I’m wondering if it’s possible to have one OF folder that works with both Pi1&2? Maybe somehow make use of github master version instead of v0.8.4 release?