Open DMX USB is an open USB to DMX dongle hardware design developed by Enttec. The Open in Open DMX USB refers to the fact that everybody is free to use the design and produce its own USB DMX Dongle without paying any licenses. Since this fits the Linux philosophy I wrote a small Linux 4.X kernel driver to make it possible to use the dongle under Linux.
Getting the Driver
git clone git://github.com/lowlander/dmx_usb_module.git
It is also possible to just download a release package from github. If you want to use the driver on a Raspberry Pi 4, you can also try one of the pre-compiled versions available on github.
Compiling the Driver
Compiling the driver is done by simply calling make in the source directory. For this to work the kernel sources and development tools like gcc must be installed.
Building on a Raspberry Pi 4 running Raspbian
First update your Raspberry Pi 4 with the following commands;
apt-get update -y apt-get upgrade -y
After that you might want to reboot to make sure you are running the maybe updated kernel. Also make sure you have all the needed tools like gcc, make, git, etc. installed.
Than get the kernel source code;
# Get rpi-source sudo wget https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source -O /usr/bin/rpi-source # Make it executable sudo chmod +x /usr/bin/rpi-source # Tell the update mechanism that this is the latest version of the script /usr/bin/rpi-source -q --tag-update # Get the kernel files thingies. rpi-source
Now you should be ready to build the DMX USB module and the test program.
Using the Driver
To use the driver is a bit tricky because the FTDI Driver has the same USB-ID and so Linux loads that driver as soon as the DMX USB dongle is connected. The easiest way to prevent this is by removing the FTDI module out of the /lib/modules/ directory to place where the kernel can’t find it. Another solution would be to recompile the kernel without FTDI support.
Using the test program
After the dmx_usb module is loaded the
dmx_usb_test program can be started to test if things work. The program outputs DMX frames that, depending on the arguments passed to the test program, on a scope look something like this;
Since for most actions, like setting and clearing the break, there is a round trip command over the USB bus to the FTDI chip, causing timing to be relatively slow. Creating a 80 microsecond break or a 8 microsecond MAB will not be possible, around 500 microseconds per command seems about the limit. Another problem is the large delay of around 8 milliseconds after sending the frame, causing the max refresh rate to be about 30 Hz, as can seen on the scope screen capture;
For more stable DMX signal a more professional solution, with for example a micro controller that has direct access to a UART or a FPGA that generates the DMX signal, is needed.
But for cheap small DIY systems this Raspberry Pi + DMX USB dongle should work fine, I wish you happy Linux hacking :-)