Last active
May 1, 2019 20:11
-
-
Save alptugan/9f5a6b9acbce71566384 to your computer and use it in GitHub Desktop.
installation rPi + openFrameworks v0.92
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Autorun app on startup on Raspberry Pi | |
sudo crontab -e | |
// go to the bottom of that file and add your script | |
@reboot sleep 10 && cd /home/pi/openFrameworks/apps/myApps/<yourAppFile>/bin && ./<yourAppName> | |
// The main problem with method is that it is running through the cron shell, | |
not your normal user shell. As a result, the only way to quit is if you ssh | |
in from another machine and kill -9 the application ID. | |
/// NOOBS Archive | |
http://downloads.raspberrypi.org/NOOBS/images/ | |
openFrameworks | |
aboutdownloaddocumentationlearninggallerycommunitydevelopment > forum > addons > github > mailing list > IRC > blog 日本語한국어简体中文 | |
Getting your Raspberry Pi ready for openFrameworks | |
Install Raspbian "Jessie" | |
Install the latest Raspbian (Debian Jessie) image from the Raspberry Pi downloads page | |
Follow the instructions at Raspberry Pi Preparing Your SD Card to get Raspbian installed onto your SD Card | |
Configure the Raspberry Pi | |
This guide assumes you are starting from a fresh Raspian install and that you are able to connect to the Raspberry Pi and send it commands. | |
You can enter commands on the Pi by: | |
SSH into the Pi from a different computer | |
Attach a keyboard and monitor to the Pi. | |
With Jessie the Raspberry Pi now boots the X11 window system by default, open up LXTerminal from the shortcut on the Raspberry Pi Desktop | |
Type in the command sudo raspi-config | |
We need to make sure the CPU has 192MB of RAM in order to compile openFrameworks. Once you have compiled openFrameworks you may want to repeat this step with 128 | |
Select 1 Expand Filesystem and hit Enter | |
Select 8 Advanced Options and hit Enter | |
Select A3 Memory Split and hit Enter | |
Type 64 and Hit <ok> | |
openFrameworks does not use the X11 Desktop for running OF applications. You can save GPU memory by disabling it. This is optional but suggested. | |
Select 3 Boot Options | |
Select B1 Console or B2 Console Autologin | |
Unlike Wheezy, Debian Jessie does not display the IP address on boot. You may wish to get the current IP by typing ifconfig. The IP address is under the eth0 entry for wired ethernet. This can possibly change on reboot. | |
Reboot when prompted or type sudo reboot | |
Assuming you have internet access run these commands to update the software to the latest packages. | |
sudo apt-get clean | |
sudo apt-get update | |
sudo apt-get upgrade | |
Note: The above steps may take a little while. | |
Download openFrameworks | |
You now can download openFrameworks and uncompress it into a folder. Using a Shell, The following commands will download openFrameworks and uncompress it into the folder /home/pi/openFrameworks | |
For the Raspberry Pi using OF for arm6 | |
cd | |
curl -O http://openframeworks.cc/versions/v0.9.2/of_v0.9.2_linuxarmv6l_release.tar.gz | |
mkdir openFrameworks | |
tar vxfz of_v0.9.2_linuxarmv6l_release.tar.gz -C openFrameworks --strip-components 1 | |
Install packages and compile openFrameworks: | |
Make sure you didn't skip the Memory Split step in the above section Configure the Raspberry Pi or it will eventually fail. | |
The time for these steps will depend on whether you are on a RPI1 or RPI2 and the speed of the Raspbian mirrors to download the packages. | |
Assuming openFrameworks is located at /home/pi/openFrameworks run the following commands to install the necessary packages and compile openFrameworks. | |
cd /home/pi/openFrameworks/scripts/linux/debian | |
sudo ./install_dependencies.sh | |
You are now ready to compile openFrameworks! | |
make Release -C /home/pi/openFrameworks/libs/openFrameworksCompiled/project | |
Speeding up compiling | |
Compiling natively on the Raspberry Pi takes a long time. openFrameworks applications typically take much less time than the core library. Taking the time to set up a cross-compiling solution will save you enormous amounts of time. | |
Raspberry Pi Cross Compiling Guide | |
Compile your first app | |
openFrameworks ships with a bunch of examples located in the openFrameworks/examples folder. Inside examples the projects are sorted by the categories: | |
3d | |
addons | |
communication | |
empty | |
events | |
gl | |
gles | |
graphics | |
gui | |
math | |
sound | |
utils | |
video | |
Inside each category folder are a few examples of each. To run them you need to go into the folder, build and run. | |
For example, here is how you build and run the polygonExample: | |
cd /home/pi/openFrameworks/examples/graphics/polygonExample | |
make | |
make run | |
Unlike other platforms, OF Raspberry Pi projects do not make use of the projectGenerator. To create your own project from scratch, copy examples/empty/emptyExample into apps/myApps/yourProjectName folder and start from there | |
For example: | |
cp -R /home/pi/openFrameworks/examples/empty/emptyExample /home/pi/openFrameworks/apps/myApps/myRpiApp | |
cd /home/pi/openFrameworks/apps/myApps/myRpiApp | |
make | |
make run | |
make clean -C /home/pi/of_v0.9.2_linuxarmv7l/libs/openFrameworksCompiled/project | |
make Release -C /home/pi/of_v0.9.2_linuxarmv7l/libs/openFrameworksCompiled/project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// log into the project folder | |
make | |
// If succesful then | |
MESA_GL_VERSION_OVERRIDE=2.1 bin/project_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment