LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 06-09-2004, 12:38 AM   #1
funkymunky
Member
 
Registered: Jun 2003
Location: Austin, Texas
Distribution: Fedora Core 8, 32-bit
Posts: 126

Rep: Reputation: 15
Unhappy shell script: sending data through the serial port


hi

were trying to send data through a serial port to a device to automatically run the device`s diagnostic program.
if we use minicom to do this, it runs fine..we are able to run the diagnostic program correctly thorugh minicom.

but when we try to send the commands directly to the device through the serial port, the diagnostic program falls into a loop.for eg, if we do this:
#echo mem > /dev/ttyS0
(where mem is one of the commands of the device`s diagnostic program)
the output of the diagnostic command gets scrolling on the screen..ie, we get the correct output, but it starts scrolling over and over again on the screen.

but none of this happens if we send the mem command (or any other command) using minicom.

we are using a computer running on redhat linux 8.0 to send data to the device thru the serial port.

whats going on??

kindly help
thanx in anticipation
 
Old 06-09-2004, 01:46 AM   #2
fluppi
Member
 
Registered: Oct 2003
Location: Switzerland (Europe)
Distribution: OpenSuSE, RedHat, Knoppix, IRIX + MacOSX
Posts: 198

Rep: Reputation: 30
It can be something simple like
#echo "mem" > /dev/ttyS0

Have you checked the settings for the port (minicom make this by itself) ?

Maybe you need to define the direction the output of ttyS0 ?
 
Old 06-09-2004, 11:47 PM   #3
funkymunky
Member
 
Registered: Jun 2003
Location: Austin, Texas
Distribution: Fedora Core 8, 32-bit
Posts: 126

Original Poster
Rep: Reputation: 15
Quote:
>Have you checked the settings for the port (minicom make this by itself) ?

Thanx for your suggestion- we checked the port settings when minicom was running using
#stty -F /dev/ttyS0
then we explicitly set the same settings for the port when minicom wasnt running, and it worked!
thanx a lot, fluppi!
 
  


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
is there any shell command to read and write data from parallel and serial port? baosheng Linux - Hardware 2 01-13-2007 08:35 PM
serial port (ttyS1) - Sending commands via terminal... HELP!!! Nalorin Linux - Networking 2 08-21-2005 10:22 PM
accessing data from serial port PrerakParikh Linux - Hardware 2 08-24-2004 10:17 PM
Serial Port read in shell script tjt Linux - Newbie 1 08-12-2004 09:18 AM
Why can't I read in data from the serial port using a bash script? tjt Linux - Newbie 1 06-17-2004 12:21 AM


All times are GMT -5. The time now is 09:48 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration