LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Data from RS232 connection to MySQL (https://www.linuxquestions.org/questions/linux-newbie-8/data-from-rs232-connection-to-mysql-727382/)

ml41782 05-20-2009 04:37 PM

Data from RS232 connection to MySQL
 
I wondering if some one has run across this before and what they did to fix it. I have a data stream in a CSV format that streams over a serial port connection. Right now I'm using minicom and capturing the data and runnig at tail to pull the newest entries from the file. at midnight I clear the file and restart the process.

I pull the data right now into a web page for monitoring. I would like to take this stream and dump it into Mysql and then run some nicer reports with a static page running PHP as I'm doing with some other devices that I monitor.


ANy thoughts ?

Mike

TB0ne 05-21-2009 09:38 AM

Quote:

Originally Posted by ml41782 (Post 3547440)
I wondering if some one has run across this before and what they did to fix it. I have a data stream in a CSV format that streams over a serial port connection. Right now I'm using minicom and capturing the data and runnig at tail to pull the newest entries from the file. at midnight I clear the file and restart the process.

I pull the data right now into a web page for monitoring. I would like to take this stream and dump it into Mysql and then run some nicer reports with a static page running PHP as I'm doing with some other devices that I monitor.

Well, aside from migrating the hardware to something network driven, and using socket programming, have you considered a FIFO (named) pipe? These pages:

http://linux.about.com/library/cmd/blcmdl4_fifo.htm
http://www.linuxjournal.com/article/2156

Will give you a good starting point. I've used it before to feed a MySQL database from a syslog server. But use caution...the pipe can sometimes get hung up or go zombie on you, and your data feed will stop. Write your code carefully...:)


All times are GMT -5. The time now is 08:52 AM.