LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-21-2009, 01:28 PM   #1
maus
LQ Newbie
 
Registered: Jun 2009
Posts: 14

Rep: Reputation: 0
Simulate serial device with pty's


Hi,

I wrote software which access and reads a serial device. I would like to test this software on my computer without loop-wiring or without a second computer.

How could I use pty's to simulate a serial device?

Actually I would like to temporary replace the /dev/ttyS1 file by one end of the pty. How could I do this? Is there a command to create a pty pair?

Thanks for any suggestions.
 
Old 09-22-2009, 09:44 AM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
The pairs are already there. Hope that the below gives you the idea what to do.

Run this first in a terminal; it will simulate your serial port
Code:
minicom -p /dev/ptyp0
Next, in other terminal, let your application connect to it (I use minicon but you can use your application)
Code:
minicom -p /dev/ttyp0
 
Old 09-25-2009, 02:29 AM   #3
maus
LQ Newbie
 
Registered: Jun 2009
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Wim Sturkenboom View Post
The pairs are already there. Hope that the below gives you the idea what to do.

Run this first in a terminal; it will simulate your serial port
Code:
minicom -p /dev/ptyp0
Next, in other terminal, let your application connect to it (I use minicon but you can use your application)
Code:
minicom -p /dev/ttyp0
Thanks Wim,

The pty pair doesn't exist on my computer. Is there a command to create such a pty pair??

In the folder /dev/pts/ there are plenty of pty ports. But the all end up in open terminal session.
 
Old 09-26-2009, 04:51 AM   #4
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
For me it worked long ago under RH7.x (or maybe it was even 6.2). I did check before I posted on my Ubuntu 8.04 box.

I can't find the links any more ( ) but there seem to be two styles. Maybe do a search for pmtx.

Which distro are you using?
 
Old 09-27-2009, 11:10 AM   #5
maus
LQ Newbie
 
Registered: Jun 2009
Posts: 14

Original Poster
Rep: Reputation: 0
Hi,

I'm using Linux Mint Gloriqa (Linux Ubunut 8.0 Derivat).
The two devices /dev/ptyp0 and /dev/ttyp0 don't exist.

There is a application called socat which can create to pseudo terminals.

With this app I'm able to create a pair of ptys.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Serial input device using usb-serial connector slackiz Linux - Hardware 4 01-12-2009 05:04 AM
howto simulate & add fake ALSA device (from wav or mp3..)? frenchn00b Linux - General 0 10-22-2007 04:56 PM
Emulate/simulate an USB (or COM) device Adony Linux - Software 4 04-15-2007 03:51 PM
How to simulate incoming character in serial communication? Stor_G Programming 7 09-01-2004 02:22 AM
device to simulate physical memory with PCI device kevinsung Linux - Software 1 12-14-2002 10:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration