Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like to know if exists some utility that connects to serial port and redirect input and output to a tcp port. I need this for a Java application, I need to write and read to a serial port but seems very hard... java will better work with socket connection.

MIND: I found a lot of "virtual com to tcp" but I have a real com! And I want to connect to its.


share|improve this question

1 Answer 1

up vote 6 down vote accepted

It's pretty easy. Under Linux there are serial devices, redirection and netcat for that. On the server you can run a netcat process listening on a given tcp port with stdin and stdout redirected to/from the serial device like that:

nc -l 9801 > /dev/ttyS0 < /dev/ttyS0

Where 9801 in this example is the tcp port to listen on. You can setup the serial port with setserial(8).

These device files also exist on cygwin (Windows).

share|improve this answer
Is there a solution also for windows? Usign java I would like to run my app as multiplatform. –  Tobia Jul 2 '13 at 12:18
see my updated answer –  artistoex Jul 2 '13 at 14:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.