Skip to content

Socat

Creating virtual serial port pairs with socat on macOS.

1 min read

References:

  1. http://www.xappsoftware.com/wordpress/2013/10/10/how-to-run-socat-on-mac-os-x/
  2. http://scott.cranton.com/2011/04/socat-is-so-cool.html
  3. http://justcheckingonall.wordpress.com/2009/06/09/howto-vsp-socat/
  4. http://buhadram.wordpress.com/2008/10/07/some-useful-socat-commands/

Running socat on Mac OS X

Install socat

Terminal window
sudo port install socat

Create a pair of VSP (Virtual Serial Port)

Terminal window
socat -d -d pty,raw,echo=0 pty,raw,echo=0
2014/08/07 01:40:56 socat[74896] N PTY is /dev/ttys001
2014/08/07 01:40:56 socat[74896] N PTY is /dev/ttys002
2014/08/07 01:40:56 socat[74896] N starting data transfer loop with FDs [3,3] and [5,5]

Open a new terminal and enter

Terminal window
sudo cat /dev/ttys001

Open another terminal and enter

Terminal window
sudo echo "Hello World" > /dev/ttys002

On the first terminal you will see the string “Hello World”.

Related articles

1 min read

gnome

Making the GNOME login screen ask for a username instead of showing the user list.

  • Linux & Systems
2 min read

Jitsi

Self-hosting Jitsi Meet: installation, Let's Encrypt, firewall rules, secure meetings and monitoring.

  • Linux & Systems
1 min readTürkçe

Steam

Linux'ta Steam ve Counter-Strike 2: GPU ayarları ve başlatma seçenekleri.

  • Linux & Systems

Type to search the whole site.