The Daemon <code>dmx-web</code> looks for a configuration file in <code>/etc/dmx-web.json</code>. An alternate location can be passed as a command line argument.
This configuration file consists of three sections:
- Server
- Universes
- Presets
In the Server section you can set the listen port and host.
Under Universes you describe the DMX Universes with details like which output driver to use and which devices are at which address.
The presets section allows you to specify a state some channels should be set when the preset is called.
A example configuration is in the repository by the name <code>dmx-web-example.conf</code>
A List of Channel Transistions can be POSTed to <code>/animation/<universe></code>. Each transistion is a JSON Object with at least the <code>to</code> property present. The Value of which also has to be an Object describing the channel end-states.
A duration for this transistion can be given in the <code>duration</code> property.
If not specified 0ms is assumed.
Example:
[
{"to": {"10": 0, "20": 0}},
{"to": {"10": 255}, "duration": 2000},
{"to": {"20": 255}, "duration": 1000}
]
This sets channels 10 and 20 to zero. Then transistions channel 10 to 255 in 2 seconds. After that channel 20 is faded to 255 in 1 second.
## Library API
var DMX = require('dmx')
### Class DMX
#### new DMX()
Create a new DMX instance. This class is used to tie multiple universes together.
#### dmx.registerDriver(name, module)
-<code>name</code> - String
-<code>module</code> - Object implementing the Driver API
- enttec-usb-dmx-pro: a driver for devices using a Enttec USB DMX Pro chip like the "DMXKing ultraDMX Micro".
- enttec-open-usb-dmx: driver for "Enttec Open DMX USB". This driver has not received enough testing and the hardware has known limitations. (If possible better obtain a device with the "pro" chip)