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?