noflo-serialport
v0.1.2
Published
Serialport for NoFlo
Maintainers
Readme
Serialport for NoFlo
This package provides utility components to access serial ports in the NoFlo Node.js runtime. Based on node-serialport.
Package installation
npm install noflo-serialport --saveBasic usage
- Install and set up a noflo-nodejs runtime. Follow this guide
- Install the component library locally with
npm - Start the runtime and log into Flowhub. The runtime should show up
- Connect the serial device to the computer
- Create a Flowhub project
- To open the serial port add a
serialport/Opennode and configure the port parameters. The output of the component is a serialport object - To write or read to the port add a
serialport/Writeand aserialport/Readnodes. Theserialportinput must be connected to the output of theserialport/Opennode
Component usage
Close
Close the serial port
Port | Name | Datatype | Description
-----|------|----------|-------------
InPort | serialport | string | Serialport object
InPort | stop | bang | Signal to close the serial port
OutPort | error | string | Message if an error occurs
Error
Sends a message if an error occurs
Port | Name | Datatype | Description
-----|------|----------|-------------
InPort | serialport | string | Serialport object
OutPort | error | string | Message if an error occurs
Open
Opens the serial port
Port | Name | Datatype | Description
-----|------|----------|-------------
InPort | port | string | Port name or path
InPort | baudrate | number | Baud Rate, defaults to 9600
InPort | databits | number | Data Bits, defaults to 8. Must be one of: 5, 6, 7, or 8
InPort | stopbits | number | Stop Bits, defaults to 1. Must be one of: 1 or 2
InPort | parity | string | Parity, defaults to 'none'. Must be one of: 'none', 'even', 'mark', 'odd', 'space'
InPort | buffersize | number | Size of read buffer, defaults to 255. Must be an integer value
InPort | parser | string | The parser engine to use with read data, defaults to 'raw'
OutPort | out | string | Serialport object
Read
Reads the serial port
Port | Name | Datatype | Description
-----|------|----------|-------------
InPort | serialport | string | Serialport object
OutPort | out | object | Message. New data from the Serial Port
Write
Writes data to the serial port
Port | Name | Datatype | Description
-----|------|----------|-------------
InPort | serialport | string | Serialport object
InPort | message | string | Message. New data to the Serial Port
InPort | drain | boolean | Waits until all output data has been transmitted
InPort | start | bang | Signal to write the message to the serial port
Example
Name | Gist | Flowhub -----|------|-------- Serialport Echo | code | example

