Logging serial port data to file

Cathey, Jim jcathey at ciena.com
Wed Mar 24 17:01:03 UTC 2010


A shell script?

	while :; do
		read LINE
		echo `date`: $LINE
	done <ttydev >logfile

-- Jim



-----Original Message-----
From: busybox-bounces at busybox.net [mailto:busybox-bounces at busybox.net]
On Behalf Of Michael Hagedorn
Sent: Wednesday, March 24, 2010 9:17 AM
To: busybox at busybox.net
Subject: Logging serial port data to file

Hi
I am quite new to the busybox and need some help. I am trying to modify 
an embedded system on a NAS based on a STR8100 series hardware platform.
I have the SDK. Busybox is installed on it and I can build it
successfully.

I want to log data arriving on the serial port (I am using a USB to 
serial device) to a file.
Ideally with time stamps. I have data sets arriving at the serial port 
with line returns.
Ideally I would like to see a each line time stamped and added to a
file.

Is there a way that I can use syslogd for this. I tried

syslogd -s 0 -O /usb/BigDrive/syslog.log
logger -t "SerialPort" "a message"

This works fine.

If I enter
cat /dev/ttyUSB0 | logger -t "SerialPort"
It works to some degree. The message lines are truncated, therefore I am

missing part of the data.


Or is there a much simpler way to archive my goal (essentially a serial 
port data logger).

Regards

_______________________________________________
busybox mailing list
busybox at busybox.net
http://lists.busybox.net/mailman/listinfo/busybox



More information about the busybox mailing list