We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now


Linux Programming - Serial Link

Medium Priority
Last Modified: 2008-03-06

I need to use a serial link between 2 computers for a homework at school (XMODEM protocol implementation); since I'm not in the mood of buying a serial cable, I want to know if it's possible to emulate it, on the same computer (i.e. by using devices /dev/ttyS0 and /dev/ttyS1 to simulate the local and the remote port of the serial link. Anything I write in one I should be able to read from another.). Are there any drivers/programs to do this?

Thanks in advance.
Watch Question

Unlock this solution and get a sample of our free trial.
(No credit card required)

Everything (almost) you want to know about serial programming could be found


oumer, thanks for the link, but it's not a matter of programming the serial port, but emulating a virtual link.

Alf666: I'm looking at this /dev/ttyq? and /dev/ptyq? stuff, it's interesting and might be just what I need, but I'm not yet able to transfer a file via XMODEM. Seems the ptyq? must be opened first... Still looking into this.


Thanks for the answer Alf , I had no idea about this stuff, but it works! Earlier i had troubles because of a badly coded comm program. :)

Yes. The pty is the slave and must be opened first. Then the tty.
It's a bit kludgy to use, but damn useful.

I don't remember though if they can pseudo-handle hardware signaling. It's been too long since I've played with this last :-)
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.