LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 02-21-2015, 09:15 AM   #1
Alberto78
LQ Newbie
 
Registered: Feb 2015
Posts: 2

Rep: Reputation: Disabled
Console login through serial port


Hi guys,

I'm currently working with a dedicated CentOS machine commanded/connected through the serial port to another Linux machine.

My scope is to develop a script in order to run sequentially some commands but I found some problem
Basically, to grab the data from the serial port, I developed a bash script that is, more or less (now I don't have the source code), like this:
Code:
#!/bin/sh
stty -f /dev/ttyS0 9600

while read ligne
do
	echo $ligne
done < /dev/ttyS0
With this script I'm able to see everything except the grub menu items and the prompt!

I already know that, to enable the prompt and the grub menu, I have to setup the "init" (I found many resources on google that explain how to do that) and also the grub conf.
But the curious thing is that when I execute the command "cat /dev/ttyS0" everything is displayed!
Where is the trick?

I supposed that the bash script was not properly the right way to read and buffering the serial port and I also tried to develop a perl script....but I got the same result!
I was able to see the boot process but no the grub menu and the prompt command!

Help me guys!
Thank you!

P.S.
Moreover I have a proprietary Linux binary service tool that read and send data through the serial port to the CentOS machine. It works properly and I can see/send every data.

To run the tool I have to lunch like command:
Code:
./serialConnect -dev /dev/ttyS0
That's why I think that the CentOS serial configuration is properly done! The problem is elsewhere on the local machine!

Thank you
 
Old 02-22-2015, 05:38 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,768

Rep: Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933Reputation: 5933
Your right that bash in most cases is not the proper way to read serial data. I suspect that there are some terminal codes that are being sent that are being decoded by the tool. I would try capturing the boot process and exmamine it with a hex editor tool.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use one serial port for kgdb and console sha_neb Linux - Kernel 0 04-06-2011 04:39 PM
Help: tty console to serial port Rostfrei Linux - General 1 11-03-2010 04:05 AM
linux serial port to router console port connection? frankie_fix Linux - General 3 02-26-2007 09:32 PM
console login through RS232/serial port ? Yalla-One Linux - Software 3 02-24-2005 04:12 PM
Console will default to serial port 1, and now? bako Linux - General 5 02-18-2002 06:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 02:32 PM.

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