Jump to: navigation, search

Beagleboard P-ROC setup guide

This setup guide outlines how to get libpinproc/pyprocgame running on a Beagleboard-xM under Ubuntu (11.04).

Note: The guide was made using a Beagleboard-xM Rev C. If anything is different with other Beagleboard versions, the difference *should* be slight.

Installation Guide

Installing Ubuntu 11.04

The elinux.org installation guide for Natty 11.04 was followed exactly, and it worked perfectly.

Installing libpinproc

First things first, you'll probably want to create a user account instead of doing all of this as root. Starting as root:

   useradd <username>
   passwd <username>

Next edit /etc/sudoers and add the new user under the User privilege specification.

Now log out and log back in as <username>.

You'll also need to activate your ethernet port. You can do this by running "sudo dhclient eth0" every time you boot, or just add "dhclient eth0" to the /etc/rc.local file so it automatically runs at startup.

Now, for convenience, you might want to setup the ssh server so you can ssh in:

   sudo apt-get install openssh-server

If you want to continue now through an ssh connection, you can.

Tools / Python

   sudo apt-get install libftdi-dev git-core build-essential g++ cmake python-dev

Note - This installed python 2.7, which seems to work fine.

libpinproc Dependencies

yaml-cpp

Download, copy to your Beagleboard (I used 'scp'), and unzip. The cd into the newly unzipped directory and run:

   mkdir bin; cd bin
   cmake ..
   make
   sudo make install

libpinproc

Use git to get the repository, then build with the -fPIC option:

   git clone git://github.com/preble/libpinproc.git
   cd libpinproc
   mkdir bin; cd bin
   cmake -DCMAKE_CXX_FLAGS="-fPIC" ..
   make
   sudo make install

Installing pyprocgame

pypinproc

To install without modifying any files, your pypinproc directory should be at the same level as libpinproc.

   git clone git://github.com/preble/pypinproc.git
   cd pypinproc
   sudo python setup.py install

pyprocgame

   git clone git://github.com/preble/pyprocgame.git
   cd pyprocgame
   sudo python setup.py install

Note - This should have automatically installed setuptools, which is used later in this guide. If it didn't, you might want to install setuptools manually.

pyprocgame Dependencies

   easy_install PIL
   easy_install PyYAML


Note - PyYAML.org was down when this setup guide was made; so PyYAML was actually installed manually (download, scp it onto Beaglboard, unzip, run "python setup.py install")

proc-shared

   git clone git://github.com/preble/proc-shared.git


pyglet (optional)

   easy_install pyglet
  • Note - I ran into this bug and the package recommended in the comments did not fix it. I've therefore uninstalled pyglet from my board. If you figure out a way to get pyglet working, please edit this section with instructions.

pygame (optional)

pygame Dependencies
   sudo apt-get install libsdl1.2-dev libsdl-ttf2.0-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libportmidi-dev libv4l-dev
pygame

Due to a dependency issue, pygame could not be installed using easy_install. So, download pygame, scp it over, and unzip it. Then edit src/camera.h and change:

from:

   #include <linux/videodev.h>

to:

   #include <libv4l1-videodev.h>

Now run from the top pygame directory:

   sudo python setup.py install

pyprocgame configuration file

   mkdir ~/.pyprocgame

Now create and edit a "config.yaml" file with your pyprocgame configuration parameters. Refer to the pyprocgame's System Configuration File documentation for specifics.

==== desktop support (for graphics like virtual DMDs)

The master 1.0 branch of pyprocgame expects a desktop to be installed. If one is not installed, scripts will fail when attempting to load pyglet or pygame. If you want to install the ubuntu desktop:

   sudo apt-get install ubuntu-desktop

Be aware, it's a pretty big resource hog. If you don't need it, I'd recommend not installing it.

If you haven't installed a desktop and don't want to, you can switch to the dev branch of pyprocgame. From the pyprocgame directory:

   git checkout dev

Now add the following line to your ~/.pyprocgame/config.yaml file:

   use_desktop: False

Now the pyprocgame scripts you run will not attempt to pull in pyglet or pygame. If you want to use pygame's mixer for sound playback, you still can. You just have to import it directly into your script. I've never used pyglet; so I don't know if there's a similar solution for sound with it.

P-ROC udev

To allow software to control the P-ROC without running everything with 'sudo', you'll need to add a udev entry for the board. Create the file /etc/udev/rules.d/50-P-ROC.rules with the following contents:

   SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", SYSFS{idVendor}=="0403", SYSFS{idProduct}=="6001", MODE:="0666", GROUP="users"

Conclusion

That should be it. You should now be able to run pyprocgame scripts to control a P-ROC.