0.1.2 • Published 8 years ago

noflo-serialport v0.1.2

Weekly downloads
3
License
-
Repository
github
Last release
8 years ago

Serialport for NoFlo

Build Status npm version

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 --save

Basic 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/Open node and configure the port parameters. The output of the component is a serialport object
  • To write or read to the port add a serialport/Write and a serialport/Read nodes. The serialport input must be connected to the output of the serialport/Open node

Component usage

Close

Close the serial port

PortNameDatatypeDescription
InPortserialportstringSerialport object
InPortstopbangSignal to close the serial port
OutPorterrorstringMessage if an error occurs

Error

Sends a message if an error occurs

PortNameDatatypeDescription
InPortserialportstringSerialport object
OutPorterrorstringMessage if an error occurs

Open

Opens the serial port

PortNameDatatypeDescription
InPortportstringPort name or path
InPortbaudratenumberBaud Rate, defaults to 9600
InPortdatabitsnumberData Bits, defaults to 8. Must be one of: 5, 6, 7, or 8
InPortstopbitsnumberStop Bits, defaults to 1. Must be one of: 1 or 2
InPortparitystringParity, defaults to 'none'. Must be one of: 'none', 'even', 'mark', 'odd', 'space'
InPortbuffersizenumberSize of read buffer, defaults to 255. Must be an integer value
InPortparserstringThe parser engine to use with read data, defaults to 'raw'
OutPortoutstringSerialport object

Read

Reads the serial port

PortNameDatatypeDescription
InPortserialportstringSerialport object
OutPortoutobjectMessage. New data from the Serial Port

Write

Writes data to the serial port

PortNameDatatypeDescription
InPortserialportstringSerialport object
InPortmessagestringMessage. New data to the Serial Port
InPortdrainbooleanWaits until all output data has been transmitted
InPortstartbangSignal to write the message to the serial port

Example

NameGistFlowhub
Serialport Echocodeexample