2013-11-17 17:49:59 +00:00
# node-dmx
2019-01-15 12:58:59 +00:00
Webinterface and HTTP API using [node-dmx ](https://github.com/node-dmx/dmx )
2013-11-17 17:49:59 +00:00
2013-11-17 18:00:46 +00:00
## Install
2019-01-15 12:47:53 +00:00
`npm install -g dmx-web`
2013-11-17 18:00:46 +00:00
2013-11-17 17:49:59 +00:00
## Webinterface
### Configuration
2018-12-29 21:59:48 +00:00
The Daemon `dmx-web` looks for a configuration file in `/etc/dmx-web.json` . An alternate location can be passed as a command line argument.
2013-11-17 17:49:59 +00:00
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.
2018-12-29 21:59:48 +00:00
A example configuration is in the repository by the name `dmx-web-example.conf`
2013-11-17 17:49:59 +00:00
### Run
2018-12-29 21:59:48 +00:00
`dmx-web [-c <full-path to config file>]`
2013-11-17 17:49:59 +00:00
2017-07-16 16:54:18 +00:00
### Run as a service
2018-12-29 21:59:48 +00:00
On MacOS you can run dmx-web as a service by adding a launch script to `/Library/LaunchDaemons` . See the example file.
2017-07-16 16:54:18 +00:00
2013-11-17 17:49:59 +00:00
### Animation HTTP API
2019-01-15 12:58:59 +00:00
A List of Channel Transistions can be POSTed to `/animation/<universe>` . Each transistion is a JSON Object with at least the `to` property present. The Value of which also has to be an Object describing the channel end-states.
2013-11-17 17:49:59 +00:00
2018-12-29 21:59:48 +00:00
A duration for this transistion can be given in the `duration` property.
2013-11-17 17:49:59 +00:00
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.
2018-02-19 16:47:52 +00:00
## Community
We're happy to help. Chat with us on IRC in #node -dmx on freenode.