diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..77bc38c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM node:0.12-onbuild +MAINTAINER Cooper Maa + +RUN npm install -g coffee-script + +# Upgrade socket.io of the socketstream dependency package +# There is a "can't set headers after they are sent" bug in +# socket.io < 0.9.15, so we have to upgrade socket.io. +# Note socket.io@latest seems not compatible with socketstream +RUN cd node_modules/socketstream && \ + npm install socket.io@0.9.15 --save + +EXPOSE 3000 + diff --git a/README.md b/README.md index c0dd067..dfca320 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,15 @@ this repository and prepare it for use with: $ cd node-webduino $ npm install +Upgrade socket.io of the socketstream dependency package. There is a bug "can't set +headers after they are sent" in socket.io < 0.9.15, so we have to upgrade + socket.io. + + cd node_modules/socketstream + npm install socket.io@0.9.15 --save + +Note the lastest socket.io seems not compatible with socketstream. + ## Usage Upload Standard Firmata to your Arduino. Better to change samplingInterval from @@ -32,9 +41,23 @@ Here is a screencut of node-webduino for Arduino UNO: ![screencut](http://bit.ly/XHta3m) +## Dockerized node-webduino + +Suppose your Arduino is on /dev/ttyS1, then save the alias setting below to ~/.profile +or ~/.bashrc: + + $ alias node-webduino="sudo docker run -d --privileged \ + -v /dev/ttyS1:/dev/ttyACM0 \ + -p 3000:3000 coopermaa/node-webduino" + +Then run following to start node-webduino: + + $ node-webdunio + ## License [The MIT License](http://opensource.org/licenses/MIT) Credits: Developers of node.js, Arduino, SocketStream, AngularJS, firmata and people who involved in improving Web technologies. + diff --git a/package.json b/package.json index e0fa1b9..d50c535 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "author": "Cooper Maa ", "private": true, "engines": { "node": ">= 0.6.0" }, + "scripts": { "start": "coffee app.coffee" }, "dependencies": { "socketstream": "0.3.2", "ss-stylus": "0.1.x",