Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Write an article for LinuxForums Today! Win Great Prizes!
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > GNU Linux Zone > Peripherals / Hardware > Need software loopback on com port.

Forgot Password?
 Peripherals / Hardware   Is your hardware supported? Having trouble getting some hardware working? Post here!

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds
Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 09-07-2005   #1 (permalink)
Linux Newbie
 
RustamB's Avatar
 
Join Date: Aug 2005
Location: Baku, Azerbaijan
Posts: 214
Send a message via ICQ to RustamB
Need software loopback on com port.

The question is: how can I make the data written to the COM port to be available back for read immediately? In other words I need software loopback on com port.

Some briefing: I wrote an application that reads data sent by some industrial machine, parses it, and writes results somewhere. The problem is that it's not so easy to go to the customer place and get connected to that device in order to make application tests. So I need to simulate data being written to the port. That's why I bought a 9-pin COM socket, and connected the appropriate pins to each other to get COM port loopback device. Then I send data to the port
Code:
echo "data from deviceX" > /dev/ttyS0
and that line can be read by application. Everything works fine, but... I want to achieve the same functionality without that loopback device, cause first: my com port is always in use, but I need it for other purposes and second: I'm afraid to burn up my only com port on laptop with such experiments one day. Is this can be done with pipes and device files, if yes then how?
RustamB is offline  



Reply With Quote
Old 09-07-2005   #2 (permalink)
Just Joined!
 
Join Date: Sep 2005
Posts: 5
mkfifo

You may look into the mkfifo command with which you can create named pipes as follows:
Code:
mkfifo dummy_ttyS0
Then you can with some program write data to it like:
Code:
echo "data from deviceX" > dummy_ttyS0
And read it (simultaneously) with an other program, e.g.:
Code:
cat dummy_ttyS0
nilep is offline   Reply With Quote
Old 09-07-2005   #3 (permalink)
Linux Newbie
 
RustamB's Avatar
 
Join Date: Aug 2005
Location: Baku, Azerbaijan
Posts: 214
Send a message via ICQ to RustamB
Great, thanks!
RustamB is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
A Newbie's Getting Started Guide to Linux
Learn the basics of the Linux operating systems. Get to know what it is all about, and familiarize yourself with the practical side. Basically, if you're a complete Linux newbie and looking for a quick and easy guide to get you started this is it.
subscribe
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 01:18 PM.






© 2000 - - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.1