Automatic push of data to MySQL server

Requests for future functionality

Moderator: Mattk

bjcatlin
Fresh Boarder
Fresh Boarder
Posts: 10
Joined: Thu Feb 26, 2009 9:52 pm

Automatic push of data to MySQL server

Post by bjcatlin »

I would love to see the Meteohub be able to push data to a MySQL database as it receives it from the weather station. This would allow other machines to be able to manipulate live data and allow easier integration with other live systems (such as automation systems).

B.J.
HLucas01
Junior Boarder
Junior Boarder
Posts: 20
Joined: Sat Feb 14, 2009 1:22 pm
Location: Montfort in the Netherlands

Re:Automatic push of data to MySQL server

Post by HLucas01 »

I second this request !
uhf
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: Fri Mar 13, 2009 5:24 am
Location: Iowa, USA

Re:Automatic push of data to MySQL server

Post by uhf »

I agree, that would be a great feature.
rovinj
Junior Boarder
Junior Boarder
Posts: 26
Joined: Mon Feb 16, 2009 9:55 pm

Re:Automatic push of data to MySQL server

Post by rovinj »

Insert of data to mysql will be great, but also export of data in sql is also ok for me.
User avatar
AenG
Senior Boarder
Senior Boarder
Posts: 68
Joined: Sat Dec 01, 2007 10:06 am
Location: Boskamp, Netherlands
Contact:

Re: Automatic push of data to MySQL server

Post by AenG »

I also agree. Connection to a mysqldatabase would be nice!
User avatar
YJB
Platinum Boarder
Platinum Boarder
Posts: 387
Joined: Thu Feb 19, 2009 5:53 pm
Location: Venhuizen, Netherlands
Contact:

Re: Automatic push of data to MySQL server

Post by YJB »

I guess the problem is what will be the definition of a mysql export feature, since everybody has different needs (for instance, which data, which fields etc).

If you are already running a mysql server, you can probably fetch the data from meteohub:

Code: Select all

wget -q -O - "http://meteohub/meteolog.cgi?mode=data&start=${START_TIME}&sensor=rain4"|sed '/^$/d' >> ${WORKFILE}
This will give yuo something like (500 records max):

Code: Select all

20110421183527 rain4 0.0 109.2
20110421183628 rain4 0.0 109.2
20110421183759 rain4 0.0 109.2
20110421183901 rain4 0.0 109.2
20110421184003 rain4 0.0 109.2
20110421184105 rain4 0.0 109.2
20110421184207 rain4 0.0 109.2
20110421184309 rain4 0.0 109.2
20110421184411 rain4 0.0 109.2
(The starttime is essentially the last time you did load the data successfully, this allows for unattended retries in case of failures)

then do you your cleaning of data change offsets or whatever, followed by something like:

Code: Select all

mysql --silent --user=w_load --database=weather --execute="load data infile '/tmp/loadfile_${data_type}.$$' into table rain_readings FIELDS TERMINATED BY ' '  LINES TERMINATED BY '\n' (datetime,sensor,total,pulses)";
I run the entire script every 10 mins. Right now I run my entire script is running in ksh, but I've still got a Perl conversion on my to-do list, since it will be less resource intensive.
User avatar
AenG
Senior Boarder
Senior Boarder
Posts: 68
Joined: Sat Dec 01, 2007 10:06 am
Location: Boskamp, Netherlands
Contact:

Re: Automatic push of data to MySQL server

Post by AenG »

That would be a nice solution to export all the meteohub data to MYSQL.

My new weatherstation (campbell scientific) can store data in a mysql database. A conversion from MYSQL --> METEOHUB would be nice.
geiro
Senior Boarder
Senior Boarder
Posts: 47
Joined: Mon Jul 18, 2011 12:42 am
Location: Oslo, Norway
Contact:

Re: Automatic push of data to MySQL server

Post by geiro »

I would also like this
geiro
Senior Boarder
Senior Boarder
Posts: 47
Joined: Mon Jul 18, 2011 12:42 am
Location: Oslo, Norway
Contact:

Re: Automatic push of data to MySQL server

Post by geiro »

I wonder if this has been considered? I´ll be happy to pay for a function like this as a separate or add-on license.
User avatar
AenG
Senior Boarder
Senior Boarder
Posts: 68
Joined: Sat Dec 01, 2007 10:06 am
Location: Boskamp, Netherlands
Contact:

Re: Automatic push of data to MySQL server

Post by AenG »

really need this option.

Export to MYSQL is also ok! :D
MarKel
Fresh Boarder
Fresh Boarder
Posts: 19
Joined: Mon Aug 23, 2010 4:03 pm

Re: Automatic push of data to MySQL server

Post by MarKel »

i agree with the option of adding mysql export funtion to meteohub
HLucas01
Junior Boarder
Junior Boarder
Posts: 20
Joined: Sat Feb 14, 2009 1:22 pm
Location: Montfort in the Netherlands

Re: Automatic push of data to MySQL server

Post by HLucas01 »

It has already been more than two years that we (and I) are requesting an automatic push feature of data to a MySQL Server.
People who want to use WUGraphs really would appreciate this functionality !!
rovinj
Junior Boarder
Junior Boarder
Posts: 26
Joined: Mon Feb 16, 2009 9:55 pm

Re: Automatic push of data to MySQL server

Post by rovinj »

I wrote a small script that put data from Meteohub to MySQL.
If you want to test it you can download it here: http://meteo.rovinj.net/Meteohub-2-MySQL.zip
Please let me know if you find bugs or have suggestions.
HLucas01
Junior Boarder
Junior Boarder
Posts: 20
Joined: Sat Feb 14, 2009 1:22 pm
Location: Montfort in the Netherlands

Re: Automatic push of data to MySQL server

Post by HLucas01 »

@rovinj: thank you for your PHP scripts,
However, I noticed the server script is encrypted using IonCube.
Probably you did this to protect your intellectual property, but I never install scripts on any server or computer unless I have validated the content of the script.
Who knows what the scripts do besides the functionality one can see?
So unless you are willing to provide scripts that are not encrypted, we will have to wait for the Meteohub team ....
rovinj
Junior Boarder
Junior Boarder
Posts: 26
Joined: Mon Feb 16, 2009 9:55 pm

Re: Automatic push of data to MySQL server

Post by rovinj »

As I wrote in ReadMe file the script is encoded with IonCube. I am offering it for free, and there is no time limit or hidden functionality in it.
Instead of immediately rejecting maybe you could test it on virtual machine, but if you prefer to have source code you can buy it.
Decision is up to you.
Post Reply