[olug] capturing data from serial port
Ryan O'Rourke
ryano at ch-gifts.com
Thu Oct 9 16:11:53 UTC 2003
> On Thu, 2003-10-09 at 10:16, Ryan O'Rourke wrote:
> > I'm trying to capture some phone data from a serial port and write it in
> > a delimited format to a file to later be inserted into a MySQL database.
> > How would I go about capturing that data?
On Thu, 2003-10-09 at 10:50, Nick Walter wrote:
[snip...]
> I'd recommend writing something simple to open the serial
> port and read the data, parse/delimit it, and write it out to file. I
> personally would do it in C, but that's what I'm good with. I'm sure
> other people could tell you how to do it in perl or python or java.
> Heck, if the parsing is simple you can just "cat /dev/ttyS?" and take
> care of the parsing in a shell script.
I did come across a Perl script that seems to do what I want for the
time being after a couple variable modifications:
http://www.aplawrence.com/Unix/logger.html
We tried the 'cat /dev/ttyS?' route on a SCO box, but it would time out
every so often. Besides, we're ditching all SCO since The Debacle and
want a more graceful solution on Linux.
> P.S. Is this an SMDI stream of data? This sounds exactly like a
> project I did a few years back.
Well, I don't know much about telephony, but I do know it is an SMDI
stream simply because that's what is labeled on the cable :-)
Thank you for your suggestions and pointing me in the right direction!
-- Ryan
More information about the OLUG
mailing list