mqtt-serial
A virtual node-serialport implementation that uses MQTT as the transport.
MQTTSerialPort
Use mqtt to send/receive data to a remote physical device:
var MQTTSerialPort = SerialPort;var mqtt = ;var firmata = ; // setup the mqtt client with port, host, and optional credentialsvar client = mqtt; //create the mqtt serialport and specify the send and receive topicsvar serialPort = client: client transmitTopic: 'REPLACE WITH YOUR TRANSMIT TOPIC' receiveTopic: 'REPLACE WITH YOUR RECEIVE TOPIC'; //use the virtual serial port to send a command to a firmata devicevar board = serialPort { if err throw err; //light up a pin board;};
bindPhysical
Bind a physical serial port to receive/send data from an mqtt server:
var SerialPort = SerialPort;var bindPhysical = bindPhysical;var skynet = ; // setup the mqtt client with port, host, and optional credentialsvar client = mqtt; // setup a connection to a physical serial portvar serialPort = '/dev/tty.usbmodem1411' baudrate: 57600 buffersize: 1; //connects the physical device to an mqtt server;