Skip to content

Commit

Permalink
Work around crash in /dev/null testing mode
Browse files Browse the repository at this point in the history
To test effectserver without physical hardware, leave the host device path unconfigured. The web server will still work.
  • Loading branch information
teistiz committed Oct 19, 2014
1 parent 8afa831 commit 1265b7e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config.cson
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# path: "/dev/serial/by-id/usb-FTDI_FT245R_USB_FIFO_ENP9D7H7-if00-port0"
# path: "/dev/serial/by-id/usb-FTDI_USB__-__Serial-if00-port0"
# path: "/dev/serial/by-id/usb-FTDI_USB__-__Serial-if00-port0"
path: "/dev/serial/by-id/usb-ENTTEC_DMX_USB_PRO_ENR35XBU-if00-port0"
# path: "/dev/serial/by-id/usb-ENTTEC_DMX_USB_PRO_ENR35XBU-if00-port0"
type: "enttec"
mapping:
light:
Expand Down
8 changes: 5 additions & 3 deletions lib/enttec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ class Enttec
@_buffer = new Buffer 517
@reset()
@devices = []
@serial = new SerialPort opts.path,
baudrate: 57600
if opts.path
@serial = new SerialPort opts.path,
baudrate: 57600


add: (device) ->
Expand Down Expand Up @@ -115,7 +116,8 @@ class Enttec
# dmx packet must always end with 0xe7
@_buffer[@_buffer.length-1] = 0xe7

@serial.write @_buffer
if @serial
@serial.write @_buffer

exports.Enttec = Enttec
exports.RGBLight = RGBLight
Expand Down
1 change: 0 additions & 1 deletion node_modules/.bin/handlebars

This file was deleted.

3 changes: 3 additions & 0 deletions server.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ util = require "util"

CSON = require "cson"

process.on 'uncaughtException', (err) ->
console.log 'Caught exception' + err

{EffectManager} = require "./lib/effectmanager"
{packetParse} = require "./lib/packetparser"

Expand Down

0 comments on commit 1265b7e

Please sign in to comment.