Page 1 of 1

realtime to msql databae

Posted: Thu 15 Sep 2011 4:49 pm
by inaciovieira
Hi, Cam someone tell how to import te realtime file to a mysql data base. I have teste with te importcumulus log, but i dosen t work

Re: realtime to msql databae

Posted: Fri 16 Sep 2011 11:54 am
by daj
inaciovieira wrote:Hi, Cam someone tell how to import te realtime file to a mysql data base. I have teste with te importcumulus log, but i dosen t work
Not entirely sure what you tried -- but I am guessing you mean the ImportCumulusFile ? This is only written to import the dayfile or monthly log file but it can be adapted to import other file formats if you have some php skill.

How do you plan to do the import? Cumulus produces a small realtime.txt file and overwrites it each time. So if you are running a relatime update of 15 seconds you need to grab that file within that 15 second window and import it.

Re: realtime to msql databae

Posted: Fri 16 Sep 2011 12:33 pm
by inaciovieira
yes i tried with the ImportCumulusFile, i edited some files but don´t work. I have rested. i have realtime.txt updates every 30 secunds.
i tried tu include the realtime to update on the importcumulusfile but i don´t import, i´m traing to edit this file but em a refrehs the page doesent import

Code: Select all

if ($type == "monthly log")
	{
		$CreateQuery="CREATE TABLE " . $table_name . " (LogDate date NOT NULL ,HighWindGust decimal(4,1) NOT NULL ,HWindGBear varchar(4) NOT NULL ,THWindG varchar(5) NOT NULL ,MinTemp decimal(5,1) NOT NULL ,TMinTemp varchar(5) NOT NULL ,MaxTemp decimal(5,1) NOT NULL ,TMaxTemp varchar(5) NOT NULL ,MinPress decimal(6,2) NOT NULL ,TMinPress varchar(5) NOT NULL ,MaxPress decimal(6,2) NOT NULL ,TMaxPress varchar(5) NOT NULL ,MaxRainRate decimal(4,1) NOT NULL ,TMaxRR varchar(5) NOT NULL ,TotRainFall decimal(6,2) NOT NULL ,AvgTemp decimal(4,2) NOT NULL ,TotWindRun decimal(5,1) NOT NULL,HighAvgWSpeed decimal(3,1),THAvgWSpeed varchar( 5 ), PRIMARY KEY(LogDate) ) COMMENT = \"Dayfile from Cumulus\"";	
		$WindBearField=2;
		$StartOfReplaceSQL="REPLACE INTO " . $table_name . " (LogDate,HighWindGust,HWindGBear,THWindG,MinTemp,TMinTemp,MaxTemp,TMaxTemp,MinPress,TMinPress,MaxPress,TMaxPress,MaxRainRate,TMaxRR,TotRainFall,AvgTemp,TotWindRun,HighAvgWSpeed,THAvgWSpeed)";
		$EndFieldCount=18;
	}