[SWLUG] Serial ports

Steve Anderson steve at twindx.com
Mon Jul 31 13:38:27 UTC 2006


On 31/07/06, Justin Mitchell <justin at discordia.org.uk> wrote:

> first off, make sure that the cable has been wired so that the CD line
> is asserted, otherwise you will have to fiddle around to avoid it.

I'm not sure that it is. What is the fiddle to avoid, and is it easier
than trying to solder things with a crying baby next to me?

> you can use programs like minicom to talk directly to the serial port
> and tweak all the settings, or you can treat it like a file and read
> directly, in which case you use the stty program to change the settings.
>
> you want: stty 38400 -crtscts -ixoff -parenb < /dev/ttyS0
> you can list the current settings with: stty -a </dev/ttyS0
>
> -crtscts  means 'no hardware flow control'
> -ixoff    means 'no software flow control'
> -parenb   means 'no parity bit'
>
> to read from the serial port then you can just 'cat /dev/ttyS0' to write
> to it you can 'echo "hello" >/dev/ttyS0'

Brilliant. Thanks Justin!

-- 
Irregular Shed - http://www.twindx.com



More information about the Swlug mailing list