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 "LLA, OpenDMX USB and Q Light Controller Tutorial"

From wiki.openlighting.org

Jump to: navigation, search
m (Put it all together)
m
Line 13: Line 13:
 
These are used to download source code.
 
These are used to download source code.
  
<code>
+
<code><pre>
 
sudo apt-get install git-core cogito curl
 
sudo apt-get install git-core cogito curl
</code>
+
</pre></code>
  
 
===Kernel source===
 
===Kernel source===
 
We need this in order to be able to compile the modules
 
We need this in order to be able to compile the modules
  
<code>
+
<code><pre>
 
sudo apt-get install linux-source
 
sudo apt-get install linux-source
</code>
+
</pre></code>
  
 
===Alien===
 
===Alien===
 
We will need to install some RPM files at some point (bah!)
 
We will need to install some RPM files at some point (bah!)
  
<code>
+
<code><pre>
 
sudo apt-get install alien
 
sudo apt-get install alien
</code>
+
</pre></code>
  
 
===Build essentials===
 
===Build essentials===
 
We're going to be building source, so we need the standard libraries:
 
We're going to be building source, so we need the standard libraries:
  
<code>
+
<code><pre>
 
apt-get install build-essential
 
apt-get install build-essential
</code>
+
</pre></code>
  
 
(if you're following this on a non-debian-style distibution, you need the libc, libstcd++ development files, C compiler etc.)
 
(if you're following this on a non-debian-style distibution, you need the libc, libstcd++ development files, C compiler etc.)
Line 51: Line 51:
 
===Compile and install driver===
 
===Compile and install driver===
  
<code>
+
<code><pre>
 
cd ~
 
cd ~
 
mkdir dmx-software
 
mkdir dmx-software
Line 60: Line 60:
 
cp ./dmx_usb.ko /lib/modules/$(uname -r)/kernel/drivers/usb/serial
 
cp ./dmx_usb.ko /lib/modules/$(uname -r)/kernel/drivers/usb/serial
 
depmod
 
depmod
</code>
+
</pre></code>
  
 
===Blacklist the other serial drivers===
 
===Blacklist the other serial drivers===
Line 67: Line 67:
 
With your favourite text editor, as root/sudo, edit /etc/modprobe.d/blacklist e.g.:
 
With your favourite text editor, as root/sudo, edit /etc/modprobe.d/blacklist e.g.:
  
<code>
+
<code><pre>
 
sudo gedit /etc/modprobe.d/blacklist
 
sudo gedit /etc/modprobe.d/blacklist
</code>
+
</pre></code>
  
 
add the following lines:
 
add the following lines:
  
<code>
+
<code><pre>
 
blacklist usbserial
 
blacklist usbserial
 
blacklist usb-serial
 
blacklist usb-serial
 
blacklist ftdi_sio
 
blacklist ftdi_sio
</code>
+
</pre></code>
  
 
===Remove the brltty package===
 
===Remove the brltty package===
 
According to Synaptic, "BRLTTY is a daemon which provides access to the Linux console (text mode) for a blind person using a soft braille display". Unfortunately it has a habit of interfering with anything that looks like it might be a serial console, USB to serial devices included.  There's probably a more elegant workaround, but we'll go for the quick and dirty again, and remove it:
 
According to Synaptic, "BRLTTY is a daemon which provides access to the Linux console (text mode) for a blind person using a soft braille display". Unfortunately it has a habit of interfering with anything that looks like it might be a serial console, USB to serial devices included.  There's probably a more elegant workaround, but we'll go for the quick and dirty again, and remove it:
  
<code>
+
<code><pre>
 
sudo apt-get remove brltty
 
sudo apt-get remove brltty
</code>
+
</pre></code>
  
 
===Test the driver===
 
===Test the driver===
 
Plug in your dongle!!  Hopefully all will go well, and if you type:
 
Plug in your dongle!!  Hopefully all will go well, and if you type:
  
<code>
+
<code><pre>
 
dmesg
 
dmesg
</code>
+
</pre></code>
  
 
you should see:
 
you should see:
  
<code>
+
<code><pre>
 
DMX USB device now attached to dmx192
 
DMX USB device now attached to dmx192
</code>
+
</pre></code>
  
 
If you've got other modules loading, ftdi serial drivers, etc. then something's wrong.
 
If you've got other modules loading, ftdi serial drivers, etc. then something's wrong.
Line 108: Line 108:
 
There are debian packages available at the time of writing.  Add the packages to your sources file:
 
There are debian packages available at the time of writing.  Add the packages to your sources file:
  
<code>
+
<code><pre>
 
sudo gedit /etc/apt/sources.list
 
sudo gedit /etc/apt/sources.list
</code>
+
</pre></code>
  
 
add the following line at the end:
 
add the following line at the end:
  
<code>
+
<code><pre>
 
deb http://www.nomis52.net/data/debian ./
 
deb http://www.nomis52.net/data/debian ./
</code>
+
</pre></code>
  
 
Install the packages:
 
Install the packages:
  
<code>
+
<code><pre>
 
sudo apt-get update
 
sudo apt-get update
 
sudo apt-get install liblla0 llad llad-console lla-examples
 
sudo apt-get install liblla0 llad llad-console lla-examples
</code>
+
</pre></code>
  
 
===Test the installation===
 
===Test the installation===
Line 130: Line 130:
 
First, start the daemon:
 
First, start the daemon:
  
<code>
+
<code><pre>
 
sudo llad
 
sudo llad
</code>
+
</pre></code>
  
 
Next, find out what number the OpenDMX device is:
 
Next, find out what number the OpenDMX device is:
  
<code>
+
<code><pre>
 
lla_dev_info
 
lla_dev_info
</code>
+
</pre></code>
  
 
you should get something like:
 
you should get something like:
  
<code>
+
<code><pre>
 
Device 2: Open DMX USB Device
 
Device 2: Open DMX USB Device
</code>
+
</pre></code>
  
 
If you can't see 'Open DMX USB Device' in there somewhere, then you haven't got the kernel driver installed properly.  Go straight to jail, do not pass go.
 
If you can't see 'Open DMX USB Device' in there somewhere, then you haven't got the kernel driver installed properly.  Go straight to jail, do not pass go.
Line 150: Line 150:
 
Assuming everything is OK, you need to patch this device so we can use it:
 
Assuming everything is OK, you need to patch this device so we can use it:
  
<code>
+
<code><pre>
 
lla_patch -d2 -p0 -u0
 
lla_patch -d2 -p0 -u0
</code>
+
</pre></code>
  
 
(replace -d2 with whichever device number is your Open DMX USB)
 
(replace -d2 with whichever device number is your Open DMX USB)
Line 158: Line 158:
 
now do:
 
now do:
  
<code>
+
<code><pre>
 
lla_dev_info
 
lla_dev_info
</code>
+
</pre></code>
  
 
and it should say
 
and it should say
  
<code>
+
<code><pre>
 
Device 2: Open DMX USB Device
 
Device 2: Open DMX USB Device
 
   port 0, cap OUT, universe 1
 
   port 0, cap OUT, universe 1
</code>
+
</pre></code>
  
 
Finally:
 
Finally:
  
<code>
+
<code><pre>
 
lla_dmxconsole
 
lla_dmxconsole
</code>
+
</pre></code>
  
 
and play with the console!
 
and play with the console!
Line 179: Line 179:
 
Don't forget to remove your test patch afterwards:
 
Don't forget to remove your test patch afterwards:
  
<code>
+
<code><pre>
 
lla_patch -r -d2 -p0 -u0
 
lla_patch -r -d2 -p0 -u0
</code>
+
</pre></code>
  
  
Line 187: Line 187:
 
Finally!  There are Ubuntu/Debian packages, but at the time of writing they're not the most up-to-date and don't include the LLA plugin.  You could compile from source, but the most recent RPM packages work fine and save time and hassle.
 
Finally!  There are Ubuntu/Debian packages, but at the time of writing they're not the most up-to-date and don't include the LLA plugin.  You could compile from source, but the most recent RPM packages work fine and save time and hassle.
  
<code>
+
<code><pre>
 
cd ~/dmx-software
 
cd ~/dmx-software
 
wget http://rpms.netmindz.net/FC6/i386/RPMS.netmindz/qlc-2.6.1-2.fc6.i386.rpm
 
wget http://rpms.netmindz.net/FC6/i386/RPMS.netmindz/qlc-2.6.1-2.fc6.i386.rpm
</code>
+
</pre></code>
  
 
(browse through the packages on that server and find the most recent qlc build if the above command fails)
 
(browse through the packages on that server and find the most recent qlc build if the above command fails)
  
<code>
+
<code><pre>
 
sudo alien qlc-2.6.1-2.fc6.i386.rpm
 
sudo alien qlc-2.6.1-2.fc6.i386.rpm
</code>
+
</pre></code>
  
 
wait a long time...  (don't worry about the warnings)... then:
 
wait a long time...  (don't worry about the warnings)... then:
  
<code>
+
<code><pre>
 
sudo dpkg -i qlc-2.6.1-2.fc6.i386.rpm
 
sudo dpkg -i qlc-2.6.1-2.fc6.i386.rpm
 
sudo apt-get install libqt3-mt
 
sudo apt-get install libqt3-mt
</code>
+
</pre></code>
  
 
Now try it:
 
Now try it:
  
<code>
+
<code><pre>
 
sudo qlc &
 
sudo qlc &
</code>
+
</pre></code>
  
 
QLC should run OK.  Don't get too excited yet, there's one more step...
 
QLC should run OK.  Don't get too excited yet, there's one more step...
Line 230: Line 230:
 
save it as something memorable (I use qlc-start) and make sure it's executable:
 
save it as something memorable (I use qlc-start) and make sure it's executable:
  
<code>
+
<code><pre>
 
chmod u+x qlc-start
 
chmod u+x qlc-start
</code>
+
</pre></code>
  
 
and you're away!
 
and you're away!

Revision as of 11:36, 29 June 2007

Introduction

I got very excited when I first saw QLC. Then I got slightly annoyed, then very frustrated trying to get it to work. I ended up using Slackware so that I could have a relatively modern distro with Linux 2.4 in order to use dmx4linux. But it's a hassle to reboot every time I want to play with DMX. So...

This guide assumes you're using Ubuntu 7.04 (Fiesty Fawn), but should be usable for any apt-based distro. Could probably be adapted for rpm-based too.

Operating System

Pretty obvious, but... get the latest Ubuntu installed on your machine. www.ubuntu.com

Prerequisite packages

GIT and Cogito

These are used to download source code.

sudo apt-get install git-core cogito curl

Kernel source

We need this in order to be able to compile the modules

sudo apt-get install linux-source

Alien

We will need to install some RPM files at some point (bah!)

sudo apt-get install alien

Build essentials

We're going to be building source, so we need the standard libraries:

apt-get install build-essential

(if you're following this on a non-debian-style distibution, you need the libc, libstcd++ development files, C compiler etc.)


Build and install the usb kernel module

We're not using dmx4linux since there's no version that supports kernel 2.6 and the OpenDMX USB dongle. There's a few attempts to port floating around, but none work with this adaptor.

Instead we will use Erwil Rol's driver.

It's best to make sure that you're running the kernel that you're intending to use - if you've upgraded from previous versions of Ubuntu you may have several versions hanging around. Removing old ones using Synaptic is probably a good idea.

Compile and install driver

cd ~
mkdir dmx-software
cd dmx-software
git-clone http://www.erwinrol.com/git/dmx_usb_module/
cd dmx_usb_module
make
cp ./dmx_usb.ko /lib/modules/$(uname -r)/kernel/drivers/usb/serial
depmod

Blacklist the other serial drivers

Because this dongle uses a usb to serial converter chip, it's recognised by the hotplug/udev/hal system and drivers are loaded - unfortunately not ones that work with QLC. The workaround is to blacklist the alternative drivers. If you have other usb to serial converters then they will stop working - if you need these then you will have to delve into the source and change the USB device IDs that the drivers detect... here we will go for the quick and dirty solution.

With your favourite text editor, as root/sudo, edit /etc/modprobe.d/blacklist e.g.:

sudo gedit /etc/modprobe.d/blacklist

add the following lines:

blacklist usbserial
blacklist usb-serial
blacklist ftdi_sio

Remove the brltty package

According to Synaptic, "BRLTTY is a daemon which provides access to the Linux console (text mode) for a blind person using a soft braille display". Unfortunately it has a habit of interfering with anything that looks like it might be a serial console, USB to serial devices included. There's probably a more elegant workaround, but we'll go for the quick and dirty again, and remove it:

sudo apt-get remove brltty

Test the driver

Plug in your dongle!! Hopefully all will go well, and if you type:

dmesg

you should see:

DMX USB device now attached to dmx192

If you've got other modules loading, ftdi serial drivers, etc. then something's wrong.


Download and install lla

LLA is Linux Lighting Architecture, a general framework for lighting applications in Linux. It's available as a live CD, but we're just using the package as a way to interface QLC with the USB driver. More info about LLA on it's webpage.

Install the packages

There are debian packages available at the time of writing. Add the packages to your sources file:

sudo gedit /etc/apt/sources.list

add the following line at the end:

deb http://www.nomis52.net/data/debian ./

Install the packages:

sudo apt-get update
sudo apt-get install liblla0 llad llad-console lla-examples

Test the installation

With your dongle connected as in section 3, you're now ready to test. Connect a DMX device up to your dongle, make sure you know the channel number it's on, make sure it's working correctly, make sure you got the polarity in your DMX lead right, etc. etc. Being sure that the dongle/hardware/software combination is the only weak link will save a lot of hair-pulling...

First, start the daemon:

sudo llad

Next, find out what number the OpenDMX device is:

lla_dev_info

you should get something like:

Device 2: Open DMX USB Device

If you can't see 'Open DMX USB Device' in there somewhere, then you haven't got the kernel driver installed properly. Go straight to jail, do not pass go.

Assuming everything is OK, you need to patch this device so we can use it:

lla_patch -d2 -p0 -u0

(replace -d2 with whichever device number is your Open DMX USB)

now do:

lla_dev_info

and it should say

Device 2: Open DMX USB Device
  port 0, cap OUT, universe 1

Finally:

lla_dmxconsole

and play with the console!

Don't forget to remove your test patch afterwards:

lla_patch -r -d2 -p0 -u0


Download and install the latest build of QLC

Finally! There are Ubuntu/Debian packages, but at the time of writing they're not the most up-to-date and don't include the LLA plugin. You could compile from source, but the most recent RPM packages work fine and save time and hassle.

cd ~/dmx-software
wget http://rpms.netmindz.net/FC6/i386/RPMS.netmindz/qlc-2.6.1-2.fc6.i386.rpm

(browse through the packages on that server and find the most recent qlc build if the above command fails)

sudo alien qlc-2.6.1-2.fc6.i386.rpm

wait a long time... (don't worry about the warnings)... then:

sudo dpkg -i qlc-2.6.1-2.fc6.i386.rpm
sudo apt-get install libqt3-mt

Now try it:

sudo qlc &

QLC should run OK. Don't get too excited yet, there's one more step...


Put it all together

We now need a script that will start the lla daemon, patch the adaptor to the DMX universe (QLC uses 1 by default, LLA uses 0) and start QLC. This should do it:

#!/bin/bash
gksudo killall llad
sleep 2s
sudo llad
sleep 5s
sudo lla_patch -d2 -p0 -u1
sleep 2s
sudo qlc &

save it as something memorable (I use qlc-start) and make sure it's executable:

chmod u+x qlc-start

and you're away!