-
Notifications
You must be signed in to change notification settings - Fork 11
Raspberry Pi Getting Started
-
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.txtand set gpu_mem option togpu_mem=128for the 256mb pi andgpu_mem=256for 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 cleansudo apt-get updatesudo 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-raspberrypibranch 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-raspberrypibranch:git checkout master-raspberrypi- or if you want to live in the dangerzone
git checkout develop-raspberrypi- Note: The
master-raspberrypibranch is our best effort at a "it was working the last time we checked" branch.master-raspberrypiis almost always a little bit behind thedevelop-raspberrypibranch, whichusuallyworking, 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.
- Installing the Dependencies and Compiling my first raspberrypi+openFrameworks app
-
First, you will need to install the dependencies using the following command:
cd $(OF_ROOT)/scripts/linux/debian_armv6lsudo ./install_codecs.shsudo ./install_dependencies.sh
-
Next you need to build the core openFrameworks libraries. To do so, navigate to the
$(OF_ROOT)/libs/openFrameworksCompiled/projectfolder on your RPI and run: _Note:this is going to take a (while)[http://xkcd.com/303/]-
maketo build the Release library. - or
-
make Debugto build the debug library. - or
-
make -j2aka make^2, Note:this could do bad things if code is compiled in the wrong order (which is highly unlikely) but generally speeds things up. if you are running on a pandaboard it should reduce your compile time significantly as you have two cores. google:make -j optionto 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
linuxarmv6lsubfolder. 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.
-
-
Building Your App
-
branch master-raspberrypi :You can now navigate to the
$(OF_ROOT)/apps/devAppsfolder and try out a few simple RPI apps. To try the simplest one, go to theraspberrypi_hello_worldfolder 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.
-
branch develop-raspberrypi : Welcome to the wonderful world of of the new makefile system! Currently the base makefiles are located in
$(OF_ROOT)/scripts/linux/template/linuxarmv6lbut 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/devAppsfolder 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 into these projects and compile them:
cp ~/Makefile ./PROJECT_DIRECTORY-
cp ~/config.make ./raspberrypi_hello_world_Note: you should do this for any RPI apps you want to build.
- type make and follow the instructions on the screen after the successful builds.
- Now we are going to navigate to
-
branch master-raspberrypi :You can now navigate to the
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_worldexample. In the future,projectGeneratorwill make this easier.- Note: If you are a developer, please take a look at the
config.makefile and theaddons.makefiles in the project directory.
- Note: If you are a developer, please take a look at the
- 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
- 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)[http://nmap.org/] to find the IP of your pi if you do not have a USB keyboard handy
-
nmap -v -sP 192.168.2.2-254should 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.(orraspberry.local.) and you can SSH with the username pi:ssh [email protected]. - Now open terminal and run the SSH command
ssh [email protected] - if everything went well you should be presented with a password prompt.
- For doing development on your pi from OS X via SSH you should perform the following steps: