How to Control DMX Lights with Raspberry Pi
Make programming stage / DJ lights easy.
I have an upcoming project where I’ll be controlling the exterior lights on a prominent building in my city, and in order to do that, I need to master controlling DMX fixtures with a Raspberry Pi. I have an old DJ style light sitting at home that uses the DMX protocol that is perfect for testing. With a Raspberry Pi and a DMX adapter, we can use a bit of python to program the fixture. Getting it to work was an arduous process, so I hope I can make it simpler for the next person. If you’re looking to control DMX lights with a Raspberry Pi, here's the easy way to do it.
For this project, we’ll be using the Open Lighting Architecture (OLA) to send DMX frames to the lights. Before you get started, get your Raspberry Pi set up. If you haven't done this before, see our article on how to set up a Raspberry Pi for the first time or how to do a headless Raspberry Pi install (without the keyboard and screen). For this project, we recommend a headless Raspberry Pi install.
1. Install base requirements necessary for the project, including OLA, python, and python-bindings for the project.
2. Add the pi user to the olad group.
3. Descend into the OLA configuration directory and back up a few plugin config files. We won't use the backups, but it's helpful in case you need to reference something later on.
4. Edit the ola-ftdidmx.conf file to set `enabled=false` to` enabled=true`. You can use a text editor, or the command below.
5. Edit the ola-usbserial.conf and ola-opendmx.conf files to set `enabled = false`. You can use a text editor, or the commands below.
6. Reload the plugins by restarting the OLA daemon.
7. Plug in your Enttec Open DMX USB adapter to your Raspberry Pi, any USB port will do.
8. Using a DMX cable connect your Open DMX adapter to your fixture; make sure it is powered on and in DMX mode.
9. Run the following command to discover your device, note the number next to device ID.
Note: if your device is not discoverable, navigate to the web interface in step 11, and click "Reload plugins" - then try again.
10. Patch your device into a DMX universe (we’ll use universe 0) with the following command:
11. Visit the IP address of your Raspberry Pi in your web browser, followed by the port 9090 to confirm the universe has been created.
12. In the web interface, select your universe, navigate to the DMX Console tab, and increase the sliders for each channel until you see your fixture start lighting up. For my fixture, channel 1 controls red, 2 controls blue, and 3 controls green. By adjusting individual channels we can control the color of the fixture.
13. Using git, clone the example python repository to your home directory.
14. Descend into the directory and install the repository requirements.
15. Start the flask server with the following command. You can then visit the IP address of the Pi on port 8000 to see the server.
16. Change the colour of the lights by visiting the wash endpoints with curl or in your browser.
Hopefully, this gives you an example of how to get started with python and a Raspberry Pi to control DMX fixtures. Getting this to work properly for me was a weekend-long affair, but by following these instructions you should be able to get it done in under an hour. Good luck!
Join the experts who read Tom's Hardware for the inside track on enthusiast PC tech news — and have for over 25 years. We'll send breaking news and in-depth reviews of CPUs, GPUs, AI, maker hardware and more straight to your inbox.
Ryder Damer is a Freelance Writer for Tom's Hardware US covering Raspberry Pi projects and tutorials.
Raspberry Pi Drives Sailboat by Automating Autopilot
Raspberry Pi Night Vision Goggles Let You See at Night
GDDR6 VRAM Prices Plummet: 8GB of Memory Now Costs $27
By Les PounderApril 23, 2023
By Avram PiltchApril 22, 2023
By Brandon HillApril 21, 2023
By Avram PiltchApril 20, 2023
By Brandon HillApril 16, 2023
By Les PounderApril 15, 2023
By Les PounderApril 09, 2023
By Les PounderMarch 25, 2023
By Jarred WaltonMarch 19, 2023
By Les PounderMarch 18, 2023
By Avram PiltchMarch 15, 2023
Install base requirements Add the pi user to the olad group. back up a few plugin config files. Edit the ola-ftdidmx.conf file to set `enabled=false` to` enabled=true` Edit the ola-usbserial.conf ola-opendmx.conf files to set `enabled = false` Reload the plugins Plug in your Enttec Open DMX USB adapter to your Raspberry Pi connect your Open DMX adapter to your fixture Run the following command to discover your device Patch your device into a DMX universe Visit the IP address of your Raspberry Pi , followed by the port 9090 select your universe, navigate to the DMX Console tab, increase the sliders for each channel clone the example python repository install the repository requirements. Start the flask server Change the colour of the lights