Créer une table avec les heures ensoleillement

Vous avez créé un tutoriel, postez-le ici

Modérateurs : jturlier, Météo Villarzel

Avatar du membre
Météo Villarzel
Administrateur du site
Messages : 524
Enregistré le : 06 févr. 2014, 09:48
Contact :

Créer une table avec les heures ensoleillement

Message par Météo Villarzel » 12 janv. 2015, 23:29

Voilà un petit tuto pour créer une table supplémentaire avec les heures d'ensoleillement, le rainrate maxi, le THSW min et max et le THW min et max.
Ce script à été réalisé par Pidou de http://www.meteo-pont-salomon.fr/
Un grand merci à lui.

Premièrement, télécharger cette archives http://www.boock.ch/meteo/sauv-donnees/ ... esdata.zip

L'archive comprends 3 fichiers
Autresdata.sql
CreationAutresdata.php
Autresdata.php

Premièrement vous devez exécuter une requête SQL depuis votre base de données principale crée par VP2SQL (data) avec le contenu du fichier Autresdata.sql
autresdata1.jpg
Maintenant vous devez avoir une nouvelle table nommée Autresdata, comme ci dessous
autresdata2.jpg
Ensuite vous devez modifier les deux fichiers php, en mettant le lien vers votre fichier de connexion à la BDD

Dans le fichier CreationAutresdata.php vous devez aussi indiquer ligne 22 et 23 le début de vos enregistrements (tstamp) http://www.timestamp.fr/ ce n'est pas obligé d'indiquer le premier enregistrement, moi par exemple j'ai une VP2 depuis mars 2012, donc j'ai mis ça comme date de départ, les enregistrements sans valeurs de la radiation solaire ne servent à rien.
autresdata3.jpg
Il faut maintenant uploader vos deux fichiers php sur votre serveur, et lancer le fichier CreationAutresdata.php depuis un navigateur.
Suivant vos données et votre vitesse de connexion, ça va prendre quelques dizaines de minutes pour construire la base avec vos données.
A la fin vous devez avoir ça,
autresdata4.jpg
Votre base de données est à jour avec les enregistrements déjà présents dans votre base de données, maintenant vous devez créer un CRON pour exécuter le fichier Autresdata.php à intervalle régulier, par exemple toutes les 30 minutes, ou n'importe quelle autre fréquence.

Il ne vous reste plus qu'a faire vos graphique avec cette nouvelle table.
Par exemple
http://www.boock.ch/meteo/heures_ensoleillement.php

A+
Vous n’avez pas les permissions nécessaires pour voir les fichiers joints à ce message.
Station Vantage Pro2+ avec station agricole - Weatherlink - GraphWeather 3.0.15b - Cumulus 1.9.4 - Windows 7/64
Graphique dynamique à partir d'une bd MySql - VP2SQL

Image

Avatar du membre
PascalWMR
Messages : 323
Enregistré le : 16 févr. 2014, 09:28
Localisation : CONFLANS EN JARNISY (F54800)
Contact :

Re: Créer une table avec les heures ensoleillement

Message par PascalWMR » 13 janv. 2015, 07:54

Salut Pierre-André
Premièrement, télécharger cette archives http://www.boock.ch/meteo/graphiques_dy ... minmax.php
Trop top ten ton tuto. Encore une fois merci.

Mais bon il y a un cafard dans le lien de téléchargement de l'archive :roll:

A+
Pascal
Station VP2Plus, Windows 10 64 bits,WeatherLink 6.0.5, VP2SQL, Graphiques Dynamiques à partir d'une BDD MySQL
Météo Conflans-en-Jarnisy
Image

Avatar du membre
Météo Villarzel
Administrateur du site
Messages : 524
Enregistré le : 06 févr. 2014, 09:48
Contact :

Re: Créer une table avec les heures ensoleillement

Message par Météo Villarzel » 13 janv. 2015, 08:55

Oups :mrgreen:
C'est corrigé.

A+
Station Vantage Pro2+ avec station agricole - Weatherlink - GraphWeather 3.0.15b - Cumulus 1.9.4 - Windows 7/64
Graphique dynamique à partir d'une bd MySql - VP2SQL

Image

Javier
Messages : 263
Enregistré le : 15 févr. 2014, 09:23
Localisation : San Sebastián, España
Contact :

Re: Créer une table avec les heures ensoleillement

Message par Javier » 14 janv. 2015, 17:45

Saludos

Félicitations à Pierre-André et Pidou pour ce grand travail. :D
Il fonctionne très bien, sauf pour redémarrer toutes les quelques secondes, la direction CreationAutresdata.php que la mise à jour de la table se arrête.
Est-il normal?
Davis Vantage Pro2 +, Windows 10, Windows 7 (64), Graphweather 3.0.15, Weatherlink 6.0.3, template Pierre-André, template Jachym
Image

Javier
Messages : 263
Enregistré le : 15 févr. 2014, 09:23
Localisation : San Sebastián, España
Contact :

Re: Créer une table avec les heures ensoleillement

Message par Javier » 14 janv. 2015, 18:23

La mise à jour a été définitivement arrêté à la date 201212090000

Le message d'erreur est:

Code : Tout sélectionner

Undefined variable: UTC_min_THW in H:\webspace\hostings\kocher.es\hosting\www\graficos-highcharts\CreationAutresdata.php on line 92 PHP Notice: Undefined variable: TZ_min_THW in H:\webspace\hostings\kocher.es\hosting\www\graficos-highcharts\CreationAutresdata.php on line 92 PHP Notice: Undefined variable: tstamp_max_THW in H:\webspace\hostings\kocher.es\hosting\www\graficos-highcharts\CreationAutresdata.php on line 92 PHP Notice: Undefined variable: UTC_max_THW in H:\webspace\hostings\kocher.es\hosting\www\graficos-highcharts\CreationAutresdata.php on line 92 PHP Notice: Undefined variable: TZ_max_THW in H:\webspace\hostings\kocher.es\hosting\www\graficos-highcharts\CreationAutresdata.php on line 92 PHP Notice: Undefined variable: tstamp_min_THSW in H:\webspace\hostings\kocher.es\hosting\www\graficos-highcharts\CreationAutresdata.php on line 92 PHP Notice: Undefined variable: UTC_min_THSW in H:\webspace\hostings\kocher.es\hosting\www\graficos-highcharts\CreationAutresdata.php on line 92 PHP Notice: Undefined variable: TZ_min_THSW in H:\webspace\hostings\kocher.es\hosting\www\graficos-highcharts\CreationAutresdata.php on line 92 PHP Notice: Undefined variable: tstamp_max_THSW in H:\webspace\hostings\kocher.es\hosting\www\graficos-highcharts\CreationAutresdata.php on line 92 PHP Notice: Undefined variable: UTC_max_THSW in H:\webspace\hostings\kocher.es\hosting\www\graficos-highcharts\CreationAutresdata.php on line 92 PHP Notice: Undefined variable: TZ_max_THSW in H:\webspace\hostings\kocher.es\hosting\www\graficos-highcharts\CreationAutresdata.php on line 92 PHP Notice: Undefined variable: tstamp_min_THW in H:\webspace\hostings\kocher.es\hosting\www\graficos-highcharts\CreationAutresdata.php on line 92 PHP Notice: Undefined variable: UTC_min_THW in H:\webspace\hostings\kocher.es\hosting\www\graficos-highcharts\CreationAutresdata.php on line 92 PHP Notice: Undefined variable: TZ_min_THW in H:\webspace\hostings\kocher.es\hosting\www\graficos-highcharts\CreationAutresdata.php on line 92 PHP Notice: Undefined variable: tstamp_max_THW in H:\webspace\hostings\kocher.es\hosting\www\graficos-highcharts\CreationAutresdata.php on line 92 PHP Notice: Undefined variable: UTC_max_THW in H:\webspace\hostings\kocher.es\hosting\www\graficos-highcharts\CreationAutresdata.php on line 92 PHP Notice: Undefined variable: TZ_max_THW in H:\webspace\hostings\kocher.es\hosting\www\graficos-highcharts\CreationAutresdata.php on line 92 PHP Fatal error: Maximum execution time of 60 seconds exceeded in H:\webspace\hostings\kocher.es\hosting\www\graficos-highcharts\CreationAutresdata.php on line 41 
Davis Vantage Pro2 +, Windows 10, Windows 7 (64), Graphweather 3.0.15, Weatherlink 6.0.3, template Pierre-André, template Jachym
Image

Avatar du membre
Météo Villarzel
Administrateur du site
Messages : 524
Enregistré le : 06 févr. 2014, 09:48
Contact :

Re: Créer une table avec les heures ensoleillement

Message par Météo Villarzel » 14 janv. 2015, 18:29

Salut Javier

le problème viens de ton hébergeur qui n'accepte pas les requêtes de plus de 60 secondes

Fatal error: Maximum execution time of 60 seconds exceeded in H:\webspace\hostings\kocher.es\hosting\www\graficos-highcharts\CreationAutresdata.php

Mois j'ai du relancer seulement 2 fois le script pour 3 ans de données.

Tu peux faire un CRON toutes les 5 minutes pour cette tâche; ça devrait fonctionner

A+
Station Vantage Pro2+ avec station agricole - Weatherlink - GraphWeather 3.0.15b - Cumulus 1.9.4 - Windows 7/64
Graphique dynamique à partir d'une bd MySql - VP2SQL

Image

Javier
Messages : 263
Enregistré le : 15 févr. 2014, 09:23
Localisation : San Sebastián, España
Contact :

Re: Créer une table avec les heures ensoleillement

Message par Javier » 14 janv. 2015, 20:21

Tu avez raison
Je ai contacté mon hébergement et, en fait, le problème vient autour.
Maintenant, je essaie de trouver une solution.

Infiniment reconnaissant :D
Davis Vantage Pro2 +, Windows 10, Windows 7 (64), Graphweather 3.0.15, Weatherlink 6.0.3, template Pierre-André, template Jachym
Image

Avatar du membre
Météo Villarzel
Administrateur du site
Messages : 524
Enregistré le : 06 févr. 2014, 09:48
Contact :

Re: Créer une table avec les heures ensoleillement

Message par Météo Villarzel » 14 janv. 2015, 20:36

Normalement tu doit pouvoir faire un CronJob chez ton hébergeur,

Mais il y a aussi ce site qui permet de faire des CRON gratuitement http://www.cronjobonline.com
cron.jpg
A+
Vous n’avez pas les permissions nécessaires pour voir les fichiers joints à ce message.
Station Vantage Pro2+ avec station agricole - Weatherlink - GraphWeather 3.0.15b - Cumulus 1.9.4 - Windows 7/64
Graphique dynamique à partir d'une bd MySql - VP2SQL

Image

Javier
Messages : 263
Enregistré le : 15 févr. 2014, 09:23
Localisation : San Sebastián, España
Contact :

Re: Créer une table avec les heures ensoleillement

Message par Javier » 14 janv. 2015, 21:36

La solution a été modifié dans le fichier php.ini de mon hébergement, la valeur:
max_execution_time = 60
la nouvelle valeur (6000)

Ce est maintenant le tableau complété :D

Maintenant, je dois mettre une cronjob dans l'hébergement pour exécuter le fichier Autresdata.php à intervalle régulier.

Muchas gracias por tu ayuda :D
Davis Vantage Pro2 +, Windows 10, Windows 7 (64), Graphweather 3.0.15, Weatherlink 6.0.3, template Pierre-André, template Jachym
Image

muchistic
Messages : 142
Enregistré le : 17 févr. 2014, 20:20
Localisation : Canejan (33)
Contact :

Re: Créer une table avec les heures ensoleillement

Message par muchistic » 14 janv. 2015, 22:00

Merci beaucoup pour le super tuto :D . la table c'est bien crée et les données y sont :)
un petit soucis tout de même ou plutôt la peur de faire une boulette, j'ai regardé sur KréativMédia et j'ai un peu de mal pour créer un Cron, un peu d'aide serait la bienvenue :)
cron.JPG
Vous n’avez pas les permissions nécessaires pour voir les fichiers joints à ce message.
https://www.meteo-canejan.fr/

ma config : VP2sql , Weaterlink 6.03 , NOAAtable, minimaxibis (sonde agricole), Windows 10 .

Répondre