Fix the readme and the examples

This commit is contained in:
Pierre Frisch 2017-07-16 09:54:18 -07:00
parent 07316ad789
commit 3e88846b55
4 changed files with 116 additions and 41 deletions

2
.gitignore vendored
View file

@ -13,3 +13,5 @@ results
.DS_Store .DS_Store
node_modules node_modules
.project
.com.greenworldsoft.syncfolderspro

View file

View file

@ -1,76 +1,143 @@
module.exports = { {
"server": { "server": {
"listen_port": 8080, "listen_port": 8080,
"listen_host": "::", "listen_host": "::",
// drop privileges to: "comment1": "On linux drop privileges by adding the following lines: uid: www-data and gid: www-data",
// "uid": "www-data", "comment2": "On Macos uid and gid must be set in the launchd script."
// "gid": "www-data"
}, },
"presets": [ "presets": [
{ {
label: "White", "label": "White",
values: { "values": {
'office': { 0:16, 1:255, 2:0, 3:255, 4: 255, 5:255, 15:16, 16:255, 17:0, 18:255, 19: 255, 20:255 } "office": { "0":16, "1":255, "2":0, "3":255, "4": 255, "5":255, "15":16, "16":255, "17":0, "18":255, "19": 255, "20":255 }
} }
}, },
{ {
label: 'Natural', "label": "Natural",
values: { "values": {
'office': { 0:16, 1:255, 2:0, 3:255, 4: 190, 5:140, 15:16, 16:255, 17:0, 18:255, 19: 190, 20:140 } "office": { "0":16, "1":255, "2":0, "3":255, "4": 190, "5":140, "15":16, "16":255, "17":0, "18":255, "19": 190, "20":140 }
} }
}, },
{ {
label: 'Worklight', "label": "Worklight",
values: { "values": {
'office': { 0:16, 1:130, 2:0, 3:255, 4: 165, 5:0, 15: 1, 16:255, 17:0, 18:255, 19: 190, 20:140, 21:0, 22: 0, 23:0, 24:255, 25: 190, 26:140 } "office": { "0":16, "1":130, "2":0, "3":255, "4": 165, "5":0, "15": 1, "16":255, "17":0, "18":255, "19": 190, "20":140, "21":0, "22": 0, "23":0, "24":255, "25": 190, "26":140 }
} }
}, },
{ {
label: 'Chill', "label": "Chill",
values: { "values": {
'office': { 0:16, 1:255, 2:0, 3:255, 4: 39, 5:0, 15: 1, 16:255, 17:0, 18:255, 19: 255, 20:0, 21:0, 22: 0, 23:0, 24:128, 25: 0, 26:255, 31:255, 32: 60 } "office": { "0":16, "1":255, "2":0, "3":255, "4": 39, "5":0, "15": 1, "16":255, "17":0, "18":255, "19": 255, "20":0, "21":0, "22": 0, "23":0, "24":128, "25": 0, "26":255, "31":255, "32": 60 }
} }
}, },
{ {
label: 'Cinema', "label": "Cinema",
values: { "values": {
'office': { 0:16, 1:30, 2:0, 3:255, 4: 39, 5:0, 15:0, 31:255, 32:0 } "office": { "0":16, "1":30, "2":0, "3":255, "4": 39, "5":0, "15":0, "31":255, "32":0 }
} }
}, }
], ],
universes: { "universes": {
'office': { "office": {
'output': { "output": {
// 'driver': 'enttec-usb-dmx-pro', "driver": "enttec-usb-dmx-pro",
// 'device': '/dev/cu.usbserial-6AVNHXS8' "device": "/dev/cu.usbserial-6A1KQK87"
'driver': 'null',
'device': 0
}, },
'devices': [ "devices": [
{ {
'type': 'eurolite-led-bar', "type": "eurolite-led-bar",
'address': 0 "address": 0
}, },
{ {
'type': 'eurolite-led-bar', "type": "eurolite-led-bar",
'address': 15 "address": 15
}, },
{ {
'type': 'showtec-multidim2', "type": "showtec-multidim2",
'address': 31 "address": 31
}, },
{ {
'type': 'stairville-led-par-56', "type": "stairville-led-par-56",
'address': 64 "address": 64
}, },
{ {
'type': 'stairville-led-par-56', "type": "stairville-led-par-56",
'address': 70 "address": 70
}, },
{ {
'type': 'stairville-led-par-56', "type": "stairville-led-par-56",
'address': 76 "address": 76
}
]
},
"bedroom": {
"output": {
"driver": "dmxking-ultra-dmx-pro",
"device": "/dev/cu.usbserial-6AVNHXS8",
"options": {
"port": "A"
}
},
"devices": [
{
"type": "eurolite-led-bar",
"address": 0
},
{
"type": "eurolite-led-bar",
"address": 15
},
{
"type": "showtec-multidim2",
"address": 31
},
{
"type": "stairville-led-par-56",
"address": 64
},
{
"type": "stairville-led-par-56",
"address": 70
},
{
"type": "stairville-led-par-56",
"address": 76
}
]
},
"livingroom": {
"output": {
"driver": "dmxking-ultra-dmx-pro",
"device": "/dev/cu.usbserial-6AVNHXS8",
"options": {
"port": "B"
}
},
"devices": [
{
"type": "eurolite-led-bar",
"address": 0
},
{
"type": "eurolite-led-bar",
"address": 15
},
{
"type": "showtec-multidim2",
"address": 31
},
{
"type": "stairville-led-par-56",
"address": 64
},
{
"type": "stairville-led-par-56",
"address": 70
},
{
"type": "stairville-led-par-56",
"address": 76
} }
] ]
} }

View file

@ -28,6 +28,10 @@ A example configuration is in the repository by the name <code>dmx-web-example.c
dmx-web [-c <full-path to config file>] dmx-web [-c <full-path to config file>]
### Run as a service
On MacOS you can run dmx-web as a service by adding a launch script to /Library/LaunchDaemons. See the example file.
### Animation HTTP API ### Animation HTTP API
A List of Channel Transistions can be POSTed to <code>/animation/&lt;universe&gt;</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 List of Channel Transistions can be POSTed to <code>/animation/&lt;universe&gt;</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.
@ -70,12 +74,14 @@ These drivers are currently registered by default:
- dmx4all: driver for DMX4ALL devices like the "NanoDMX USB Interface" - dmx4all: driver for DMX4ALL devices like the "NanoDMX USB Interface"
- enttec-usb-dmx-pro: a driver for devices using a Enttec USB DMX Pro chip like the "DMXKing ultraDMX Micro". - 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 device is NOT recommended, there are known hardware limitations and this driver is not very stable. (If possible better obtain a device with the "pro" chip) - enttec-open-usb-dmx: driver for "Enttec Open DMX USB". This device is NOT recommended, there are known hardware limitations and this driver is not very stable. (If possible better obtain a device with the "pro" chip)
- dmxking-utra-dmx-pro: driver for the DMXKing Ultra DMX pro interface. This driver support multiple universe specify the options with Port = A or B
#### dmx.addUniverse(name, driver, device_id) #### dmx.addUniverse(name, driver, device_id, options)
- <code>name</code> - String - <code>name</code> - String
- <code>driver</code> - String, referring a registered driver - <code>driver</code> - String, referring a registered driver
- <code>device_id</code> - Number or Object - <code>device_id</code> - Number or Object
- <code>options</code> - Object, driver specific options
Add a new DMX Universe with a name, driver and an optional device_id used by the driver to identify the device. Add a new DMX Universe with a name, driver and an optional device_id used by the driver to identify the device.
For enttec-usb-dmx-pro and enttec-open-usb-dmx device_id is the path the the serial device. For artnet it is the target ip. For enttec-usb-dmx-pro and enttec-open-usb-dmx device_id is the path the the serial device. For artnet it is the target ip.