Fedora Linux Support Community & Resources Center

Sections ›› Home | Forums | Guidelines | Forum Help | Fedora FAQ | Fedora News 

Go Back   FedoraForum.org > Fedora Support > Software

Software Help on software problems.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 2007-12-28, 08:27 AM CST
HogePief Offline
Registered User
 
Join Date: May 2006
Posts: 2
Serial (rs232) communication BASH script, port initialisation problem (solved)

At the moment i'm trying to get a shell script (bash 3.2-18.fc8.i386) to communicate with a microcontroller over uart channel 0, /dev/ttyS0

the commands:

Code:
#echo messageToSend > /dev/ttyS0

#cat /dev/ttyS0
work in sending and recieving data, but only when, in this case, minicom (minicom 2.2-5.fc8.i386) is running.
Browsing the internet in wonder of this phenomenon i ran across an example of setting up a serial port in C .
Code:
options.c_cflag |= (CLOCAL | CREAD);
Now looking at man termios, it seems that reading of the port should be set enabled (CREAD in c_cflag).

Is there a way to do this action in bash script (without writing my own application, that gets called in the script), or could there be a different cause of the appearent lack of communication without minicom?

Last edited by HogePief; 2007-12-28 at 11:57 AM CST. Reason: Adding (solved) to the title
Reply With Quote
  #2  
Old 2007-12-28, 08:45 AM CST
jtang613's Avatar
jtang613 Offline
Registered User
 
Join Date: Apr 2004
Location: Ottawa, Canada
Posts: 1,901
Use stty to set the terminal parameters first.
Code:
man stty
Reply With Quote
  #3  
Old 2007-12-28, 11:55 AM CST
HogePief Offline
Registered User
 
Join Date: May 2006
Posts: 2
Thanks for pointing me in the right direction.

The solution was:
Code:
stty -F /dev/ttyS0 ispeed 38400 ospeed 38400 -echo
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting up serial port for network communication kumudini Networking 0 2008-10-23 03:19 PM CDT
Serial port communication program XStylus Software 1 2008-08-25 09:04 PM CDT
Serial port problem 0l0 Hardware 0 2008-01-22 01:34 PM CST
mgetty serial port problem powah General Support 0 2006-09-25 02:48 PM CDT
Greater than 4 Serial (RS232) port support roellascano Hardware 1 2006-09-16 04:22 AM CDT

Automatic Translations (Powered by Powered by Google):
Afrikaans Albanian Arabic Belarusian Bulgarian Catalan Chinese Croatian Czech Danish Dutch English Estonian Filipino Finnish French Galician German Greek Hebrew Hindi Hungarian Icelandic Indonesian Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Taiwanese Thai Turkish Ukrainian Vietnamese Yiddish

All times are GMT -7. The time now is 10:55 AM CST.

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo



All trademarks, and forum posts in this site are property of their respective owner(s).

FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact | Founding Members
Designed By Ewdison Then | Powered by vBulletin ©2000-2009, Jelsoft Enterprises Ltd.
FedoraForum is Powered by Open Source Projects and Products
Translations delivered by vBET 2.3.8