Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Realtime and mysql download available.

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

Moderator: daj

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

Re: Realtime and mysql download available.

Post by mcrossley »

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: 29
Joined: Tue 31 Jul 2012 2:08 pm
Weather Station: Davis Vantage Vue
Operating System: Raspbian on Pi B+
Location: United States
Contact:

Re: Realtime and mysql download available.

Post by kc2kzz »

Now that is working for me.
Image
gemini06720
Posts: 1700
Joined: Mon 10 Aug 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 »

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: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Realtime and mysql download available.

Post by mcrossley »

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 10 Aug 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 »

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: 678
Joined: Tue 13 Oct 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 »

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 24 Jun 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 »

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 16 Apr 2015 4:19 pm
Weather Station: WS2307
Operating System: Win7 32bit
Location: Slovenia
Contact:

Re: Realtime and mysql download available.

Post by ant30 »

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: 12694
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Realtime and mysql download available.

Post by mcrossley »

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 16 Apr 2015 4:19 pm
Weather Station: WS2307
Operating System: Win7 32bit
Location: Slovenia
Contact:

Re: Realtime and mysql download available.

Post by ant30 »

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: 860
Joined: Sun 25 Jan 2015 8:41 pm
Weather Station: Davis Vantage Pro 2 plus
Operating System: Raspberry pi 4 (4gb)
Location: Worthing
Contact:

Re: Realtime and mysql download available.

Post by dazza1223 »

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

https://www.davisworthing.co.uk

Image
Post Reply