This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| monteslu@localhost:~/code/jake$ node index.js | |
| info - socket.io started | |
| debug - client authorized | |
| info - handshake authorized 23wmvxyIDgHCyvUN6Rpn | |
| debug - setting request GET /socket.io/1/websocket/23wmvxyIDgHCyvUN6Rpn | |
| debug - set heartbeat interval for client 23wmvxyIDgHCyvUN6Rpn | |
| debug - client authorized for | |
| debug - websocket writing 1:: | |
| { id: '23wmvxyIDgHCyvUN6Rpn', | |
| namespace: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var SkynetSerialPort = require('skynet-serial').SerialPort; | |
| var skynet = require('skynet'); | |
| var firmata = require('firmata'); | |
| var myId = '26ce1ac8-2133-4faa-bcb9-3548fec5f111'; | |
| var sendId = '26ce1ac8-2133-4faa-bcb9-3548farduino'; | |
| var token = '2bb7507b5a74494a8be233b068d8c1f'; | |
| var msgCount = 0; | |
| var token, serialPort, board, firm; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var SkynetSerialPort = require('skynet-serial').SerialPort; | |
| var skynet = require('skynet'); | |
| var firmata = require('firmata'); | |
| var myId = '26ce1ac8-2133-4faa-bcb9-3548fec5f11a'; | |
| var token = '2bb7507b5a74494a8be233b068d8c1e'; | |
| //jake's id | |
| var sendId = '744d4bd1-97be-11e3-a924-db90dd71caef'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*global chrome*/ | |
| var EventEmitter = require('./events.js').EventEmitter; | |
| var util = require('./util.js'); | |
| function SerialPort(port, options) { | |
| var self = this; | |
| var id; | |
| var bytesToRead = options.buffersize || 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //the uuid you're posting too could be same you're using for auth | |
| curl -X POST -d "foo=bar&temperature=78" http://skynet.im/data/{some uuid} --header "skynet_auth_uuid: {my uuid}" --header "skynet_auth_token: {my token}" | |
| curl -X GET http://skynet.im/data/{some uuid} --header "skynet_auth_uuid: {my uuid}" --header "skynet_auth_token: {my token}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| msg.payload = { | |
| setState: { | |
| hue: 0xcc15, | |
| sat: 0xffff, | |
| white: 5000, | |
| lum: 0x8000, | |
| bulbName: 'bulby' | |
| } | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| msg.uuid = 'gateway uuid'; | |
| msg.token = 'gateway token'; | |
| msg.alternateMethod = 'gatewayConfig'; | |
| msg.method = 'createSubdevice'; | |
| //msg.method = 'getDefaultOptions'; | |
| msg.name = 'aj'; | |
| msg.type = 'skynet-alljoyn'; | |
| msg.options = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| msg.subdevice = 'lx'; | |
| msg.payload = { | |
| setState: { | |
| hue: 65000, | |
| sat: 0xffff, | |
| white: 5000, | |
| lum: 0x8000 | |
| } | |
| }; | |
| return msg; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pi@raspberrypi ~/rpt $ npm install raspi-io | |
| npm WARN package.json rpt@1.0.0 No description | |
| npm WARN package.json rpt@1.0.0 No repository field. | |
| npm WARN package.json rpt@1.0.0 No README data | |
| - | |
| > raspi-wiringpi@1.0.3 install /home/pi/rpt/node_modules/raspi-io/node_modules/raspi-core/node_modules/raspi-wiringpi | |
| > sh install-wiringpi.sh | |
| Wiring Pi is already installed, skipping |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var net = require('net'); | |
| var five = require('johnny-five'); | |
| var firmata = require('firmata'); | |
| var client = net.connect({port: 8124}, function() { //'connect' listener | |
| console.log('connected to server!'); | |
| console.log('connected to server event!'); | |
| var io = new firmata.Board(this); |