-
Notifications
You must be signed in to change notification settings - Fork 11
Raspberry Pi Getting Started
##Getting your Raspberry Pi ready for oF
-
Install the latest Raspbian image, according to the instructions in the Official Quickstart Guide.
- Make sure you are working with the the "hard float" version of wheezy (aka "Raspbian"), not the soft-float version (aka "Soft-float Debian “wheezy”).
-
Please note if you are booting for the first time you will need to have a USB keyboard and either a HDMI Monitor or a HDMI to DVI||VGA adapter depending on your setup. Please read this guide as it contains a lot of useful information about bringing up your pi for the first time. Please select the following options from the configuration screen described in this this guide.
- expand_rootfs, this expands the root file-system to your full SD card.
- ssh, enable sshd at boot (if you wish to ssh into your pi instead of using a USB keyboard)
- memory_split, you should configure the GPU/CPU memory split to be 50/50 between the GPU and CPU
- if you already have a working pi you should do the following
- run
sudo wget http://goo.gl/1BOfJ -O /usr/bin/rpi-update && sudo chmod +x /usr/bin/rpi-update
- then execute the
rpi-update
- edit
/boot/config.txt
and set gpu_mem option togpu_mem=128
for the 256mb pi andgpu_mem=256
for the 512mb pi -
you will need to reboot your pi after this step
sudo shutdown now -r
||sudo reboot
-
Once you are logged in to the RPI on the command line (via SSH or plugged into a screen) make sure your system is up-to-date.
sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade
- Note: The above steps may take a little while.
- If you are still having issues updating apt-get run the following command then repeat the steps from above:
sudo rm /var/lib/apt/lists/* -vf
- install git:
sudo apt-get install git
- install and enable Multicast DNS (mDNS) for board to be reachable at
raspberrypi.local.
from machines on the same network:sudo apt-get install libnss-mdns
-
Then clone this repo:
git clone https://github.com/openFrameworks-RaspberryPi/openFrameworks/
- Note: If you want to contribute code to the this project, create your own branch and submit a pull request to the
develop-raspberrypi
branch of this repo. - Note: For purposes of discussion below, $(OF_ROOT) is will be the location of the openFrameworks root folder you created during this cloning process. (suggested root dir ~\src\openframeworks)
-
Then move into your newly created directory ...
cd openFrameworks
-
... and checkout the
master-raspberrypi
branch:git checkout master-raspberrypi
- or if you want to live in the dangerzone
git checkout develop-raspberrypi
- Note: The
master-raspberrypi
branch is our best effort at a "it was working the last time we checked" branch.master-raspberrypi
is almost always a little bit behind thedevelop-raspberrypi
branch, whichusually
working, but is currently being developed at a rapid pace, so don't be surprised if you get odd errors. Either one you choose, if you find errors, please leave bug reports in our issue tracker. To use the develop branch,git checkout develop-raspberrypi
.
- First, you will need to install the dependencies and codecs oF uses using the following commands:
cd $(OF_ROOT)/scripts/linux/debian_armv6l
sudo ./install_codecs.sh
sudo ./install_dependencies.sh
- Next you need to build the core openFrameworks libraries. To do so, navigate to the
$(OF_ROOT)/libs/openFrameworksCompiled/project
folder on your RPI and run: _Note:this is going to take a while-
make
to build the Release library. - or
-
make Debug
to build the debug library. - or
-
make -j2
which uses the jobs option in make aka make^2, Note:this lets you run concurrently compiling jobs. google:"make -j option"
to learn more.
-
Note:This will use the new makefile system to automatically detect your system and will load the platform specific configurations found in the linuxarmv6l
subfolder. This platform specific makefile is used for compiling BOTH core libraries AND compiling specific oF projects. If you are experimenting with missing features, you may need to modify that file at some point. It is very well documented (in fact all of the new makefile system is heavily commented, so feel free to look around and make suggestions!).
Note: If you have the need for speed and have an Ubuntu desktop machine to spare (or VM!), see the Raspberry Pi Cross Compiling Guide.
###For master-raspberrypi
You can now navigate to the $(OF_ROOT)/apps/devApps
folder and try out a few simple RPI apps. To try the simplest one, go to the raspberrypi_hello_world
folder and run:
-
make
Note: This may take a few minutes to run the first time. - Then navigate into bin and run the app as instructed.
###For develop-raspberrypi
Currently the base makefiles are located in $(OF_ROOT)/scripts/linux/template/linuxarmv6l
but now we are going to copy the following files to your home directory for easy access.
cp Makefile ~/
cp config.make ~/
Now we are going to navigate to $(OF_ROOT)/apps/devApps
folder and try out a few simple RPI apps. You'll find the following apps:
- raspberrypi_hello_world
- raspberrypi_hello_world_gles2
Lets copy our Makefiles from our home directory into these projects and compile them: Note: you should do this for any RPI apps you want to build.
cp ~/Makefile ./PROJECT_DIRECTORY
cp ~/config.make ./raspberrypi_hello_world
- type make and follow the instructions on the screen after the successful builds.
Note: if you find any errors at this step compiling either raspberrypi_hello_world_gles2 or raspberrypi_hello_world please file them on github.
To run other examples or try out your own program, for the moment we recommend copying the raspberrypi_hello_world
example. In the future, projectGenerator
will make this easier.
Note: If you are a developer, please take a look at the config.make
file and the addons.make
files in the project directory.
##Notes:
For doing development on your pi from OS X via SSH you should perform the following steps:
- From OSX select System Preferences>Sharing>Internet Sharing
- Check Internet with 'Share Your Connection from: WiFi' and 'To Computers Using: Ethernet'
- Plug an ethernet cable from your Raspberry Pi into your Mac
- restart your Raspberry Pi
OSX uses the range 192.168.2.2-254
as its DHCP range for devices connected via the ethernet jack your pi will probably be 192.168.2.2
but it could be 192.168.2.7
You might have to run nmap to find the IP of your pi if you do not have a USB keyboard handy nmap -v -sP 192.168.2.2-254
should do the trick
If you have enabled mDNS (see above) or are using an earlier version of Raspbian with mDNS pre-enabled, the board will be reachable at raspberrypi.local.
(or raspberry.local.
) and you can SSH with the username pi: ssh [email protected].
If you haven't enabled mDNS open terminal and run the SSH command ssh [email protected]
if everything went well you should be presented with a password prompt.