Page 1 of 1

Leuven Templates and Meteobridge - Solved

Posted: Thu Apr 23, 2015 6:13 pm
by gand
Hi
I'm in the process of setting up a new station using Davis VP2, Leuven templates and Meteobridge on a ML-3020.
Hi

I have the Leuven templates uploaded to my website and I keep getting "Text File Download Corrupted! Retrying". Most of the data from the station is ok, but it seems "Feels Like 0 C" is strange. Furthermore I have a second temperature sensor, but I can't configure out how to display the data from that one.

I have tried to follow the installation instructions very carefully and I have checked several times, but I can't figure out what I have done wrong.

Don't look at wind and rain.

Can someone please take a look it and point me in the right direction. My website is
http://gand.dk/weather2/

Thanks a lot.
Gert

Re: Leuven Templates and Meteobridge

Posted: Thu Apr 23, 2015 8:11 pm
by wvdkuil
It seems your station does not supplies wind data. All wind tags are untranslated.
This results in json errors when reading the data.

I will try to adapt the scripts with a workaround.
Wim

Re: Leuven Templates and Meteobridge

Posted: Thu Apr 23, 2015 9:35 pm
by gand
Hi Win

Thank you for pointing me in that direction. I have now connected the anemometer and I have received data on my webpage. I still have the corrupted file issue.

Thanks for your help.

Rgds
Gert

Re: Leuven Templates and Meteobridge

Posted: Fri Apr 24, 2015 8:14 am
by wvdkuil
gand wrote:Hi Win

Thank you for pointing me in that direction. I have now connected the anemometer and I have received data on my webpage. I still have the corrupted file issue.

Thanks for your help.

Rgds
Gert
The template is full UTF-8/HTML-5
One of the side-effects is that you should ALWAYS use a decent program editot to edit the scripts.
Two free products are notepad++ on a windows PC from http://notepad-plus-plus.org/ or textwrangler on a mac from http://www.barebones.com/products/textwrangler/.

Your wsSetting.php was modified using probably notepad.exe from windows. That was OK when we still used the "old" character sets. But with UTF-8 the notepad program adds BEFORE the <?php of the scriopt three extra "nearly invisible" characters, so called BOM characters.
What is BOM: http://www.w3.org/International/questio ... ark.en.php

You can check yourself any file or script on your webserver using the W3C Internationalization Checker. I checked the wsSettings.php
http://validator.w3.org/i18n-checker/ch ... te-by-uri+. You see in the yellow warnings at the bottom that the script outputs bom.

Use notepad++ open the script again and save as "UTF-8 without BOM".

The sequence of events is like this:
1. The user browser request the data from the webserver by executing the url http://gand.dk/weather2/gauges/realtimeMB.php?lang=en You can see the returned output by clicking on the link.
2. The script realtimeMB.php is loaded (sourceview: http://gand.dk/weather2/gauges/realtimeMB.php?sce=view) and that one includes the settings file after some housekeeping at line 41
3. The webserver / php parser loads that script and the three extra characters in wsSettings.php are outputted to the users browser. They are before the first visible character ( the <?php ) and are considered valid html. As all output to the visitors browser has to start with a header, the default header is sent also.
4. When the real output is sent by the realtime script with correct headers the webserver generates an error message which is also sent to the javascript in the browser.

Code: Select all

<b>Warning</b>:  Cannot modify header information - 
headers already sent by (output started at /home/www/gand.dk/weather2/wsSettings.php:1) in <b>/home/www/gand.dk/weather2/gauges/realtimeMB.php</b> on line <b>262</b><br />
The error message states that output was already sent by wsSettings.php line 1
You can inspect that wsSettings script using your ftp program/program editor.

Code: Select all

<?php
$pageName	= 'wsSettings.php';
if (!isset($SITE)){echo "<h3>invalid call to script $pageName</h3>";exit;}
Most of the editors do not show the bom characters but they are there. And as you can see there are no output instructions (echo - print - header) at line 1.

Remove those characters and all will be OK.

Wim

Re: Leuven Templates and Meteobridge

Posted: Fri Apr 24, 2015 11:46 am
by gand
Hi Win

Thanks a lot for your great help. Using Notepad++ and removing BOM characters did the trick.

Should I check all configuration files that I have changed or is it not necessary?

Is there a way to include my second temperature sensor on the front page instead of the sensor from the Davis Base Station?

Thanks again for great support.

Rgds
Gert

Re: Leuven Templates and Meteobridge

Posted: Fri Apr 24, 2015 3:35 pm
by wvdkuil
gand wrote:Hi Win

Thanks a lot for your great help. Using Notepad++ and removing BOM characters did the trick.

Should I check all configuration files that I have changed or is it not necessary?
Not necessary, there are not that many more. I try to catch all those errors for a next release.
Is there a way to include my second temperature sensor on the front page instead of the sensor from the Davis Base Station?
Thanks again for great support.
Rgds
Gert
I am not realy sure what you want.
=== If you want an extra sensor:
There are two temp sensors on the front page. They can get any name and use any sensor
default names: "inside" and "pool" change in language files
default tag: thb0temp-act en t1temp-act can be changed in your tags.txt in weather2/uploadMB/

You can see the current definition and uploaded value in lines 54/55 http://gand.dk/weather2/index.php?compa ... #data-area

The settings which hide / display these values are in wsSettingsWeather.php lines

Code: Select all

 
   27 | #---------------------------------------------------------------------------
   28 | #               Weather Station sensors and options for dashboard
   29 | #---------------------------------------------------------------------------
   30 | $SITE['UV']       	= false;  	// ##### set to false if no UV sensor
   31 | $SITE['SOLAR']    	= false;  	// ##### set to false if no Solar sensor
   32 | $SITE['extraTempLeft']  = false;  	// ##### set to false if no extra sensor available or wanted on Ajax page
   33 | $SITE['extraTempRight'] = false;  	// ##### set to false if no extra sensor available or wanted on Ajax page
extraTempLeft displays the "inside" sensor and is located beneath the large thermometer, extraTempRight is more to the right and displays the "pool" sensor.

Check the demo site http://www.wiri.be/weather2/index.php?p ... MB&lang=en.

=== If you want to replace the th0 (outside sensor) with an extra sensor
That will be more work. You have to replace every th0 with the new sensor id in the tag files.
So let me know what you want,

Wim

Wim

Re: Leuven Templates and Meteobridge

Posted: Fri Apr 24, 2015 4:07 pm
by gand
Hi Wim

I have now the second sensor displayed called "Outside", as you can see the the temperature is lower and more accurate. It is the value from "Outside" I want to be the default temperature.
Is that possible, without to much work?

Thanks

Rgds
Gert

Re: Leuven Templates and Meteobridge

Posted: Fri Apr 24, 2015 4:53 pm
by wvdkuil
I modified the tag-files to use t1 and not th0

Only the real temp values can be changed th0temp => t1temp

As there is no humidity in t1 the dew fields (th0dew) can not be changed and are still based on th0.

You can not specify which temp sensor should be used for wind-chill (wind0chill). So that one remains also based on th0.

I hope this works for you, otherwise go back to the backup of the 3 changed scripts you should make first . See the included readme.

===

The Meteohub system can use any sensor for windchill calculation, Meteobridge can not as far as I know.

Succes, Wim

Re: Leuven Templates and Meteobridge

Posted: Fri Apr 24, 2015 6:01 pm
by gand
Hi Win

Works like a charm, thanks again for your great support.

Now I can continue with the customization.

Rgds
Gert