Just in case you’re looking to make a networked, computer-controlled, internet-capable nightstand lamp, I’ve put together these easy instructions for how to do it with a maximum of pain and expense. This should have been an easy and fun project, based on DMX-enabled LED fixtures and some fairly simply homebrew software. However, a $5 part turned this into one of those projects from hell that makes one question whether reality is playing by the rules.
- Buy a new nightstand
- Realize that the nightstand would be much more useful if it actually had a reading lamp
- Spend hours online and going to real world stores, not finding a suitable lamp
- Realize that you have a couple of Chauvet Colorsplash Jr. lights sitting around which would make excellent lamps. And they’d be computer controllable, too! All you’d need would be a decent lampshade. Maybe a nice frosted glass cylinder.
- Break out the Enttec OpenDMX USB box and attach it to the obligatory file server in the laundry room.
- Discover that the OpenDMX uses XLR5 connectors, while the Colorsplash Jr’s use XLR3 connectors.
- Order XLR5 to XLR3 converter from some random online store.
- Meanwhile, start working on the software. Hey, there’s already a Python OpenDMX module out there, might as well write the software in Python then.
- Spend a bunch of hours putting some basic software together while learning a new language.
- Receive the XLR5 to XLR3 converter. Connect Colorsplash Jr. to server OpenDMX. Discover that software doesn’t work at all. No light.
- Troubleshoot for a while and discover that the OpenDMX is not at all the same thing as the DMX USB Pro. The OpenDMX is just a USB to RS-485 converter with no real intelligence in it. You just have to open the FTDI-based USB-to-serial port at 250000 baud (the rate of RS-485 communication for DMX) and talk straight bytes to it.
- Discover that the FreeBSD FTDI implementation doesn’t support 250000 baud.
- Open a bottle of wine.
- Get knee deep in FreeBSD kernel guts. Spend many hours. Figure out how to modify the FTDI driver to support 250000 baud.
- Recompile new kernel with homemade patch.
- Discover that pySerial doesn’t support 250000 baud, even if the kernel does.
- Get knee deep in pySerial guts. Discover that it relies on a C module which is compiled against the host OS’s termios.h.
- Discover that the FreeBSD termios.h doesn’t support 250000 baud.
- Patch termios.h to support 250000 baud.
- Recompile Python and pySerial.
- Hooray, a serial port opened at 250000 baud!
- Discover that test DMX program can talk to the light fixture, but the light does not behave as expected. Lots of strobing (undesirable in a reading lamp).
- Through much trial and error, find that Colorsplash Jr. is responding to DMX values of 0-63 rather than 0-255, and that it’s inverted (0=bright, 63 = dark, when it should be 0=dark, 255=bright).
- Call Chauvet tech support and be skeptical when they insist that there is no way their lights are behaving in this weird scaled, inverted way. Yeah, right, it’s tech support. What do they know?
- Hack software to allow for inverting and scaling brightness range.
- Discover that even now, simple gradient fades result in flashing and weird behavior. Sending 0xFF on channel 3 sets makes channel 4 dimmer!
- Read lots of DMX specifications. Find out about serial break and make-after-break timings. Find that DMX expects break times of 120usec. Discover that Freebsd is hardcoded to produce 400ms break signals — more than 3000 times too long. Suspect that this timing may be an issue.
- More kernel hacking. Make FreeBSD FTDI serial break signals dependent on that’s-what-it’s-there-for break timing parameter, which is otherwise unused.
- More PySerial hacking. Make it pass the requested break length in to the FreeBSD serial system.
- Discover that the light still strobes undesirably and generally acts weird.
- Decide that this OpenDMX is crap and relies on the host too much for timing. Order DMX USB Pro.
- While waiting, work on getting light wired to nightstand using nearby Ethernet wiring that goes to laundry room. Research DMX-over-XLR3 to DMX-over-Cat5 cables.
- Make appropriate cables to bring DMX from laundry room to nightstand via Cat5.
- Discover that light doesn’t work at all, as opposed to just acting weird when right next to the server.
- Drink more wine.
- Try XLR3-RJ45 cables on a different cat5 port which is known to work for Ethernet.
- Do a little dance when that works. At least copper wiring still behaves according to the laws of reality.
- Buy multimeter. Make RJ45 loopback plug. Start testing Cat5 wiring near nightstand.
- Discover that the laundry room patch panel is TI-568A, wiring next to nightstand is wired 568B.
- Unpunch / repunch nightstand wiring to conform to 568A.
- Reconnect light and XLR3-RJ45 cables on nightstand.
- Celebrate that the light behaves just as badly over a long cable run as it did next to the server. But at least it sort of almost works!
- Receive DMX USB Pro, with comes with another XLR5-to-XLR3 converter.
- Swap out homebrew OpenDMX python code for open source Python DMX USB Pro code.
- Discover that light behaves exactly the same way with different DMX interface and different code.
- Scream. Drink more wine.
- Test a different Colorsplash Jr. and get exact same result.
- Buy small version of commercial lighting management package for Windows.
- Confirm that commercial package has exactly the same problem.
- Figure that there must be something wrong with one or both DMX interfaces.
- Attach both OpenDMX and DMX USB Pro to FreeBSD server.
- Cable the two DMX interfaces together using two XLR5-to-XLR3 converters and an XLR3 cable.
- Write software that sets one to read and one to write to troubleshoot serial communication.
- Confirm that communication is borked. Send 0×00, receive 0×3F. Send 0×3F, receive 0×02. Send 0×80, receive 0xF4. That sort of thing. And no matter how many bytes are sent, one more is always received. Aaaaaargh.
- Scream again. Drink more wine.
- Decide that the problem must be in FreeBSD’s USB or serial subsystems. Tear into them. Add debugging instrumentation everywhere.
- Pour over dmesg logs. Trace every serial and USB interaction. Confirm that the correct number of correct bytes are sent at the correct speed, and the wrong number of wrong bytes are received at the correct speed.
- Scream. Open more wine.
- Take Windows laptop over next to light. Plug in OpenDMX. Confirm problem with commercial software.
- Swap for DMX USB Pro. Confirm problem with commercial software.
- Just for kicks, swap XLR5-to-XLR3 converters. It’s just a 3 wire cable, right?
- Commercial software works fine.
- Scream. Lots.
- Reconnect OpenDMX to FreeBSD machine over cat5.
- Rejoice that it works.
- Swap OpenDMX for USB DMX Pro
- Rejoice that that works, too.
- Try to think of a suitable and emotionally satisfying way to torture and kill the misbehaving XLR5-to-XLR3 converter.
- Enjoy the now-working nighstand light.
- Realize that it would be much better with a proper shade. Maybe a frosted glass cylinder.
- Start looking online and calling glass stores.
- Discover that it’s pretty much impossible to buy a 5″ inside diameter, 18″ tall frosted glass cylinder.
- Decide that the bare up-light is good enough.







Lol I’m doing the same path…
But I’m trying to use an embedded linux machine (foxbox) and working directly with rs485…
I have a lot of good wine’s bottles to open
Amarone della Valpolicella, Recioto, Soave and Bardolino.
But i think that i have to buy more…
Paggio
March 13th, 2008