CC0-1.0 License
This test assumes you have a prolific USB to RS-232 Serial Adapter.
ls /dev | grep tty.usb
which should return tty.usbserial
, if your driver was installed correctly.@serialport/repl
by running npm install -g @serialport/repl
serialport-repl {path-to-port} # serialport-repl /dev/tty.usbserial on a Mac
# This will pre-load a `port` variable with a connection to the serial adapter.
> port.open() # Allow the port to accept I/O
> port.write("Hello World!")
> const output = port.read()
<Buffer 48 65 6c 6c 6f 20 77 6f 72 6c 64 21> # If connection between pins was successfully made
> output.toString(); # should be "Hello World!"
An app is bundled using Electron which leverages SerialPort to display all serial connections.
You must have Node.js (which comes with npm) installed on your computer. From your command line:
# git clone the repository and run the following
cd electron-serialport-poc
# Install dependencies
npm install
# Run the app
npm start