Personal tools
The Open Lighting Project has moved!

We've launched our new site at www.openlighting.org. This wiki will remain and be updated with more technical information.

Difference between revisions of "OLA Raspberry Pi"

From wiki.openlighting.org

Jump to: navigation, search
(Differences from the default Debian Image)
m (Add migrated template)
 
(52 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
{{PageMigrated|url=https://www.openlighting.org/ola/tutorials/ola-on-raspberry-pi/}}
 
[[Image:Raspi_Colour_R.png|right]]
 
[[Image:Raspi_Colour_R.png|right]]
  
Line 11: Line 12:
  
 
You'll need the following:
 
You'll need the following:
* A Raspberry Pi  board. The [http://elinux.org/Buying_RPi Buying Guide]
+
* A Raspberry Pi  board. See the [http://elinux.org/Buying_RPi Buying Guide] for how to purchase one.
* An SD card. Check the [http://elinux.org/RPi_Verified_Peripherals#SD_cards SD Card Compatibility List] but don't worry too much if your card isn't listed there. A 4GB card should be more than sufficient.
+
* An SD card, greater or equal to 4GB. Check the [http://elinux.org/RPi_Verified_Peripherals#SD_cards SD Card Compatibility List] but don't worry too much if your card isn't listed there.
 
* An SD card reader. Make sure it supports the SDHC (high capacity) cards.  
 
* An SD card reader. Make sure it supports the SDHC (high capacity) cards.  
 
* A microUSB cable to provide power
 
* A microUSB cable to provide power
 
* A CAT5 network cable.
 
* A CAT5 network cable.
 
* A Composite or HDMI monitor / TV to debug if things go wrong.
 
* A Composite or HDMI monitor / TV to debug if things go wrong.
 +
* A computer with a SSH Client and (optionally) Web Browser. You can use the Pi locally with a USB keyboard, but many people find it easier to access it from another machine.
 +
* A powered USB Hub, if you plan on using a USB DMX/RDM device. Many devices draw more current than the Raspberry Pi can support. See the [http://groups.google.com/forum/?fromgroups=#!searchin/open-lighting/usb$20hub/open-lighting/mJpgweztVdE/pXm5SOihjmAJ discussion] on the Open Lighting Group for more details.
  
 +
= Select your Image =
  
= Select your Image =
+
At this point you need to decide what image you want to use. The ''GIT Repo Image'' allows you to track the latest changes, but requires you to build the software yourself, which takes time. The ''Binary Package Image'' uses the pre-built binary packages for each release. The images are can be found at http://dl.openlighting.org/.
 +
 
 +
We recommend the ''Binary Package Image'' if you're starting out.
  
At this point you need to decide what version of OLA you want to use.
+
New images are released every month or two, so remember to update to take advantage of new features and bug fixes.
  
==GIT Repo==
+
==GIT Repo Image==
  
This tracks the [http://code.google.com/p/open-lighting/source/browse/ Git Repo], which means you can always use the very latest version of the code. The downside of using this option is that you have the build the code yourself (which takes time) and sometimes the code can break.
+
This tracks the [https://github.com/nomis52/ola Git Repo], which means you can always use the very latest version of the code. The downside of using this option is that you have the build the code yourself (which takes time) and configuration is left up to you. It's more flexible that the Binary Package version, but does require some extra work.
  
 +
Download the latest ola-git-NNNNNNNN.zip image.
  
==Debian Packages==
+
== Binary Package Image==
  
Use this option if you prefer a more stable system. The packages are usually updated once a month or so and you don't need to spend time building OLA from source.
+
[http://www.raspbian.org/ Raspbian] is an armhf  port of Debian specifically built for the Raspberry Pi. It offers slightly better performance than the stock Debian arm port.
 +
 
 +
Use this option if you prefer a more stable system. The pre-compiled packages are usually updated once a month and you don't need to spend time building OLA from source.
  
 +
Download the latest raspbian-ola-X.Y.Z.zip image.
  
 
= Copying the Image =
 
= Copying the Image =
  
Once you have selected an image, you need to copy it to your SD card. The [http://elinux.org/RPi_Easy_SD_Card_Setup Raspberry Pi Wiki] page has detailed instructions for each platform.
+
Once you have selected an image, unzip it, and then you need to copy it to your SD card. The [http://elinux.org/RPi_Easy_SD_Card_Setup Raspberry Pi Wiki] page has detailed instructions for each platform.
 +
 
 +
This can take a while if you have a slow SD Card (see [http://en.wikipedia.org/wiki/Secure_Digital#Speed_Class_Rating SDHC Speeds]). On my Linux machine with a Class 2 card it took 14 minutes to write the 3.9G image, a Class 4 card took 11 minutes.  On a Macbook Pro, using the onboard SD-Card slot it took 153 seconds to write the image using dd to a Class 4 card.  Your speeds are likely to vary between machines.
  
This can take a while if you have a slow SD Card (see [http://en.wikipedia.org/wiki/Secure_Digital#Speed_Class_Rating SDHC Speeds]). On my Linux machine with a Class 2 card it took 14 minutes to write the 3.9G image.
+
= Starting Up =
  
= Reboot & First Login =
+
Insert the card into the Raspberry Pi, make sure it's connected to a network which has a DHCP server running, and apply power. If you have a monitor attached you should see it booting. You'll then need to determine the IP address of your Pi. If you have a screen attached it should be shown just before the login prompt. Otherwise you can check your DHCP server logs and see which address was assigned. This example assumes an IP address of 192.168.1.200.
  
Insert the card into the Raspberry Pi, make sure it's connected to a network which has a DHCP server running, and apply power. If you have a screen attached you should see it booting. You'll then need to determine the IP address of your Pi. If you have a screen attached it should be shown just before the login prompt. Otherwise you can check your DHCP server logs and see which address was assigned. This example assumes an IP address of 192.168.1.200.
+
== Login using SSH ==
  
Now try to ssh to your Pi:
+
From your other machine, start your SSH client and SSH to your Pi. On Linux or Mac you can use the Terminal application and type:
  
 
<pre>
 
<pre>
ssh ola@192.168.1.200
+
ssh pi@192.168.1.200
 
</pre>
 
</pre>
  
 
The password is 'openlighting' (no quotes).
 
The password is 'openlighting' (no quotes).
  
You should see the login message and get a shell prompt.  
+
If you're on Windows you can download [http://www.chiark.greenend.org.uk/~sgtatham/putty/ PuTTY] and use that.
 +
 
 +
You should see the login message and get a shell prompt.  If that doesn't work, you may need to restart (pull the power and plug it in again). Sometimes the Pi gets into a weird state on the first boot.
  
 
== Security ==
 
== Security ==
  
By default, the image comes with a SSH Key installed for Simon to access the system. If you trust me (and your probably do since you're running my code) you can leave this on. Otherwise you can delete my key by running:
+
By default, the image comes with a SSH Key installed for Simon to access the system *only* if you configure your router and tell Simon what the address is. If you trust me (and your probably do since you're running my code) you can leave this on. Otherwise you can delete my key by running:
  
 
<pre>
 
<pre>
Line 65: Line 79:
 
<pre>
 
<pre>
 
passwd
 
passwd
 +
Changing password for ola.
 +
(current) UNIX password:
 +
Enter new UNIX password:
 +
Retype new UNIX password:
 +
</pre>
 +
 +
== Enable Turbo Mode (Optional) ==
 +
 +
The Raspberry Pi supports overclocking, which can increase the performance of your system. You can configured this by running
 +
 +
<pre>
 +
sudo raspi-config
 +
</pre>
 +
 +
and then selecting the ''overclock'' option. I (Simon) normally run with the Turbo option and haven't experienced any problems.
 +
 +
== Expand the Root Partition (Optional) ==
 +
 +
If your SD card is larger than 4GB you can expand the root partition to use all of the available space.  Again use
 +
 +
<pre>
 +
sudo raspi-config
 
</pre>
 
</pre>
  
 +
and then choose the ''expand_rootfs'' option.
 +
 +
== Installing (git image only) ==
 +
 +
The git image is a pre-built clone of the git repo. The 'make install' step hasn't been run, so before you can use OLA you'll need to run the following:
 +
 +
<pre>
 +
cd ~/open-lighting
 +
sudo make install
 +
sudo ldconfig
 +
</pre>
 +
 +
Then you can launch olad with:
 +
 +
<pre>
 +
olad -l 3
 +
</pre>
 +
 +
= Updating =
 +
 +
It's best to always use the latest version of OLA. Even immediately after downloding an image there may be updates to apply so we recommend you do this before you start using the Pi. To update your install follow one of the methods below, depending on what image you used.
 +
 +
== Git Repo ==
 +
 +
Once you're logged in, run:
 +
 +
<pre>
 +
cd open-lighting
 +
git pull
 +
autoreconf
 +
./configure --enable-rdm-tests
 +
make
 +
sudo make install
 +
sudo ldconfig
 +
</pre>
 +
 +
The make step can take a few hours.
 +
 +
== Binary Package Image ==
 +
 +
Run this:
 +
 +
<pre>
 +
sudo apt-get update
 +
sudo apt-get upgrade
 +
</pre>
 +
 +
= Connecting to OLA =
 +
 +
At this point everything should be running. You can access the OLA web UI by opening a web browser and typing:
 +
 +
http://192.168.1.200:9090
 +
 +
Of course you should replace 192.168.1.200 with the IP Address of your device.
 +
 +
= Config and Log files =
  
= Differences from the default Debian Image=
+
If you're using the pre-built image or Debian packages, the OLA config files are in <tt>/var/lib/ola/conf</tt>. The logs are written to <tt>/var/log/syslog</tt>.
  
If you're interested, here are the differences from the default Debian squeeze image.
+
= Related Information =
  
* Many unused packages have been removed (samba, X, mysql, nfs etc.)
+
If you're interested in how these images differ from the image released by the Raspberry Pi Foundation, see [[Building a Custom Raspbian Image]]
* OLA dependancies have been installed (microhttpd, libusb, etc.)
 
* The OLA git repo has been cloned into /home/ola/ola
 
* The pi account has been removed
 
* Root ssh access has been disabled
 
* /etc/rc.local has been modified to regenerate the ssh keys on the first boot
 
* Various other accounts have been removed (pnd, tli, buildbot etc.).
 
* Timezone changed to US/Pacfic
 

Latest revision as of 18:27, 31 May 2018

This page has migrated

This page has migrated to our new site, please see https://www.openlighting.org/ola/tutorials/ola-on-raspberry-pi/.

This content will not be updated and is just left here for reference and will be removed at some point in the future, see the link above for the most up-to-date version.


Raspi Colour R.png

This tutorial describes how to get OLA running on the Raspberry Pi. The procedure described here is designed to get OLA up and running as fast as possible. If you don't trust the images below, or want to build everything from scratch, you can install an image from the Raspberry Pi Site and use the generic instructions for Installing OLA on Linux.


There is plenty of information at the Raspberry Pi Wiki. The Raspberry Pi Forum is a good place to ask for help on Raspberry Pi specific issues.

Getting Started

You'll need the following:

  • A Raspberry Pi board. See the Buying Guide for how to purchase one.
  • An SD card, greater or equal to 4GB. Check the SD Card Compatibility List but don't worry too much if your card isn't listed there.
  • An SD card reader. Make sure it supports the SDHC (high capacity) cards.
  • A microUSB cable to provide power
  • A CAT5 network cable.
  • A Composite or HDMI monitor / TV to debug if things go wrong.
  • A computer with a SSH Client and (optionally) Web Browser. You can use the Pi locally with a USB keyboard, but many people find it easier to access it from another machine.
  • A powered USB Hub, if you plan on using a USB DMX/RDM device. Many devices draw more current than the Raspberry Pi can support. See the discussion on the Open Lighting Group for more details.

Select your Image

At this point you need to decide what image you want to use. The GIT Repo Image allows you to track the latest changes, but requires you to build the software yourself, which takes time. The Binary Package Image uses the pre-built binary packages for each release. The images are can be found at http://dl.openlighting.org/.

We recommend the Binary Package Image if you're starting out.

New images are released every month or two, so remember to update to take advantage of new features and bug fixes.

GIT Repo Image

This tracks the Git Repo, which means you can always use the very latest version of the code. The downside of using this option is that you have the build the code yourself (which takes time) and configuration is left up to you. It's more flexible that the Binary Package version, but does require some extra work.

Download the latest ola-git-NNNNNNNN.zip image.

Binary Package Image

Raspbian is an armhf port of Debian specifically built for the Raspberry Pi. It offers slightly better performance than the stock Debian arm port.

Use this option if you prefer a more stable system. The pre-compiled packages are usually updated once a month and you don't need to spend time building OLA from source.

Download the latest raspbian-ola-X.Y.Z.zip image.

Copying the Image

Once you have selected an image, unzip it, and then you need to copy it to your SD card. The Raspberry Pi Wiki page has detailed instructions for each platform.

This can take a while if you have a slow SD Card (see SDHC Speeds). On my Linux machine with a Class 2 card it took 14 minutes to write the 3.9G image, a Class 4 card took 11 minutes. On a Macbook Pro, using the onboard SD-Card slot it took 153 seconds to write the image using dd to a Class 4 card. Your speeds are likely to vary between machines.

Starting Up

Insert the card into the Raspberry Pi, make sure it's connected to a network which has a DHCP server running, and apply power. If you have a monitor attached you should see it booting. You'll then need to determine the IP address of your Pi. If you have a screen attached it should be shown just before the login prompt. Otherwise you can check your DHCP server logs and see which address was assigned. This example assumes an IP address of 192.168.1.200.

Login using SSH

From your other machine, start your SSH client and SSH to your Pi. On Linux or Mac you can use the Terminal application and type:

ssh [email protected]

The password is 'openlighting' (no quotes).

If you're on Windows you can download PuTTY and use that.

You should see the login message and get a shell prompt. If that doesn't work, you may need to restart (pull the power and plug it in again). Sometimes the Pi gets into a weird state on the first boot.

Security

By default, the image comes with a SSH Key installed for Simon to access the system *only* if you configure your router and tell Simon what the address is. If you trust me (and your probably do since you're running my code) you can leave this on. Otherwise you can delete my key by running:

rm .ssh/authorized_keys

Next change the password:

passwd
Changing password for ola.
(current) UNIX password: 
Enter new UNIX password: 
Retype new UNIX password: 

Enable Turbo Mode (Optional)

The Raspberry Pi supports overclocking, which can increase the performance of your system. You can configured this by running

sudo raspi-config

and then selecting the overclock option. I (Simon) normally run with the Turbo option and haven't experienced any problems.

Expand the Root Partition (Optional)

If your SD card is larger than 4GB you can expand the root partition to use all of the available space. Again use

sudo raspi-config

and then choose the expand_rootfs option.

Installing (git image only)

The git image is a pre-built clone of the git repo. The 'make install' step hasn't been run, so before you can use OLA you'll need to run the following:

cd ~/open-lighting
sudo make install
sudo ldconfig

Then you can launch olad with:

olad -l 3 

Updating

It's best to always use the latest version of OLA. Even immediately after downloding an image there may be updates to apply so we recommend you do this before you start using the Pi. To update your install follow one of the methods below, depending on what image you used.

Git Repo

Once you're logged in, run:

cd open-lighting
git pull
autoreconf
./configure --enable-rdm-tests
make
sudo make install
sudo ldconfig

The make step can take a few hours.

Binary Package Image

Run this:

sudo apt-get update
sudo apt-get upgrade

Connecting to OLA

At this point everything should be running. You can access the OLA web UI by opening a web browser and typing:

http://192.168.1.200:9090

Of course you should replace 192.168.1.200 with the IP Address of your device.

Config and Log files

If you're using the pre-built image or Debian packages, the OLA config files are in /var/lib/ola/conf. The logs are written to /var/log/syslog.

Related Information

If you're interested in how these images differ from the image released by the Raspberry Pi Foundation, see Building a Custom Raspbian Image