Automatic push of data to MySQL server
Moderator: Mattk
Automatic push of data to MySQL server
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.
B.J.
-
- 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
I second this request !
Re:Automatic push of data to MySQL server
I agree, that would be a great feature.
Re:Automatic push of data to MySQL server
Insert of data to mysql will be great, but also export of data in sql is also ok for me.
- AenG
- Senior Boarder
- Posts: 68
- Joined: Sat Dec 01, 2007 10:06 am
- Location: Boskamp, Netherlands
- Contact:
Re: Automatic push of data to MySQL server
I also agree. Connection to a mysqldatabase would be nice!
- YJB
- Platinum Boarder
- Posts: 387
- Joined: Thu Feb 19, 2009 5:53 pm
- Location: Venhuizen, Netherlands
- Contact:
Re: Automatic push of data to MySQL server
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:
This will give yuo something like (500 records max):
(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:
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.
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}
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
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)";
- AenG
- Senior Boarder
- Posts: 68
- Joined: Sat Dec 01, 2007 10:06 am
- Location: Boskamp, Netherlands
- Contact:
Re: Automatic push of data to MySQL server
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.
My new weatherstation (campbell scientific) can store data in a mysql database. A conversion from MYSQL --> METEOHUB would be nice.
Re: Automatic push of data to MySQL server
I would also like this
Re: Automatic push of data to MySQL server
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.
- AenG
- Senior Boarder
- Posts: 68
- Joined: Sat Dec 01, 2007 10:06 am
- Location: Boskamp, Netherlands
- Contact:
Re: Automatic push of data to MySQL server
really need this option.
Export to MYSQL is also ok!
Export to MYSQL is also ok!

Re: Automatic push of data to MySQL server
i agree with the option of adding mysql export funtion to meteohub
-
- 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
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 !!
People who want to use WUGraphs really would appreciate this functionality !!
Re: Automatic push of data to MySQL server
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.
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.
-
- 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
@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 ....
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 ....
Re: Automatic push of data to MySQL server
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.
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.