12/3/2017 - 8:07 PM

Setup Openframeworks on Raspberry Pi 2

Setup Openframeworks on Raspberry Pi 2

Following instructions are hosted on my gist account also. 
I  can compile the polygon and opencv examples successfully after the issues. 
Now everything works fine. Enabling overclock makes compiling  process faster btw.

## Ubuntu Mate Raspberry Pi Setup on RPI-2 board##

1) Download ubuntu RPI image

2) Use Etcher freeware to burn image to SD Card

3) Attach SD Card to rPi, connect keyboard, mouse and display to rPi for the first run and power up RPI

4) Follow the instructions and create user (pi) and password (raspberry)

5) When desktop interface starts, open up Terminal and edit raspi-config to enable following commands;
> sudo raspi-config
- Change Boot Options to the Command Line
- Change Interfacing Options to enable SSH
- Change Memory Split option to 64 M from Advanced Options
- Change GL Driver option to 3rd one to disable GL Driver from Advanced Options
- Save, exit & reboot

6) Login to "pi" user

7) Download nightly build oF arm7 version
> curl -O

8) Make oF directory
> mkdir of_v20170714_linuxarmv7l_nightly

9) Upack the content into this oF directory
> tar vxfz of_v20170714_linuxarmv7l_nightly.tar.gz -C of_v20170714_linuxarmv7l_nightly --strip-components 1

10) Run dependencies scripts. I get bunch of issues in this section. If you have it also, read the the following fixes and redo the dependencies installation
> cd of_v20170714_linuxarmv7l_nightly/scripts/linux/ubuntu
> sudo ./

**ISSUE 1: When installing dependencies I got error libgl1-mesa-dev-hwe-16.0.4
installing OF dependencies with -hwe-16.04 packages, confirm Y/N ?**

> Just type N to fix this issue 1

**ISSUE 2:
E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/) is another process using it?**

*ref. & fix:*
to fix the issue run the following commands; 
> sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock
sudo ./

11) If everything goes fine, run codec installation scripts
> sudo ./

12) Set your make flags in your .bash_profile
> sudo nano ~/.bash_profile

add the following Line (MAKEFLAGS=-j2 not -j4 because of ISSUE 3 see below)


and Save

13) cd /home/pi/of_v20170714_linuxarmv7l_nightly/examples/graphics/polygonExample
**ISSUE 3:
I got the following error;
virtual memory exhausted: Cannot allocate memory**
*ref. & fix:*

And recompile again if it fails again then recompile again...I can compile the example at the 2nd try