Welcome to the new home of the Cumulus Support forum.

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See the Wiki for download

Realtime and mysql download available.

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderators: daj, TNETWeather

User avatar
mcrossley
Posts: 5209
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Realtime and mysql download available.

Post by mcrossley » Tue Dec 04, 2012 4:16 pm

If anyone is interested I have added the ability to create and log to a "realtime" table to the ImportCumulusFile.php script in the Wiki - http://wiki.sandaysoft.com/a/ImportCumulusFile

kc2kzz
Posts: 26
Joined: Tue Jul 31, 2012 2:08 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 2012 Server
Location: United States
Contact:

Re: Realtime and mysql download available.

Post by kc2kzz » Tue Dec 04, 2012 5:02 pm

Now that is working for me.
Image

gemini06720
Posts: 1700
Joined: Mon Aug 10, 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Realtime and mysql download available.

Post by gemini06720 » Tue Dec 04, 2012 8:49 pm

Mark, I am somewhat disappointed in the latest modifications and release of the 'ImportCumulusFile' script:
  • - syntax error, unexpected '{' in ImportCumulusFile.php on line 195
    - syntax error, unexpected '{' in ImportCumulusFile.php on line 197

Then, once those two two lines have been corrected:
  • - Undefined index: file in ImportCumulusFile.php on line 101
    - Undefined index: table in ImportCumulusFile.php on line 102
    - Undefined index: type in ImportCumulusFile.php on line 103

Some testing code should be added to the script (even if those few lines of code were not part of the original script) - the presence of command line parameters should be tested and, if none are supplied, then either have some predefined default values for the variables or issue an error message regarding the missing parameters...

Expecting a user to read and understand the included documentation should not to be taken for granted...

User avatar
mcrossley
Posts: 5209
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Realtime and mysql download available.

Post by mcrossley » Tue Dec 04, 2012 10:58 pm

Now you know why I don't write a great deal of PHP ;)

Version 1.4a posted, fixes the two syntax errors :oops: (I had the syntax error panel of my editor hidden), and adds parameter presence checking.

gemini06720
Posts: 1700
Joined: Mon Aug 10, 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Realtime and mysql download available.

Post by gemini06720 » Wed Dec 05, 2012 12:50 am

Come on Mark, PHP is way simpler to write (and check the syntax) than JavaScript is and will ever be... :mrgreen:

User avatar
laulau
Posts: 521
Joined: Tue Oct 13, 2009 10:52 pm
Weather Station: WeatherDuino Pro2
Operating System: Win 7
Location: Meyenheim, Alsace, FR
Contact:

Re: Realtime and mysql download available.

Post by laulau » Thu May 23, 2013 5:45 pm

Hello,
I'm trying to create a mysql database with this scripts.
The database creation is ok but i can't fill it with realtime.txt values !

first question:

in real.php i found this part of code:

Code: Select all

 for ( $i = 0;$i < count( $linearray );$i++ ) {
        echo $linearray[$i]."\n";
		if ( strpos( $linearray[$i], "-" ) !== false  ) {
		
            $tmp_date = explode( "-", $linearray[$i] );

            $linearray[$i] = $tmp_date[2] . "-" . $tmp_date[1] . "-" . $tmp_date[0];
            $i = count( $linearray );
			
        }
		
    }
What is this for ?
Second question:
in the begining of the script i found

Code: Select all

$addauto = 1;
what does it do ?

here's my realtime.txt

Code: Select all

23/05/13 19:41:12 9.9 47 -0.9 7.2 5.8 259 0.0 0.0 1010.0 O 2 km/h C mb mm 140.9 +0.3 40.0 195.0 7.0 17.9 53 9.1 +0.3 13.9 11:45 8.0 06:15 25.6 14:33 36.7 14:32 1016.0 00:00 1007.0 13:12 1.9.4 1065 12.2 9.9 9.9 0 0.00 0 244 0.0 6 1 0 OSO 1346 m 6.4 0.0 116 0 
my date separator is / in in wind unit (km/h) there is also a / ; can this affect the script ?
Thank's
Laurent

Image

tobyspond
Posts: 252
Joined: Fri Jun 24, 2011 5:57 pm
Weather Station: Davis Vantage Pro2
Operating System: Windows 10
Location: Lamoine, Maine, USA

Re: Realtime and mysql download available.

Post by tobyspond » Thu May 23, 2013 6:19 pm

Hi Laurent,

I'm not sure if this is your problem, but in order to populate a table in your database you need to call the script. I use a cron job to accomplish that.

Kerry

ant30
Posts: 18
Joined: Thu Apr 16, 2015 4:19 pm
Weather Station: WS2307
Operating System: Win7 32bit
Location: Slovenia
Contact:

Re: Realtime and mysql download available.

Post by ant30 » Thu Apr 16, 2015 7:49 pm

Hello,
Im new here and i need a little help.
Im hosting my website on serversfree.com and i have one problem to solve with Cron Job.

Path to Cron Job command to run : php -f /home/u464811711/public_html/real.php

I have created mysql table with this script on this topic and its all ok.
Mysql table "realtime" is created and "realtime.txt" is ok.
http://ravne.bugs3.com/realtime.txt
Everything is working good if i run "real.php" with my browser and data are writen in table realtime. But nothing heppening with cron job.

Thanks for help.
Image

User avatar
mcrossley
Posts: 5209
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Realtime and mysql download available.

Post by mcrossley » Fri Apr 17, 2015 10:42 am

Is the path to the realtime file correct when running it as a cron job, it may be different from running from the web server. I'd use a full path from root.

ant30
Posts: 18
Joined: Thu Apr 16, 2015 4:19 pm
Weather Station: WS2307
Operating System: Win7 32bit
Location: Slovenia
Contact:

Re: Realtime and mysql download available.

Post by ant30 » Fri Apr 17, 2015 4:07 pm

thanx mcrossley

Path is always important :oops:
My path to the command for cron job "real.php" was wrong :groan:

...and now Im on the right path :clap:
It works :idea:
Image

User avatar
dazza1223
Posts: 414
Joined: Sun Jan 25, 2015 8:41 pm
Weather Station: Davis Vantage Vue
Operating System: raspberry pi 3 +
Location: worthing
Contact:

Re: Realtime and mysql download available.

Post by dazza1223 » Thu Mar 29, 2018 12:32 pm

hey guys um is set all this up but it come to the pont where i got to include the database.php but nothing shows up ?
have fun and keep learning

dazza :D

Post Reply