Growl, IRC, and Irssi
Growl, for those who don't know, is a handy utility for Mac OS-X that lets applications unobtrusively display notifications on the screen. Many applications have buil-in support for popping messages up via Growl. One handy use is when an IRC or IM application receives a message for you but the application is minimized. You wouldn't see the message if the app is minimized, but with Growl the application can pop up a message on the screen.
Irssi is a highly customizable IRC client - it calls itself "the client of the future". One of the many features of Irssi is that you can customize it with perl scripts, and you can find literally hundreds of perl scripts for Irssi with very little effort.
As a professional systems administrator I need to have remote access to the systems I manage, as well as the ability to communicate with my fellow admins. We run an IRC server that lets us chat with each other whether in the office or remotely. I could run an IRC client on my Mac at work but the problem with that is accessing it remotely. Interacting with the desktop remotely is painfully slow, and a text-based IRC client like Irssi in conjunction with a utility like screen lets me keep my client logged into IRC and allows me to access it from virtually anywhere at any time. Most of us also opt to run our IRC clients on a shell server rather than our own desktop systems since the servers are more easily accessible, and less likely to go down due to hardware problems, power failures, etc.
So on my Mac at work I run Irssi in a screen session on a linux server. The problem is that I can miss important messages if I don't keep an eye on the Irssi session, and as any sysadmin will tell you it's very easy to get distracted.
I have found a few solutions that hook a remote Irssi session into Growl on your Mac desktop, but none of them had quite the features that I wanted. So I ended up writing my own, in part to learn a little about Growl & Irssi, and in part to give me those features I desired. Everything I've written can be downloaded from the link below, and it's all covered by the GPL so feel free to use and modify it as long as you adhere to the GPL.
There were three primary features I was interested in. The first was that the client and server communicate via TCP so that I could use port forwarding in SSH to ensure a secure connection between Irssi and Growl. The second was that if I didn't want to rely on an SSH tunnel that the datastream could be optionally encrypted to ensure a secure connection. Encryption is performed using Blowfish, and to enable it you just specify an encryption key in the configuration file. If you don't want to use encryption just comment out the encryption key.
The third feature is that the Irssi integration allow me to specify arbitrary text that would trigger Growl popups. I want Growl to notify me if somebody mentions certain key words or phrases in IRC. My Growl module allows you to easily add and remove arbitrary strings that will trigger Growl popups so that I can add and change them as desired.
Another feature not related to Irssi that I decided would be handy was to extend it so that I could easily add it to any other environments where I might want remote Growl messages. To that extent I wrote a command line utility that also lets you send Growl messages, and it supports the same features as the Irssi module.
The scripts should be extremely easy for anybody with minimal perl experience to install. They do require a number of perl modules, such as the Mac::Growl module that interfaces with Growl, as well as Crypt::CBCeasy for Blowfish encryption and a few others. See the README file for a complete list of all the modules.
The README file has complete instructions, but in a nutshell:
- Install the appropriate perl modules on both the client and the server
- Create the file ~/.growl-server on your Mac with the desired options (see the comments in the included sample)
- Run growl-server.pl on your Mac
- Place growl.pl in your ~/.irssi/scripts directory on the system where you run Irssi
- Edit growl.pl and modify any of the documented options to match those in ~/.growl-server
- Load the growl script into Irssi
Optionally, or if you just want to use the command line utility to send Growl messages:
- Create the file ~/.send-growl on the system that will be sending Growl messages
- Copy send-growl.pl to the system
- Run send-growl.pl (use -? or --help to see command line options)
There are a number of good DMX-512 resources available on the internet, but many of the primers focus mostly on the technical aspects of the protocol and less on practical usage. What follows is information on DMX-512 from more of a practical users perspective. For more resources see my DMX-512 Resources page. If you have other questions you'd like to see addressed here please e-mail me (click on "About" at the top of the page) or post a comment.
What exactly is DMX?
DMX is actually shorthand. The full standard is DMX512-A, which is typically referred to as just DMX-512 or DMX. It was originally designed as a standard for lighting consoles to communicate with dimmers used in theatrical lighting. Up until the early 1990's most lighting systems used proprietary protocols between consoles and dimmers, so it was difficult to have a console from one company communicate with dimmers from another. As DMX512 gained popularity it was quickly adapted by manufacturers of special effects, moving lights, etc. as a means to also control those devices.
DMX is a serial digital protocol. If you've used computers for a long time and are familiar with modems then the concept is very similar. Your lighting console will send one control signal down the DMX cable, followed by the second one, followed by the third one, and so on until all the data has been sent. Once all the data has been sent the console simply repeats itself and starts sending out the first control signal again. This happens quite rapidly - the default rate for DMX is 250 Kbaud or 250 thousand bits of data per second.
The 512 in DMX512-A corresponds to the number of control signals the protocol supports. A single DMX cable can carry 512 individual signals, so if you have a lighting console connected to a dimmer pack via a DMX cable then that cable can control a maximum of 512 dimmers. It is possible to split a DMX cable (more on this below), but each split would carry the exact same 512 channels of data as the source cable.
So a single DMX cable (or a cable split to run to multiple devices) would be capable of controlling any one of the following:
- 512 individual lighting dimmers
- 32 intelligent lights that require 16 channels each
- 256 dimmers, each of which has a light plugged into it and an individually controlled color scroller attached to the light
- Any combination of the above in which the total number of channels required is less than or equal to 512
The number 512 is easily represented in binary (512 = 2^9 = 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 = hex 200, etc). As such it provides an easy protocol for devices like lighting consoles (which are essentially just glorified computers) to work with them.
What exactly is a DMX channel?
A channel is simply one of the 512 control signals in the DMX512-A protocol. As it is a digital protocol, each channel is represented by 8 bits. Those 8 bits represent a value between 0 and 2^8 or 256. Most lighting consoles will abstract those values to a range between 0 and 100%. Newer and more feature-rich consoles will provide an option to let you view and work with DMX channels in either decimal (0-100%) or hexidecimal (0-255) depending on your needs.
So to summarize everything from above, DMX-512 is a protocol running at 250 Kbaud that transmits up to 512 8-bit values repetitively. (If you only use 100 channels then only those 100 8-bit values are transmitted.)
What is a DMX universe?
A single DMX universe, at the most basic level, is just a single DMX cable that carries 512 channels of data. More specifically, a DMX universe is a single DMX network. If a single DMX cable is run out of a lighting console and then split (see below) into multiple other cables, then all those cables make up a single DMX universe. They all carry the exact same DMX data.
Many lighting consoles have the ability to control multiple DMX universes. If a lighting console supports two or more universes then you will find two or more DMX connectors on the back of the console. They will be labeled something like "DMX universe 1", "DMX universe 2", etc. or "DMX 1-512", "DMX 513-1024", etc.
So exactly how many devices can DMX control?
This actually depends on the lighting console you have. If the console only supports a single DMX universe then it can control a maximum of 512 independent single channel devices. If you want to control 16 channel devices then a single universe can control only 32 devices (512/16 = 32). Obviously if your lighting console supports multiple universes then the number of devices you can control increases.
If you only have a single universe it still doesn't mean you can control only 512 devices. Suppose you have a setup where you have ten different Red/Green/Blue LED lights. Each light takes 3 channels, one for the intensity of each color. If you want to control those 10 lights independently then you would need 30 channels. However suppose you wanted all ten of those devices to always work exactly the same (perhaps they're all providing a uniform wash on a stage). If that's the case then you can set all ten of those lights to the same DMX address, and they will all respond identically. In this setup you only end up using 3 channels instead of 30.
You can have a virtually unlimited number of devices that are all set to respond to the DMX channel if desired. This isn't always desired, but in certain cases it can be very useful. It's not uncommon to see multiple color scrollers set to the same DMX channel if they're used for color washes. So between consoles that support multiple universes and setting multiple devices to the same DMX channel you can control a virtually unlimited number of devices.
DMX cables & connectors
The DMX protocol physically requires 3 individual wires within a DMX cable. These are identified as:
- Data common
- Data +
- Data -
The Data + and Data - are simply complements of each other, so if the Data + line has a voltage of +1 volt when compared to the common then the Data - line will have a voltage of -1 volt. If you look at the DMX512-A specification or other websites that discuss DMX you will find references to a second pair of Data + and Data - lines that are considered optional. These are considered optional as they are not actually used in typical DMX environments. Some devices may make use of them, but if they do then it's not in any standardized way.
The specification for DMX is very specific with respects to the connectors and cables that should be used. Unfortunately many liberties have been taken over the years that has muddled the waters as far as both cables and connectors go. The DMX specification stipulates that 5-pin XLR connectors be used, and the vast majority of professional lighting consoles, dimmers, etc. all use 5-pin XLR connectors despite the fact that only 3 pins are used. Among other things, the use of 5-pin connectors helps to prevent you from accidentally plugging a lighting console or dimmer pack into a 3-pin audio XLR cable. If that audio cable is connected to an audio mixer that provides a phantom power supply of 48 volts (used by microphones) then you could burn out part of your console, dimmers, etc.
The DMX specification also stipulates that cable that adheres to the RS485 standard be used. Cable designed to this specification can carry digital signals over long distances in electrically noisy environments. Standard shielded microphone cable is not RS485 rated so it should not be used. Some examples of RS485 cable include Belden 9841, Belden 9842, and Alpha 5274 among others. A quick Google search for those will find plenty of sources for them.
Unfortunately (or fortunately depending on your perspective) some manufacturers of intelligent lighting effects realized early on that despite not being approved by the DMX512-A specification, that regular microphone cable can actually carry a DMX signal for short (50 feet or so) runs. They also realized that traveling disk jockeys already likely have lots of microphone cable so to cater to their needs they started developing and selling DMX controlled party lights using 3-pin XLR connections. Today you can find lots of 3-pin intelligent lights from a wide range of companies like American DJ, Chauvet Lighting, and even Martin and many others.
Because of the prevalence of lighting gear that require 3-pin XLR connections it's a good idea for any lighting designer to have at least a few 3-pin to 5-pin adapters. You can make them yourselves - just connect pin 1 to pin 1, 2 to 2, and 3 to 3, leaving pins 4 and 5 on the 5-pin side unused.
Splitting DMX cables
Simply making a 'Y' connector out of three XLR connectors is a BIG no-no. Depending on the quality of the cable you use and the length of each leg of the "Y" you will likely have some of the DMX signal reflect back down to the junction and out the other leg, resulting in what can best be described as schizophrenia by your DMX devices. They will start behaving in extremely unpredictable ways due to the "leak" of the signal from one leg to the other.
If you need to split a DMX signal (and it's a very common need) the right way to do it is with a device known as an optical splitter. This is a device that you plug a single DMX cable into and it may have 2, 4, or many more DMX outputs that each mirror the signal on the input line. Each of the outputs is electrically isolated from the others using optical isolators which prevent reflections from one leg impacting any of the other legs. Examples of DMX optical splitters can be found here, here, and here among others.
One nice feature of some DMX splitters is that they support both 3-pin and 5-pin XLR connectors, meaning that they can be used not only as splitters but converters as well.
Terminating DMX cable runs
The same signal reflections described above when splitting a DMX cable using a "Y" connector can happen on a single un-split run of DMX cable if it is long enough. To prevent this from happening it is good practice to always attach a DMX terminator to the end of each DMX run. A DMX terminator is simply just an XLR connector with a resistor attached between pins 2 and 3. You can make your own DMX terminators very easily or even add an LED or two in order to make a useful DMX tester.
You may quickly find that sometimes termination doesn't seem to be important, especially with shorter cable runs. But if you see even the slightest odd behavior in your devices then it is strongly suggested that you add a terminator and also make sure your DMX cables are of the right type and not damaged in any way. Lots of problems can be traced to dirty DMX signaling caused by a lack of termination and/or faulty cables.
Some devices will have DMX termination built into them. Check the devices manual to see if it does, and if so how to enable or disable it as needed. Usually this is just a switch you can turn on or off as needed. If a device does provide built-in termination then make sure it's disabled unless you need it (the device is the last one in a DMX chain).
Any device that uses DMX must have a way to specify the DMX channel(es) that it will respond to. This is typically referred to as the "starting address", and for simpler devices like color scrollers it is usually set by a series of rocker switches or dial switches. Rocker switches are used to add together the binary values 1, 2, 4, 8, 16, etc. into the desired value. Dial switches let you pick the values 0-9 to specify a three digit value. More sophisticated devices like robotic lights will typically have a control panel with menu options that let you set the channel with a few button presses.
In all these cases what you are setting is just the first address that the device will respond to. If a device only uses one address then it's easy enough to keep track of. If a device requires more than one address, such as a four channel portable dimmer pack, then the address you specify plus three more would be used by that device. So if you specify channel 132 for a four channel dimmer pack then 132 controls the first dimmer, 133 controls the second, 134 the third, and 135 the fourth. The "fancier" the device the more channels it is likely to use, and a different number of channels may be used depending on how you program the device. A robotic light may use 16 channels in one mode but 20 in another. It is critical that you keep track of how many DMX channels each device you have uses and make sure you don't accidentally overlap channels. If you overlap channels across two devices you'll likely get very unpredictable results.
It is possible, and perfectly reasonable, to assign the same DMX address to multiple devices. Suppose you have 6 fixtures that provide a wash across your stage and each of those fixtures has a color scroller attached to it. If you know for certain that you'll always want those 6 fixtures to use the same colors at the same time then you can set all those scrollers to the same DMX address and they will all scroll in unison. However if you want to wash half of your stage in red and half in blue then you might need to assign three scrollers to one channel and three to another. If you need to independently control all of them then you'd need to assign them six different channels.
Working with color scrollers and other common devices
Color scrollers are one type of device that DMX is well suited for and fairly easily to understand. A typical color scroller uses a single DMX channel to adjust the positioning of a scroll of gels in front of a stage light. Depending on the type of scroller it may have 8, 16, or some other number of colors in the gel scroll. A DMX value of 0 will display the first color in the gel scroll, and a value of 100% or 255 (2^8) will display the last color in the gel scroll. By adjusting the DMX value you can "dial in" any color on the scroll.
[Note: There are vendors who sell different types of scrollers that use two scrolls of gel to create a wide mix of colors. If you are just getting started in working with scrollers make sure you know what you're using.]
A DMX cable by itself is incapable of providing the power required to operate a color scroller. Some scrollers, mostly older ones, plug directly into an AC line, which means that you would need to run both power distribution and DMX to each scroller you use. This, needless to say, is a real pain. Most modern scrollers as well as many other devices (DMX irises, moving mirrors, etc.) now get their power from a standardized power supply. A Power Supply Unit, or PSU, takes both an AC line input and a DMX input, and combines them into a single output on a 4-pin XLR cable. Different sized PSU's can power a different number of devices. Make sure you don't overload a PSU with too many devices. Using 4-pin cable you can daisy-chain a number of devices like scrollers, mirrors, and irises together. On more than one occasion I have created a "poor mans" intelligent light by attaching a scroller, iris, and moving mirror to a Source 4 fixture, and having to daisy chain only a single cable among those devices makes it that much easier to manage.
The 4-pin cable that runs from a PSU to scrollers and other devices is a very special type of cable, so don't go making your own unless you're absolutely certain you know what you are doing. Two of the pins provide power and two provide the DMX signal, using the negative power lead as a common. The two power leads are 14 AWG and the DMX leads are 22 AWG, with slightly different characteristics to a standard DMX cable. So be very careful if you are going to make your own cables.
Important: As mentioned above, some vendors sell different types of scrollers that work in slightly different ways than conventional scrollers. These scrollers, and other devices, also make use of 4-pin XLR cables to connect power and data from a PSU to the device. However these PSU's are incompatible with the PSU's used by conventional scrollers despite appearing to function identically and using the same 4-pin cables. The Wybron CXI scroller is one example of a scroller that uses a custom power supply.
8-bit and 16-bit Addressing
If you ever work with devices like robotic lights or moving mirrors you will have to understand the difference between 8-bit and 16-bit addressing. As mentioned earlier, each DMX channel provides 8 bits of data, or a value between 0 and 255. But suppose you have a robotic light or a mirror that can pan around an entire 360 degree circle. Mapping the range of 0-255 to 360 degrees means that for each value you would have to move the fixture more than 1.4 degrees. For a very short throw that may not seem like very much, but if you want that light to have a 25 foot throw then each of the 255 steps would correspond to 8 inches of movement. Not many lighting designers would approve of that!
In order to provide better control over actions like panning and tilting intelligent lights, moving mirrors, etc. they typically combine two DMX addresses together for each parameter (pan and tilt). By combining two DMX addresses together you jump from 8-bit (0-255) to 16-bit (0-65,535) resolution, which gives you much more control over the positioning of the fixture.
Some devices like the Rosco I-Cue mirror let you specify if you want the pan and tilt parameters to use 1 channel (8-bit) or 2 channels (16-bit), so depending on how you configure the device it may use 2 or 4 channels.