LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-16-2010, 10:37 AM   #1
butor20022
LQ Newbie
 
Registered: Nov 2010
Posts: 5

Rep: Reputation: 0
Serial Communication (minicom ?)


I need to send the following command to a device via the com port:

<esc>&PR1<CR>


How can I do that using the echo > /dev/ttys0 or minicom ?

In particular, I dont know how to translate the "escape" and "carriage return" keys
 
Old 11-16-2010, 10:50 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by butor20022 View Post
I need to send the following command to a device via the com port:

<esc>&PR1<CR>

How can I do that using the echo > /dev/ttys0 or minicom ?

In particular, I dont know how to translate the "escape" and "carriage return" keys
You can use minicom, but if you only have to send one string and be done, the echo is better.

Look up the control codes and escape characters on the net, there are many examples. In your case, try:
Code:
echo "\\%PR1\r" > /dev/ttys0
 
Old 11-16-2010, 11:19 AM   #3
butor20022
LQ Newbie
 
Registered: Nov 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TB0ne View Post
You can use minicom, but if you only have to send one string and be done, the echo is better.

Look up the control codes and escape characters on the net, there are many examples. In your case, try:
Code:
echo "\\%PR1\r" > /dev/ttys0
Thanks for the help.
That didnt work. Well I didnt get an error message but the device didnt respond (I did it with hyperterminal in a windows machine so im sure about the cable/device)

Maybe it has to do with the configuration of my ttyS0 (com port)
I need the following settings:

1-Baud = 6900
2-Data = Eight bit
3-Parity = None
4-Stop = One bit
5-Handshake = None
6-Configuration = Non-multidrop

What would be the correct stty syntax to set this ?
 
Old 11-16-2010, 11:38 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by butor20022 View Post
Thanks for the help.
That didnt work. Well I didnt get an error message but the device didnt respond (I did it with hyperterminal in a windows machine so im sure about the cable/device)

Maybe it has to do with the configuration of my ttyS0 (com port)
I need the following settings:

1-Baud = 6900
2-Data = Eight bit
3-Parity = None
4-Stop = One bit
5-Handshake = None
6-Configuration = Non-multidrop

What would be the correct stty syntax to set this ?
6900???

Check out the "setserial" command...type in "man setserial"
 
Old 11-16-2010, 12:33 PM   #5
butor20022
LQ Newbie
 
Registered: Nov 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TB0ne View Post
6900???

Check out the "setserial" command...type in "man setserial"
9600...
 
Old 11-16-2010, 03:32 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,980

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
Wonder if the old way to send keys might help. It was like alt key plus numbers to send an escape key.

Last edited by jefro; 11-16-2010 at 03:33 PM.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
minicom for serial communication in C under Linux cadd Linux - Software 45 03-20-2012 02:32 PM
USB to serial convertor + minicom Misbah Naveed Linux - Newbie 1 06-19-2008 01:18 AM
LXer: minicom: A Linux Serial Communication Program LXer Syndicated Linux News 0 02-12-2008 11:41 PM
no serial data appear at minicom on FC3 powah Linux - Networking 1 04-20-2006 01:19 PM
Serial communication - minicom sg3 Linux - Networking 0 07-17-2003 12:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:38 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