[Tutor] newbie: Serial I/O question
Scott C
scott@zenplex.com
Tue, 12 Dec 2000 17:20:04 -0500
On Tuesday 12 December 2000 16:53, Michael P. Reilly wrote:
> > 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
I guess I was not very detailed was I. I have a device that measures
conductivity of a liquid used for printing presses. This info is very vital
to print quilty and needs to be monitored on a daily basis. What I've been
doing is looking at devices that hook up to a pc serial port. Once hooked up
I'd like to gather my needed info and dump it too a web page if at all
possible. Anyway thats a quick and dirty explanation.
Thanks for the info, this may be over my head but I'm looking forward to a
challenge.
Thanks Scott