DheerajKhajuria / pimatic-mysensors

mysensors
http://forum.mysensors.org/topic/797/pimatic-mysensors-controller-plugin
GNU General Public License v2.0
23 stars 24 forks source link

Ubuntu 16.04.1 LTS Server install #81

Open aap82 opened 8 years ago

aap82 commented 8 years ago

For anyone trying to get this to work on a non-pi system and running into issues, hopefully this will help.

This worked for me on a fresh install of Ubuntu Server 16.04.1 LTS with an Arduino UNO plugged into the usb port at /dev/ttyACM0 as the serial gateway.

This is using node v6.3.1 Here were my steps (assuming installed at root of your home directory): cd ~/pimatic-app npm install serialport cd node_modules mkdir pimatic-mysensors && cd pimatic-mysensors git clone https://github.com/DheerajKhajuria/pimatic-mysensors.git .

Then you need to do the following: open package.json using an editor find the line:

"serialport": "~2.0.6"

and change it to:

"serialport": "^2.0.6"

then open up serialport.coffee and change the constructor to this:

constructor: (protocolOptions)-> @serialPort = new SerialPort(protocolOptions.serialDevice, { baudRate: protocolOptions.baudrate, autoOpen: no, parser: serialport.parsers.readline("\n") })

Finally, my config section looks like this: { "debug": true, "driverOptions": { "serialDevice": "/dev/ttyACM0", "baudrate": 115200 }, "protocols": "1.5.1", "metric": "I", "plugin": "mysensors", "active": true }