Recent Changes - Search:

edit SideBar

VirtualSerialPort

Node

virtual-serialport

  • Seems to be based on npm serialport 3.0, see Bug #9 is it updated for a list of missing serialport 4.0.7 methods.

Other Node virtual serial port

Mac

We want a virtual serial port so that we can test the serial port on the Mac by sending and receiving data.

See http://stackoverflow.com/questions/52187/virtual-serial-port-for-linux

Fortunately, mac port has socat!

Terminal 1:

 sudo port install socat
 socat -d -d pty,raw,echo=0 pty,raw,echo=0

You will get something like:

 2017/02/24 11:12:25 socat[8421] N PTY is /dev/ttys006
 2017/02/24 11:12:25 socat[8421] N PTY is /dev/ttys007
 2017/02/24 11:12:25 socat[8421] N starting data transfer loop with FDs [5,5] and [7,7]

Note the two port names.

In Terminal 2:

 cat < /dev/ttys006

In Terminal 3:

 echo "Test" > /dev/ttys007

Terminal 2 should show the "Test" output.

Edit - History - Print - Recent Changes - Search
Page last modified on March 23, 2017, at 02:02 am