Share Arduino's sensor values with linda-socket.io
- write {type: "sensor", name: "light", value: value}
- write {type: "sensor", name: "temperature", value: value}
- https://github.com/node-linda/arduino-sensor
% npm install
Install Arduino Firmata v2.2
Arduino IDE -> [File] -> [Examples] -> [Firmata] -> [StandardFirmata]
sensors
- light
- analog input 0
- CdS and 330Ω
- temperature
- analog input 1
- LM35DZ
% npm start
=> http://linda-server.herokuapp.com/test?type=sensor
Run with your linda-server
% export LINDA_BASE=http://linda-server.herokuapp.com
% export LINDA_SPACE=test
% export ARDUINO=/dev/cu.usbdevice-name
% npm start
% gem install foreman
for launchd (Mac OSX)
% sudo foreman export launchd /Library/LaunchDaemons/ --app node-linda-arduino-sensor -u `whoami`
% sudo launchctl load -w /Library/LaunchDaemons/node-linda-arduino-sensor-main-1.plist
for upstart (Ubuntu)
% sudo foreman export upstart /etc/init/ --app node-linda-arduino-sensor -d `pwd` -u `whoami`
% sudo service node-linda-arduino-sensor start