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 4017) - 17 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

mspec
Posts: 56
Joined: Sun 15 Jan 2012 11:21 pm
Weather Station: Davis vantage pro 2 cabled.
Operating System: Windows 10
Location: Christchurch

Realtime and mysql download available.

Post by mspec »

Sorry this has taken me so long to put up but things have been a tad busy. Please find the download attachment for inserting realtime.txt data into mysql.

There are 3 php files in the attachment.

sqlsetup.php - This file creates the required table in mysql.
real.php - This file when run or called via cron inserts the current data in realtime.txt into the mysql database
database.php - This file is optional, I use this file for pulling data out of mysql for use in graphs ect.


**Note all 3 files need to be opened and some fields edited to your server details such as mysql username and password.

To use create a database in mysql called weather then run the file sqlsetup.php this will create the table for you.

Now you can run or call the file real.php whenever you want to insert the current realtime.txt data into the database. I use cron and it is set to run it every 5 minutes.

Now you can use the file database.php and include it in whatever script you want to pull data from the database for use in graphs etc.


I will answer questions as best as I can when I have time. I hope some of you find this usefull.
You do not have the required permissions to view the files attached to this post.
pacificblue03
Posts: 397
Joined: Sun 13 Jun 2010 12:35 am
Weather Station: Davis vantage vue
Operating System: windows 11
Location: Sydney Australia
Contact:

Re: Realtime and mysql download available.

Post by pacificblue03 »

Hello i had a question, on my website i have http://www.ballinanswweather.com/wugraphs.php these special graphs running off of weatherunderground from my stations data, how will i make my realtime.txt file upload into graphs like this on my normal http://www.ballinanswweather.com website under the graphs dropdown?

I would really really like to make this happen as these are very good graphs, called highcharts http://www.highcharts.com/

Thanks
Antonio

Visit my website - http://www.ncstormchasers.com/
User avatar
ergie
Posts: 44
Joined: Thu 19 Apr 2012 9:24 pm
Weather Station: WH1090
Operating System: Praspberry Pi2
Location: Oslo, Norway
Contact:

Re: Realtime and mysql download available.

Post by ergie »

Thanks for great job!
Everything working for me. Now I need somehow to pull database.php data to website. Maybe someone know easiest way to show database.php data on php webpage?
Thanks,
Rim
inaciovieira
Posts: 54
Joined: Sun 01 May 2011 7:13 pm
Weather Station: Watson
Operating System: Windows 7
Location: Funchal

Re: Realtime and mysql download available.

Post by inaciovieira »

hi,

I'm trying to use your script but its no adding the realtime values into mysql table. wen i run the file rea.php it doesn't do nothing.
User avatar
ergie
Posts: 44
Joined: Thu 19 Apr 2012 9:24 pm
Weather Station: WH1090
Operating System: Praspberry Pi2
Location: Oslo, Norway
Contact:

Re: Realtime and mysql download available.

Post by ergie »

I created manually database with name ‘weather’ through my phpadmin then enter all data which asking ( mysql username, mysql password and database name) in all these three php files. Do not forget path to you realtime.txt in real.php file. Example: /var/www/yourwebsite.com/web/realtime.txt". Then I uploaded all three php files on my web server. First I run sqlsetup.php and got answer that database created. Then run real.php (www.yourwebsite.com/real.php).
Then I setup cron on my web server to check website link with real.php every five minutes. And now I got loads info here which updates every 5min. but sadly I don’t know how to pull it form mysql. I would like to do form mysql to graphs.
Sorry for my not very good English.
Thanks,
Rim
inaciovieira
Posts: 54
Joined: Sun 01 May 2011 7:13 pm
Weather Station: Watson
Operating System: Windows 7
Location: Funchal

Re: Realtime and mysql download available.

Post by inaciovieira »

ergie wrote:I created manually database with name ‘weather’ through my phpadmin then enter all data which asking ( mysql username, mysql password and database name) in all these three php files. Do not forget path to you realtime.txt in real.php file. Example: /var/www/yourwebsite.com/web/realtime.txt". Then I uploaded all three php files on my web server. First I run sqlsetup.php and got answer that database created. Then run real.php (http://www.yourwebsite.com/real.php).
Then I setup cron on my web server to check website link with real.php every five minutes. And now I got loads info here which updates every 5min. but sadly I don’t know how to pull it form mysql. I would like to do form mysql to graphs.
Sorry for my not very good English.
Thanks,
Rim
To pull it from mysql i think you must include the database.php on the web file you whant to use.
mspec
Posts: 56
Joined: Sun 15 Jan 2012 11:21 pm
Weather Station: Davis vantage pro 2 cabled.
Operating System: Windows 10
Location: Christchurch

Re: Realtime and mysql download available.

Post by mspec »

pacificblue03 wrote:Hello i had a question, on my website i have http://www.ballinanswweather.com/wugraphs.php these special graphs running off of weatherunderground from my stations data, how will i make my realtime.txt file upload into graphs like this on my normal http://www.ballinanswweather.com website under the graphs dropdown?

I would really really like to make this happen as these are very good graphs, called highcharts http://www.highcharts.com/

Thanks
Yes you could use the data pulled from your sql base to create graphs. ie here is an example I did http://mspec.no-ip.org/spline.php , I have just not had the time to delve into things deeper at the moment.
inaciovieira
Posts: 54
Joined: Sun 01 May 2011 7:13 pm
Weather Station: Watson
Operating System: Windows 7
Location: Funchal

Re: Realtime and mysql download available.

Post by inaciovieira »

can you help mee. for me its not working.
A configure every thing and open the real.php it should impor to mysql but its not importing
mspec
Posts: 56
Joined: Sun 15 Jan 2012 11:21 pm
Weather Station: Davis vantage pro 2 cabled.
Operating System: Windows 10
Location: Christchurch

Re: Realtime and mysql download available.

Post by mspec »

inaciovieira wrote:can you help mee. for me its not working.
A configure every thing and open the real.php it should impor to mysql but its not importing
Have you made sure you have edited the files correctly ??

Make sure you have made a database called weather

If you have done this and run sqlsetup ?? , If so is there now a table in the database weather called weather ??

The other thing to check is make sure you have the path to realtime set correctly if this is not correct then no data will be put into the database.
inaciovieira
Posts: 54
Joined: Sun 01 May 2011 7:13 pm
Weather Station: Watson
Operating System: Windows 7
Location: Funchal

Re: Realtime and mysql download available.

Post by inaciovieira »

mspec wrote:
inaciovieira wrote:can you help mee. for me its not working.
A configure every thing and open the real.php it should impor to mysql but its not importing
Have you made sure you have edited the files correctly ??

Make sure you have made a database called weather

If you have done this and run sqlsetup ?? , If so is there now a table in the database weather called weather ??

The other thing to check is make sure you have the path to realtime set correctly if this is not correct then no data will be put into the database.
I'm not using the database calleds weather. i made another called meteocasas_site
real.php

Code: Select all

//This file inserts data from realtime.txt into an sql database
//Edit below your sql info
$databasehost = "localhost";
$databasename = "meteocasas_site";
$databasetable = "realtime";
$databaseusername ="xxxxxxxx";
$databasepassword = "xxxxxx";
$fieldseparator = " ";
$lineseparator = "\n";
$realfile = "/home/meteocasas/public_html/realtime.txt"; //example /home/weather/www/realtime.txt
$addauto = 1;
on the sqlsetup .php

Code: Select all

 mysql_connect("localhost", "xxxxx", "xxxx") or die(mysql_error()); 
 mysql_select_db("meteocasas_site") or die(mysql_error()); 
the realtime.txt file is in http://meteocasas.com/realtime.txt
Must a give some permitions to the two files? i have 664
wen a run the real.php e apear to be ok but it dosen't send the values to the database
mspec
Posts: 56
Joined: Sun 15 Jan 2012 11:21 pm
Weather Station: Davis vantage pro 2 cabled.
Operating System: Windows 10
Location: Christchurch

Re: Realtime and mysql download available.

Post by mspec »

inaciovieira wrote:
mspec wrote:
inaciovieira wrote:can you help mee. for me its not working.
A configure every thing and open the real.php it should impor to mysql but its not importing
Have you made sure you have edited the files correctly ??

Make sure you have made a database called weather

If you have done this and run sqlsetup ?? , If so is there now a table in the database weather called weather ??

The other thing to check is make sure you have the path to realtime set correctly if this is not correct then no data will be put into the database.
I'm not using the database calleds weather. i made another called meteocasas_site
real.php

Code: Select all

//This file inserts data from realtime.txt into an sql database
//Edit below your sql info
$databasehost = "localhost";
$databasename = "meteocasas_site";
$databasetable = "realtime";
$databaseusername ="xxxxxxxx";
$databasepassword = "xxxxxx";
$fieldseparator = " ";
$lineseparator = "\n";
$realfile = "/home/meteocasas/public_html/realtime.txt"; //example /home/weather/www/realtime.txt
$addauto = 1;
on the sqlsetup .php

Code: Select all

 mysql_connect("localhost", "xxxxx", "xxxx") or die(mysql_error()); 
 mysql_select_db("meteocasas_site") or die(mysql_error()); 
the realtime.txt file is in http://meteocasas.com/realtime.txt
Must a give some permitions to the two files? i have 664
wen a run the real.php e apear to be ok but it dosen't send the values to the database
in your database meteocasas_site is there a table called realtime ?? , you should not have to adjust your file permission's but you could try, Just make sure you change them back if it does not work.
inaciovieira
Posts: 54
Joined: Sun 01 May 2011 7:13 pm
Weather Station: Watson
Operating System: Windows 7
Location: Funchal

Re: Realtime and mysql download available.

Post by inaciovieira »

yes there is a table called realtime.
mspec
Posts: 56
Joined: Sun 15 Jan 2012 11:21 pm
Weather Station: Davis vantage pro 2 cabled.
Operating System: Windows 10
Location: Christchurch

Re: Realtime and mysql download available.

Post by mspec »

Where are you trying to run real.php from ?? , If it is not in the root of your website try moving it there.
inaciovieira
Posts: 54
Joined: Sun 01 May 2011 7:13 pm
Weather Station: Watson
Operating System: Windows 7
Location: Funchal

Re: Realtime and mysql download available.

Post by inaciovieira »

i have traied in a file called teste and already moved the real.php to the root sit and its the same.
Is it because the version of cumulus? I have the Cumulus (1.9.2-b1031) .
I have also treid on a local server anda dosent run.
Is it because im portugal user :bash:
User avatar
ergie
Posts: 44
Joined: Thu 19 Apr 2012 9:24 pm
Weather Station: WH1090
Operating System: Praspberry Pi2
Location: Oslo, Norway
Contact:

Re: Realtime and mysql download available.

Post by ergie »

In my case path is:
"/var/www/nightliferedditch.info/web/realtime.txt"
Post Reply