Node.js interface for Enttec OpenDMX USB (and compatible) dongles
npm install node-opendmx
npm install --save node-opendmx
`Usage
Create the OpenDMX controller interface:
`
let dmx = new OpenDMX();
`Create a DMX device. In this example a simple RGB light (3 channels) is created. Pull requests for additional devices are welcome!
`
let light = new Devices.LEDRGB();
`Add the device to the collection of devices along with a starting channel. Since the RGB light uses 3 channels, the channels 1-3 in this DMX universe are now occupied.
`
dmx.addDevice(light, 1);
`Change the light to red color (just for example)
`
light.red();
`Render the DMX universe
`
dmx.render();
`Your LED light should now switch to red color.
`
light.off();
dmx.render();
`Your LED light should now be switched off.
Common driver related issues
Instructions below are for Debian / Ubuntu or Raspbian distributions.$3
Make sure you have the necessary build tools installed.
`
sudo apt install git bc bison flex libssl-dev make
`$3
Most likely you did not blacklist the default serial driver. Check the section "Blacklist the other serial drivers" in the installation tutorial.If for some reason blacklisting the serial driver doesn't work you can remove it from your system entirely using these steps:
- Find your current system architecture using
uname -a
- Move the file ftdi_sio.ko from /lib/modules/ to a location where the system can't find it.
- Move your DMX device driver dmx_usb.ko to the folder above
- Run sudo depmod The file
/lib/modules/ should now contain some new entries similar to this:`
alias usb:v0403p6006d[1-9]dcdscdpiciscipin dmx_usb
alias usb:v0403p6006d0[4-9]dcdscdpiciscipin dmx_usb
alias usb:v0403p6001d[1-9]dcdscdpiciscipin dmx_usb
alias usb:v0403p6001d0[4-9]dcdscdpiciscipin dmx_usb
`$3
You need to create a udev rule to automatically change device permissions once you plug in the dongle:- Find your dongle's vendor and device ID using
lsusb. You will find both IDs as ID in the output. If for example your output reads: Bus 001 Device 005: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC then 0403 is the vendor ID and 6001 is the device ID.
- In /etc/udev/rules.d create a new file and name it 50-dmx.rules. Add the following content to the file:`
ATTRS{idVendor}=="", ATTRS{idProduct}=="", SUBSYSTEMS=="usb", ACTION=="add", MODE="0660", GROUP="plugdev"
`
Replace and with the values you found above. You can also adjust the GROUP` value to match your requirements. Afterwards reboot your system, plug in the USB controller and it should have the requested permissions.