Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

enttec open dmx + nodejs

View dmx.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
#!/usr/bin/env node
 
///////////////////
// dmx.js //
///////////////////
 
// Sets all channels on your first DMX device to ARGV
// ie: `dmx.js 255`
 
 
var ftdi = require('ftdi');
 
var settings = {
'baudrate': 115200 / 2, // needs to be devided by 2... for some reason
'databits': 8,
'stopbits': 2,
'parity' : 'none',
};
 
var sleepTime = 20;
var device;
var universe = Array(513);
universe[0] = 0x00;
var value = process.argv[2];
if(value == null){ value = 0; }
 
function setAll(v){
var i = 1;
while(i < universe.length){
universe[i] = v;
i++;
}
}
 
function toHex(number){
var octet = parseInt(number).toString(16);
if(octet.length == 1){ octet = "0" + octet; }
var fullOctet = "0x" + octet;
return eval(fullOctet);
}
 
function writeLoop(){
process.stdout.write('.')
device.write(universe);
setTimeout(function(){
writeLoop();
}, sleepTime)
}
 
function shutdown(){
device.close(function(){
process.exit();
});
}
 
ftdi.find(function(err, devices){
device = new ftdi.FtdiDevice(devices[0]);
device.open(settings, function(){
setAll(toHex(value));
writeLoop();
shutdown();
});
});
Owner

I need help talking to the Enttec Open DMX USB DMX controller. I feel that I'm very close, and only have trouble with forming the DMX buffer itself (starting on line 101)

  • The excellent fdti package for node easly fins the device and can connect to it.
    • if you are on Maverics, you need to unload the built-in OSX FTDI driver with sudo kextunload -b com.apple.driver.AppleUSBFTDI
  • The DMX device relies on the computer to continuously send data (there is no onboard clock)
    • DMX operates at about 40 fames/sec, so we send the universe every ~20 ms (the exact frequency shouldn't matter, as DMX devices will keep their last state until the next signal)
  • The DMX start/stop codes, baudrate, etc have been confirmed and validated by both this ruby and node package
  • I can confirm that I can talk to the dmx device and the hardware works by using this OSX product
    • I can "reach" the dimmer pack, as when I send a signal, it does register a DMX signal... hence my supposition that the message is malformed.

Help?

Owner

@mcallegari I believe you are a DMX expert from your qlcplus project. Any advice?

Owner

Solved! Code updated above with a simple CLI tool to set channels on your DMX universe

Oh man, timing couldn't be any better on this!

Sweet! Now I can go buy one. W00T!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.