A while back I had the need to make a DMX recorder that could run multiple streams of DMX and playback with a variety of different inputs. With that being the challenge, I did some learning about some pretty flexible and interesting software projects that are out there to help you a long the way.
Most people reading here will be interested in lighting technology so I am going to phrase this in that direction, but the principles of node-red can be applied to so many things it is impossible to mention, the links above should give you the resources you need. Most things can be done without resorting to hardcore code writing, and therein lies the real excitement of these two tools.
Both these things require a bit of reading to understand, and I can’t do them justice at all, so I’m going to give you a super brief birds eye view and point to some other reading.
PART ONE – OLA
OLA – Open Lighting Architecture – Why use it?
Their website says:
“The Open Lighting Architecture is a framework for lighting control information. It supports a range of protocols and over a dozen USB devices. It can run as a standalone service, which is useful for converting signals between protocols, or alternatively using the OLA API, it can be used as the backend for lighting control software. OLA runs on many different platforms including ARM, which makes it a perfect fit for low cost Ethernet to DMX gateways.”
I have been resistant to using this open source platform as I generally prefer to spin my own code for doing input and output of lighting data. However for a project like this, why spend hours perfecting the reception of sACN or using that DMX dongle you have lying about when these people have created a very clever demon that can essentially gather DMX via pretty much any means, and output it via the same.
You can install OLA on a linux system, or a Mac etc, I have tried both, my linux skills are pretty crappy, and I found that using a RaspberryPi with a standard image the easiest way to install it without a degree in computer science was just use one of their prebuilt packages, installed with sudo apt-get install ola.
Once you have installed the OLA platform you can have a look at its GUI using a web browser, if you have installed it locally you can do 127.0.0.1:9090
Here you are going to play with creating input and output universes, I was pretty frustrated by the lack of universe cross patch , for example connecting ArtNET 1 to sACN 10 is not possible, it only really does 1:1.
Way more interesting is if you setup some output universes you can now do good stuff from the command line.
such as ola_set_dmx –universe <universe> –dmx <values>
Entering ola_set_dmx -u 1 – d 255,255,255 will set the first three channels in whatever you have configured to be universe one to be at full.
Now then, why is that good. Well, you can now personally output sACN, ArtNET, DMX from all sorts of dongles etc etc etc from that one line. If your like me your thinking, ok great but now I have to write some code to actually do something useful with that. YAWN. Standby for part 2 – NodeRed …. just before we get there though, let’s just checkout ola_recorder. Now that is interesting, you can record and playback universes from the command line.
I tested it out using LumiNet monitor pushing in some ArtNET and then sending it back out again. It works!
PART TWO – Node Red
“Node-RED is a programming tool for wiring together hardware devices, APIs and online services in new and interesting ways.
It provides a browser-based editor that makes it easy to wire together flows using the wide range of nodes in the palette that can be deployed to its runtime in a single-click”
Ok so that says it all really, in the picture that the top of this post you can see my efforts at using NR to do something interesting.
Installing node red can be done with the sudo apt-get, but best to follow their instructions. Once you have done that, you can access its node based editor with the computer ip:1880 just like OLA. There is a world of stuff you can do here, including using the ui nodes to make a really easy webserver, and suddenly you have a dashboard with buttons that can do things in just a few mins.
I hit jackpot when I realised you can install node red on the same machine as OLA, and then interact with it as if you were typing on the command line. So suddenly instead of typing set_dmx, I can have a button on the webpage that does it. Or operates the recorder functions.
The above was a product of several days of wibbeling about trying to understand how the flows work in NR, and fiddling about to get it to do what I wanted to do.
So there we go, I would recommend having a look at both the different bits of software, and especially having a go at Node Red and seeing what it can do for you. I realise there are a tonne of other options for doing these things in a more efficient way, but for someone like me who is not super proficient in the more higher level languages it is really worth spending some time getting to know these things.
Also check out PM2 if you are feeling like running this stuff on a Pi of similar for a large amount of time, it manages processes, restarting if necessary, deals with starting things on boot up etc.