LinuxQuestions.org
Visit Jeremy's Blog.
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, 11: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, 11:50 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,336

Rep: Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897
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, 12:19 PM   #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, 12:38 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,336

Rep: Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897Reputation: 3897
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, 01: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, 04:32 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 15,691

Rep: Reputation: 2264Reputation: 2264Reputation: 2264Reputation: 2264Reputation: 2264Reputation: 2264Reputation: 2264Reputation: 2264Reputation: 2264Reputation: 2264Reputation: 2264
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 04:33 PM.
 
  


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
minicom for serial communication in C under Linux cadd Linux - Software 45 03-20-2012 03:32 PM
USB to serial convertor + minicom Misbah Naveed Linux - Newbie 1 06-19-2008 02:18 AM
LXer: minicom: A Linux Serial Communication Program LXer Syndicated Linux News 0 02-13-2008 12:41 AM
no serial data appear at minicom on FC3 powah Linux - Networking 1 04-20-2006 02:19 PM
Serial communication - minicom sg3 Linux - Networking 0 07-17-2003 01:00 AM


All times are GMT -5. The time now is 08:50 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration