Nth Permutation Mathematics
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

meshblu-vserial

0.17.0 • Public • Published

skynet-serial

Virtual serial port running on top of skynet.im

SkynetSerialPort

Use skynet to message a physical remote serial device:

var SkynetSerialPort = require('skynet-serial').SerialPort;
var skynet = require('skynet');
 
// setup variables for myId, token, sendId
// the sendId is for the uuid of the physical serial device
 
var conn = skynet.createConnection({
  uuid: myId,
  token: token
});
 
conn.on('ready', function(data){
  var serialPort = new SkynetSerialPort(conn, sendId);
  var board = new firmata.Board(serialPort, function (err, ok) {
    if (err){ throw err; }
    //light up a pin
    board.digitalWrite(13, 1);
  });
});
 

bindPhysical

Bind a physical serial port to recieve/push data from skynet:

var SerialPort = require('serialport').SerialPort;
var bindPhysical = require('skynet-serial').bindPhysical;
var skynet = require('skynet');
 
// setup variables for myId, token, sendId
// the sendId should be for the uuid of the SkynetSerialPort app.
 
var conn = skynet.createConnection({
  uuid: myId,
  token: token
});
 
conn.on('ready', function(data){
  var serialPort = new SerialPort('/dev/tty.usbmodem1411',{
      baudrate: 57600,
      buffersize: 1
  });
  bindPhysical(serialPort, conn);
});
 

Keywords

none

install

npm i meshblu-vserial

Downloadsweekly downloads

12

version

0.17.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar