Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See this post 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

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

Realtime and mysql download available.

Postby mspec » Mon Apr 09, 2012 1:33 pm

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 Jun 13, 2010 12:35 am
Weather Station: Davis vantage vue
Operating System: windows 7
Location: Ballina Australia
Contact:

Re: Realtime and mysql download available.

Postby pacificblue03 » Sat Apr 21, 2012 12:26 am

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 Apr 19, 2012 9:24 pm
Weather Station: WH1090
Operating System: Praspberry Pi2
Location: Oslo, Norway
Contact:

Re: Realtime and mysql download available.

Postby ergie » Sun Apr 22, 2012 10:52 am

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 May 01, 2011 7:13 pm
Weather Station: Watson
Operating System: Windows 7
Location: Funchal

Re: Realtime and mysql download available.

Postby inaciovieira » Sun Apr 22, 2012 2:45 pm

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 Apr 19, 2012 9:24 pm
Weather Station: WH1090
Operating System: Praspberry Pi2
Location: Oslo, Norway
Contact:

Re: Realtime and mysql download available.

Postby ergie » Sun Apr 22, 2012 3:20 pm

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 May 01, 2011 7:13 pm
Weather Station: Watson
Operating System: Windows 7
Location: Funchal

Re: Realtime and mysql download available.

Postby inaciovieira » Sun Apr 22, 2012 6:06 pm

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: 52
Joined: Sun Jan 15, 2012 11:21 pm
Weather Station: Davis vantage pro 2 cabled.
Operating System: Windows 10
Location: Christchurch

Re: Realtime and mysql download available.

Postby mspec » Sun Apr 22, 2012 10:30 pm

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 May 01, 2011 7:13 pm
Weather Station: Watson
Operating System: Windows 7
Location: Funchal

Re: Realtime and mysql download available.

Postby inaciovieira » Sun Apr 22, 2012 10:36 pm

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: 52
Joined: Sun Jan 15, 2012 11:21 pm
Weather Station: Davis vantage pro 2 cabled.
Operating System: Windows 10
Location: Christchurch

Re: Realtime and mysql download available.

Postby mspec » Mon Apr 23, 2012 2:58 pm

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 May 01, 2011 7:13 pm
Weather Station: Watson
Operating System: Windows 7
Location: Funchal

Re: Realtime and mysql download available.

Postby inaciovieira » Mon Apr 23, 2012 3:02 pm

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: 52
Joined: Sun Jan 15, 2012 11:21 pm
Weather Station: Davis vantage pro 2 cabled.
Operating System: Windows 10
Location: Christchurch

Re: Realtime and mysql download available.

Postby mspec » Mon Apr 23, 2012 4:36 pm

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 May 01, 2011 7:13 pm
Weather Station: Watson
Operating System: Windows 7
Location: Funchal

Re: Realtime and mysql download available.

Postby inaciovieira » Mon Apr 23, 2012 4:40 pm

yes there is a table called realtime.

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

Re: Realtime and mysql download available.

Postby mspec » Mon Apr 23, 2012 4:47 pm

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 May 01, 2011 7:13 pm
Weather Station: Watson
Operating System: Windows 7
Location: Funchal

Re: Realtime and mysql download available.

Postby inaciovieira » Mon Apr 23, 2012 4:54 pm

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 Apr 19, 2012 9:24 pm
Weather Station: WH1090
Operating System: Praspberry Pi2
Location: Oslo, Norway
Contact:

Re: Realtime and mysql download available.

Postby ergie » Mon Apr 23, 2012 5:32 pm

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


Return to “Web site - General”

Who is online

Users browsing this forum: No registered users and 2 guests