From owner-freebsd-hackers Sat Nov 1 07:46:41 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id HAA24247 for hackers-outgoing; Sat, 1 Nov 1997 07:46:41 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from tolstoy.mpd.ca (mpd.ca [206.123.11.35]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id HAA24227 for ; Sat, 1 Nov 1997 07:46:09 -0800 (PST) (envelope-from wlloyd@mpd.ca) Received: from plato (plato.mpd.ca [206.123.11.34]) by tolstoy.mpd.ca (8.8.5/8.8.5) with SMTP id KAA17726; Sat, 1 Nov 1997 10:44:06 -0500 (EST) Message-ID: <345B4E6D.6224@mpd.ca> Date: Sat, 01 Nov 1997 10:44:45 -0500 From: Bill Lloyd X-Mailer: Mozilla 3.0Gold (X11; I; SunOS 5.4 sun4c) MIME-Version: 1.0 To: "User Rdkeys Robert D. Keys" CC: freebsd-hackers@FreeBSD.ORG Subject: Re: Looking for ways to do serial datalogging on FreeBSD References: <199710311914.OAA07431@seedlab1.cropsci.ncsu.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk User Rdkeys Robert D. Keys wrote: > > If I wanted to use a serial port as a datalogging input port on FreeBSD, > from, for example a small outboard box emitting lines of data at 300 baud > continuously, what might be good ways to do that? > > Ideally, I would like to have a script or a small program running that > would poll the system clock, poll the port for a line of data at hourly > intervals, write that line to a logfile, then sit until the next hour, You should investigate It allows logging of serial ports (as many as you want). The package is for remote tty. Here is a snip from the README --------- Rtty is "remote tty" (not radioteletype). You run a server per port and then connect to that server from any number of "tip"/"cu"-like clients. I wrote it for our console concentrator, but there's no reason other than performance why you couldn't use it to drive modems, printers, prom programmers, and so on. ... Details The server can be told to keep a log file. This log file will record all data in or out of the tty port; that is, data that comes from the tty port will be logged, and data that is typed at (and therefore sent to) the tty port from any client will be logged. There are no special markers in the log file to tell you which data came from which source; the data is all just interleaved in the order it was received by the server. Note that line terminators in the log file will be "physical" meaning probably \r\n rather than the normal UNIX \n. It depends on the device on the other end of the tty port, but \r\n is pretty common. We watch our log files with daemons that do roughly what "tail -f" does except they scan for things like "file table full" or "out of inodes" or "panic" -- you know, things that computers say when they are unhappy. None of our scanning software is included in this release of rtty, but you can write your own. Note that the protocol used between the server and client is mostly implemented in a separate module of this source directory; if you want to connect to the server in real time and scan the output direcly instead of tailing the log file, that's an option. (You would most especially want to do it this way if you aren't using any log files.) ------- -bill -- William Lloyd (wlloyd@mpd.ca) |