Re: [LHA-misc] Newbie Linux Serial Port Question
Status: Beta
Brought to you by:
ncherry
From: Ben S. <be...@bu...> - 2002-02-02 13:17:38
|
On Sat, 2002-02-02 at 17:00, Lloyd Ferguson wrote: > I want to control an RS-232 device from my Linux box. It uses a very > simple serial protocol and ideally I would like to write to and read from > it in a shell script. > > Can anybody point me to some resources that explain how to access the > serial port from shell scripts. Eventually, I would like to do it in C or Sure. echo "Serial-protocol-commands" >> /dev/ttyS0 (/dev/ttyS0 is usually serial port 0 under linux) Also, check out stty, which should allow you to set the attributes of the serial port. Eg. To see the current setting of serial port 0, stty -F /dev/ttyS0 To set the speed: stty -F /dev/ttyS0 speed 38400 > Perl but that is beyond my ability with those languages right now, any > pointers to resources on this would be appreciated for future reference. > > Also, can anybody recommend a simple terminal emulator to allow me to > communicate with the box directly (something like hyperterm)? I have tried > mgetty and a couple of others but they all seem to want to configure a > Hayes modem, and make connections to other machines, maybe I just need some > help with configuration. minicom > > Thanks in advance. > > Lloyd Ferguson > llo...@us... > Cheers, Ben |