From owner-freebsd-hackers Fri Oct 31 20:40:30 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id UAA29629 for hackers-outgoing; Fri, 31 Oct 1997 20:40:30 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from word.smith.net.au (word.smith.net.au [202.0.75.3]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id UAA29612 for ; Fri, 31 Oct 1997 20:40:17 -0800 (PST) (envelope-from mike@word.smith.net.au) Received: from word.smith.net.au (localhost.smith.net.au [127.0.0.1]) by word.smith.net.au (8.8.7/8.8.5) with ESMTP id PAA00937; Sat, 1 Nov 1997 15:06:02 +1030 (CST) Message-Id: <199711010436.PAA00937@word.smith.net.au> X-Mailer: exmh version 2.0zeta 7/24/97 To: "User Rdkeys Robert D. Keys" cc: freebsd-hackers@freebsd.org Subject: Re: Looking for ways to do serial datalogging on FreeBSD In-reply-to: Your message of "Fri, 31 Oct 1997 14:14:12 CDT." <199710311914.OAA07431@seedlab1.cropsci.ncsu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 01 Nov 1997 15:06:01 +1030 From: Mike Smith Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > 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? What format is the data in? > 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, > and repeat, over the course of several weeks or months. You would use a cron job for this; it takes care of the scheduling for you. Then, assuming you've configured the port appropriately in /etc/rc.serial, something like this: #!/bin/sh # # Read a line of data from the logger, write (stamped) to the logfile # read line /wherever/logfile as the script called by cron would be all that you required. > In another direction, could one of the generic data acquisition boards > be used to do this, instead. I have heard that that is not always > easy to do on a unix box. I think this would be pretty gross overkill, unless you were aiming to replace the stripchart recorder. Talking to low-speed AD hardware is easy stuff. > Any pointers, resource-persons, etc., are appreciated. I am sure lots > of folks have done this type of thing before, right? Yup. 8) mike