Linux, the stamp and the serial port
Archiver
Posts: 46,084
I have set up my basic stamp to monitor the input from serin ascii
text and based on the input, certain pins go high.
I am using linux as the machine communicating with the stamp. When I
use minicom and type the letter w the device works fine. However when
I try a command like
echo w >> /dev/ttyS0
it does not work.
I want to do this so that i do not have to go into another program
just to get the light to go on. If i can get the above line to work,
then script files will be a cinch.
Anyone have any ideas or leads. I tinkered with the stty util but i
was unsuccessful.
thanks
text and based on the input, certain pins go high.
I am using linux as the machine communicating with the stamp. When I
use minicom and type the letter w the device works fine. However when
I try a command like
echo w >> /dev/ttyS0
it does not work.
I want to do this so that i do not have to go into another program
just to get the light to go on. If i can get the above line to work,
then script files will be a cinch.
Anyone have any ideas or leads. I tinkered with the stty util but i
was unsuccessful.
thanks
Comments
You must configure the /dev/ttyS0 port characteristic (baud rate,
handshaking, parity bit, ...) before you can use the serial port and
send the first byte. This is what minicom do before sending the bytes to
serial port.
You also need write permission on /dev/ttyS0
Note that "echo" also add a LF (line feed) at end of line
Maybe you need a customized "echo" program or a small script file?
Bye
nestlerv wrote:
>
> I have set up my basic stamp to monitor the input from serin ascii
> text and based on the input, certain pins go high.
>
> I am using linux as the machine communicating with the stamp. When I
> use minicom and type the letter w the device works fine. However when
> I try a command like
>
> echo w >> /dev/ttyS0
>
> it does not work.
>
> I want to do this so that i do not have to go into another program
> just to get the light to go on. If i can get the above line to work,
> then script files will be a cinch.
>
> Anyone have any ideas or leads. I tinkered with the stty util but i
> was unsuccessful.
>
> thanks
>
--
Arnaldo Braun
Consultoria em inform
and it did not work. I am not sure how to set it to no handshake or
no flow control.
The line feed is not a problem. I can reprogram the stamp to expect
the line feed right.
Any ideas?
--- In basicstamps@yahoogroups.com, Arnaldo Braun <abraun@t...> wrote:
> Hi
>
> You must configure the /dev/ttyS0 port characteristic (baud rate,
> handshaking, parity bit, ...) before you can use the serial port and
> send the first byte. This is what minicom do before sending the
bytes to
> serial port.
> You also need write permission on /dev/ttyS0
>
> Note that "echo" also add a LF (line feed) at end of line
>
> Maybe you need a customized "echo" program or a small script file?
>
> Bye
>
> nestlerv wrote:
> >
> > I have set up my basic stamp to monitor the input from serin ascii
> > text and based on the input, certain pins go high.
> >
> > I am using linux as the machine communicating with the stamp.
When I
> > use minicom and type the letter w the device works fine. However
when
> > I try a command like
> >
> > echo w >> /dev/ttyS0
> >
> > it does not work.
> >
> > I want to do this so that i do not have to go into another program
> > just to get the light to go on. If i can get the above line to
work,
> > then script files will be a cinch.
> >
> > Anyone have any ideas or leads. I tinkered with the stty util but
i
> > was unsuccessful.
> >
> > thanks
> >
>
> --
>
> Arnaldo Braun
> Consultoria em inform
For more information look at
<http://www.easysw.com/~mike/serial/serial.html>
and
<ftp://sunsite.unc.edu:/pub/Linux/docs/HOWTO/Serial-Programming-HOWTO>
If you know Delphi or Kylix (Pascal language) look
<http://www.ararat.cz/synapse/> and download
<http://www.ararat.cz/synapse/files/synaser.zip> it is a free syncronous
serial library to make customized programs.
Bye
nestlerv wrote:
>
> Ok, but how would i do that, How can i set that? I tried with stty
> and it did not work. I am not sure how to set it to no handshake or
> no flow control.
>
> The line feed is not a problem. I can reprogram the stamp to expect
> the line feed right.
>
> Any ideas?
>
Arnaldo Braun
Consultoria em Inform
--- In basicstamps@yahoogroups.com, Arnaldo Braun <abraun@t...> wrote:
> Hi
>
> For more information look at
> <http://www.easysw.com/~mike/serial/serial.html>
> and
> <ftp://sunsite.unc.edu:/pub/Linux/docs/HOWTO/Serial-Programming-
HOWTO>
>
> If you know Delphi or Kylix (Pascal language) look
> <http://www.ararat.cz/synapse/> and download
> <http://www.ararat.cz/synapse/files/synaser.zip> it is a free
syncronous
> serial library to make customized programs.
>
>
> Bye
>
> nestlerv wrote:
> >
> > Ok, but how would i do that, How can i set that? I tried with stty
> > and it did not work. I am not sure how to set it to no handshake
or
> > no flow control.
> >
> > The line feed is not a problem. I can reprogram the stamp to
expect
> > the line feed right.
> >
> > Any ideas?
> >
>
>
> Arnaldo Braun
> Consultoria em Inform
stty -F /dev/ttyS0 9600 raw -echo -hupcl
Regards
Adrian