[Tutor] newbie: Serial I/O question

Michael P. Reilly arcege@shore.net
Tue, 12 Dec 2000 16:53:21 -0500 (EST)


> Hello All,  I'd like to monitor my serial I/O port.  My platform is Linux.  
> I've seen a serial module for windows is there any for Linux??  Or is this 
> not something I should be doing with Python?

What kind of "monitoring" do you want to do?  Detecting when the serial
port is in use?  Read the data coming through the port?

If you want to handle the port itself, the simplest means is to open
the device file (e.g. /dev/ttyS0), set the terminal settings (with the
termios/TERMIOS modules) and read/write the data.  You can also use
Expect, or Python Expect module/extensions; this will allow you to
program intelligent "chat" sessions for talking to such devices.

If you just want to see when the device is in use, then you need to
look at the lock files for your flavor of Linux (often in
/var/locks/).

Good luck.

  -Arcege

-- 
------------------------------------------------------------------------
| Michael P. Reilly, Release Manager  | Email: arcege@shore.net        |
| Salem, Mass. USA  01970             |                                |
------------------------------------------------------------------------