Author Topic: Ajax-Dashboard.php problems?????  (Read 4127 times)

0 Members and 1 Guest are viewing this topic.

Offline weathermayhem

  • Member
  • *
  • Posts: 41
Ajax-Dashboard.php problems?????
« on: July 21, 2011, 10:44:15 AM »
I am running Ajax-Dashboard.php with USA template. I am using VWS for my weather software connected to LaCrosse weather station, and just have 3 problems to resolve(strange problems). The link to the site is http://www.weathermayhem.com/Testing/

1. The current conditions icon seems to work fine during the day, but at night it changes to just partly cloudy, day time. Can't figure out what I am missing here, Where is the <span class="ajax" id="ajaxconditionicon2"> info coming from??? I would like for this to get conditions from meters as the weather station current conditions info is in accurate.

2. The wind direction seems to be changing and having a mind of its own, when the winds are SW it will show NW???

3. In internet Explorer 9, which seems to be the only one doing it and none of the others, every once in awhile when you refresh the page or click a link an error will pop up regarding VWStags.php
unexpected $end in /Testing/VWStags.php on line (several different lines). This just happens intermittently and not sure why.

If anybody has any solutions please let me know, this new website is going to be released on Aug. 1st so time is ticking.

Thanks
Weathermayhem

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 4378
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Ajax-Dashboard.php problems?????
« Reply #1 on: July 21, 2011, 11:38:36 AM »
I am running Ajax-Dashboard.php with USA template. I am using VWS for my weather software connected to LaCrosse weather station, and just have 3 problems to resolve(strange problems). The link to the site is http://www.weathermayhem.com/Testing/

1. The current conditions icon seems to work fine during the day, but at night it changes to just partly cloudy, day time. Can't figure out what I am missing here, Where is the <span class="ajax" id="ajaxconditionicon2"> info coming from??? I would like for this to get conditions from meters as the weather station current conditions info is in accurate.

Unfortunately, VWS doesn't provide updates on the current conditions in the two WeatherFlash files (wflash.txt, wflash2.txt), so the ajaxVWSwx.js doesn't include code to update the ajaxconditionicon2 -- it is solely determined by PHP based on either the value in
Code: [Select]
$WX['climate_cconds1'] = 'Scattered Clouds'; // Current Conditions Station 1
or from a nearby METAR if VWS is not set to produce the climate_cconds1 tag.  The routine in VWS-defs.php will parse the text, and pick the likely icon to display based on the text with day/night determined by the station reporting time v.s. sunrise/sunset.
I suggest you add a <meta> tag to the page showing the dashboard that causes the browser to refresh every 10 minutes or so and that should fix the display, since there is no AJAX update available for the conditions icon.


2. The wind direction seems to be changing and having a mind of its own, when the winds are SW it will show NW???

The icon shows the direction the wind is coming from and is based on VWS's
Code: [Select]
$WX['vxv001'] = 'NE'; // Wind Direction
  It is updated by AJAX from wflash[3] (degrees) converted to the nearest 16 cardinal directions and used to update the text and wind direction image.  It only displays what VWS reports .. if there's an issue with what is displayed by VWS and the apparent direction of the wind by observation, I'd check the orientation and functioning of the wind vane itself.

3. In internet Explorer 9, which seems to be the only one doing it and none of the others, every once in awhile when you refresh the page or click a link an error will pop up regarding VWStags.php
unexpected $end in /Testing/VWStags.php on line (several different lines). This just happens intermittently and not sure why.

If anybody has any solutions please let me know, this new website is going to be released on Aug. 1st so time is ticking.

Thanks
Weathermayhem

The "unexpected $end" message can happen when the PHP page is being loaded by a browser at the same time that the VWStags.php is being uploaded by FTP to the website (and is not quite complete).  Since VWS doesn't seem to offer a 'put-temp, rename' option on it's FTP, I'm not sure how to solve this permanently.  It all depends on having a fast FTP upload from VWS.

Hope this helps... you've done a nice job in re-purposing the template code for your own look/feel.  Congratulations!

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline weathermayhem

  • Member
  • *
  • Posts: 41
Re: Ajax-Dashboard.php problems?????
« Reply #2 on: July 21, 2011, 02:40:17 PM »
Thank you for the insight, I have spent months on this project and had the current conditions working at one time and don't remeber how I did it....
In the VWS-defs.php the value I have is ...

$Currentsolardescription = $WX['climate_cconds1'];  // Current Conditions
$iconnumber = VWS_icons($WX['climate_icon1'],$WX['vst143'],$WX['vst144'],$WX['vst145']);
if(isset($SITE['conditionsMETAR'])) { // override with METAR conditions for text and icon if requested.
   global $SITE;
   include_once("get-metar-conditions-inc.php");
   list($Currentsolardescription,$iconnumber) = mtr_conditions($SITE['conditionsMETAR'], $time, $sunrise, $sunset);
}

Would the problem be coming from the "get-metar-conditions-inc.php" because I haven't configured it
You mentioned adding a <meta> to refresh.....How do I do this to fix the current condition icon also I did't mention but during the day it will show "clear" next to the current conditions icon or etc. at night it doesn't show anything.

What do you think?

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 4378
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Ajax-Dashboard.php problems?????
« Reply #3 on: July 21, 2011, 03:02:12 PM »
That's the correct code in VWS-defs.php for translating the VWS (from Wunderground) current condition icon to the weather-display iconnumber for display in the dashboard.

If you put in Settings-weather.php an entry for $SITE['conditionsMETAR'] with your nearby METAR, then the builtin function in get-metar-conditions-inc.php will be used to parse the METAR results and set the description and icon from there (overriding what VWS says).   Your choice on which to use :)  There's no configuration needed for the mtr_conditions() function other than to specify (or leave undefined) the $SITE['conditionsMETAR'] in Settings-weather.php

Running your homepage with ?debug=y shows (in the view-source)
Quote
<!-- loaded 1834 VWS $WX[] entries -->
<!-- VWS_icons begin: '1:52pm','partlycloudy','6:08am','8:42pm' -->
<!-- VWSfixupTime in='6:08am' tfixed='6:08am' out='06:08' -->
<!-- VWSfixupTime in='8:42pm' tfixed='8:42pm' out='20:42' -->
<!-- VWSfixupTime in='1:52pm' tfixed='1:52pm' out='13:52' -->
<!-- VWS_icons using: time2='13:52' as day for sunrise2='06:08',sunset2='20:42'  -->
<!-- VWS_icons using: day iconnumber='19' for partlycloudy  -->
<!-- get-metar-conditions-inc.php - Version 1.00 - 21-Jan-2011 -->
<!-- mtr_conditions using METAR ICAO='KSTJ' -->
<!-- loaded from cache ./cache/metarcache-KSTJ.txt -->
<!-- KSTJ='2011/07/21 17:53 KSTJ 211753Z 36004KT 10SM CLR 36/22 A2986 RMK AO2 SLPNO 6//// T03610222 PNO $' -->
<!-- age=3686 sec '2011-07-21 17:53:00 GMT' -->
<!-- called mtr_process -->
<!-- calling 'mtr_get_time' part='211753Z' ptr=3 grp=1 -->
<!-- calling 'mtr_get_station_type' part='36004KT' ptr=4 grp=2 -->
<!-- calling 'mtr_get_wind' part='36004KT' ptr=4 grp=3 -->

<!-- calling 'mtr_get_var_wind' part='10SM' ptr=5 grp=4 -->
<!-- calling 'mtr_get_visibility' part='10SM' ptr=5 grp=5 -->
<!-- calling 'mtr_get_runway' part='CLR' ptr=6 grp=6 -->
<!-- calling 'mtr_get_conditions' part='CLR' ptr=6 grp=7 -->
<!-- conditions='' on entry -->
<!-- calling 'mtr_get_cloud_cover' part='CLR' ptr=6 grp=8 -->
<!-- get cloud cover 'CLR' -->
<!-- calling 'mtr_get_temperature' part='36/22' ptr=7 grp=9 -->
<!-- calling 'mtr_get_altimeter' part='A2986' ptr=8 grp=10 -->
<!-- decode for KSTJ in mtrInfo is
Array
(
    [STATION] => KSTJ
    [WIND] => N at 5 mph (7 km/h)
    [VISIBILITY] =>  10  miles (16 km)
    [CONDITIONS] =>
    [CLOUDS] => Clear
    [TEMP] => 97F (36C)
    [DEWPT] => 72F (22C)
    [HUMIDITY] => 44%
    [HEAT INDEX] => 106&deg;F (41&deg;C)
    [BAROMETER] => 1011 hPa (29.86 inHg)
)
 -->
<!-- mtr_get_iconnumber begin: '','Clear','6:08am','8:42pm' -->
<!-- mtr_fixupTime in='6:08am' tfixed='6:08am' out='06:08' -->
<!-- mtr_fixupTime in='8:42pm' tfixed='8:42pm' out='20:42' -->
<!-- mtr_fixupTime in='13:54' tfixed='13:54' out='13:54' -->
<!-- mtr_get_iconnumber using: time2='13:54' as day for sunrise2='06:08',sunset2='20:42'  -->
<!-- mtr_conditions returns 'Clear' iconnumber='0' gif='day_clear.gif' comment='Sunny' -->
So VWS climate_cconds1 is showing 'partly cloudy' while the METAR is returning 'clear' ... hmmm.  Since the METAR is being fetched, it is overriding what VWS is saying.  Does the METAR KSTJ stop reporting during the night?  If so, it's data won't be used by the routines as any METAR report more than 1.5hrs old is ignored for conditions .. that may be why there's no icon shown at night.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline weathermayhem

  • Member
  • *
  • Posts: 41
Re: Ajax-Dashboard.php problems?????
« Reply #4 on: July 21, 2011, 03:56:49 PM »
OK I see it now, yes the clear condition is coming from the KSTJ metar, I have the correct settings in my setting-weather.php, so I can see what the metar is showing after dark and see if the problem is occurring from that or if it is something else, ummm. I could then switch the metar location to see if that resolves the problem.

Thanks I will repost with the findings from this little test, but it still doesn't make sense as to why the current conditions icon is a daytime partly cloudy at night what would cause that, surely the metar isn't reporting daytime partly cloudy,?????

Ok I see what your saying, sorry

If the metar stops reporting it will revert to the VWS report of Partly Cloudy. That all makes sense now!!!!

and how do you do the debug???
« Last Edit: July 21, 2011, 04:03:13 PM by weathermayhem »

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 4378
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Ajax-Dashboard.php problems?????
« Reply #5 on: July 21, 2011, 05:10:17 PM »
In the template set, much of the internal debugging messages are shown when you run a page with ?debug=y on the URL.  Then do a view-source to see the HTML comments produced by the scripts when debug is engaged.  Really helps me out doing 'remote diagnostics' on a site with issues .. that's why I put the extra code in the scripts :)

I'll take a look too this evening and see what is happening...

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline weathermayhem

  • Member
  • *
  • Posts: 41
Re: Ajax-Dashboard.php problems?????
« Reply #6 on: July 21, 2011, 10:29:21 PM »
I have no idea why, and maybe you do, it starting working??? maybe the metar was the problem and now works, ummmmmm.....

I will watch it and see if it happens again and this weekend I can tackle the other issues!!!

Thank you for your help, if you have any ideas of why it starting working let me know


Well scratch that it only worked for a minute, and the metar appears to be the problem, what do you think.... I will change metars and see if that fixes it....
« Last Edit: July 22, 2011, 12:30:10 AM by weathermayhem »

Offline weathermayhem

  • Member
  • *
  • Posts: 41
Re: Ajax-Dashboard.php problems?????
« Reply #7 on: July 22, 2011, 11:31:00 AM »
I changed Metars and will see if that works tonight....

The next problem I pointed out is the wind direction and I determined that it is not the weather station and here is why...

If you go to http://www.weathermayhem.com, which is the original site, you will see the weather station image that is uploaded from heavy weather software.
If you stay on that page and open a new tab and go to http://www.weathermayhem.com/Testing, which is the new site in testing and go down to the ajax-dashboard and observe the wind speed.
Now I must point out at the original site you must reload the page to get the most current upload.
What I found was the wind speed is all correct but the wind directions are different, one will show SW while the other shows NW.
The data is all from the same source and the correct directions is what is shown at the original site.
My conclusion is there is something wrong in the ajax because it is showing the wrong direction but correct speed and the software is producing the correct data.

Let me know what you think based on the observation....

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 4378
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Ajax-Dashboard.php problems?????
« Reply #8 on: July 22, 2011, 12:04:22 PM »
The wind problem seems to be one in VWS.

Your VWStags.php?sce=dump shows the wind data as:

// $WX[] array size = 1834 entries.
$WX['vxv001'] = 'N'; // Wind Direction

and that is what is used for PHP (i.e. N=North)

while your wflash/Data/wflash.txt shows the wind data as

I=DEMO&F=3520339183,10:59:43,S,360.000,

The second field is showing S as the direction, while the direction of 360 degrees is actually North.
The AJAX update will use the third field (degrees) to establish what the direction for the wind is to be.

Check the offsets in VWS .. does your VWS broadcast image show the correct direction?

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline weathermayhem

  • Member
  • *
  • Posts: 41
Re: Ajax-Dashboard.php problems?????
« Reply #9 on: July 22, 2011, 06:08:00 PM »
Sure enough I looked at VWS and it was reporting the off direction and so I went into VWS and tweaked the calibration settings and that looks as if it will solve that problem.

Thank you very much as it looks as I will be right on schedule!!!!

Now as for problem number 3

I went to the site last night and I got the $end error witout even seeing the site so I know people going to it will see that and freak out.

Do you know any solution to this problem at all, here is what it says in my error log

[21-Jul-2011 22:21:09] PHP Parse error:  syntax error, unexpected $end in /home/weatherm/public_html/Testing/VWStags.php on line 1066

Let me what you think
Thanks

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 4378
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Ajax-Dashboard.php problems?????
« Reply #10 on: July 22, 2011, 06:35:48 PM »
That's caused by VWS uploading the VWStags.php at the same time that your browser is trying to fetch the page, and the VWStags.php upload isn't finished.  Unfortunately, I don't know of a way to fix that with native VWS FTP upload, since it doesn't offer the needed 'upload-to-temp-file, then rename' option (which Weather-Display does offer).

I use Fling for FTP uploads instead of VWS, and that seems to have minimized the problem, but it may be due to just quicker uploads than the native VWS can muster .. Fling doesn't seem to have an option to set the upload-temp/rename (sadly).

So.. with native VWS FTP, you'll see the error from time to time .. sorry.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline TNETWeather

  • Kevin Reed (KrelvinAZ)
  • Senior Contributor
  • ****
  • Posts: 193
  • Davis Vantage Pro2+ with full FARS
    • TNET Weather - Mesa, AZ USA
Re: Ajax-Dashboard.php problems?????
« Reply #11 on: July 22, 2011, 07:30:24 PM »
You could do something cute....

Let the VWS upload the VWStags.php script like normal, but don't use it as the actual tags file.  Instead have the website use VWStagsn.php instead...

When a visitor hits the site, have a quick check to see if the existing VWStags.php is newer than the current VWStagsn.php file, and if so, that it contains the last tag in the file, if so, move it to VWStagsn.php and continue on using the newly updated VWStagsn.php data.

Might be a slight pause occasionally, but no errors....

The check needs to do a quick stat of the two files to determine if it is newer, and then read the file to see if the end tag is there... the move itself is basically instantaneous on a Unix server.

I've done something similar for something else, but have not tried this for this... I don't use VWS, stopped playing with it years ago.

All you need is Time, Aptitude and Desire ... and you can build just about anything...

Offline weathermayhem

  • Member
  • *
  • Posts: 41
Re: Ajax-Dashboard.php problems?????
« Reply #12 on: July 22, 2011, 09:47:56 PM »
That could maybe explain few other odd things, when reloading or going to the website sometimes it takes a little while to load but no errors.

Now how many places do I need to change it to look for VWStagsn.php and do I just copy VWStags.php and rename it to VWStagsn.php and change the places that call for it?

I can try this as I need it to work near perfect.

May explain step by step...please

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 4378
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Ajax-Dashboard.php problems?????
« Reply #13 on: July 23, 2011, 12:13:58 PM »
I'll work up some code based on Kevin's idea and let you know :)

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline weathermayhem

  • Member
  • *
  • Posts: 41
Re: Ajax-Dashboard.php problems?????
« Reply #14 on: July 23, 2011, 01:46:50 PM »
Could that explain why sometimes going to the site it takes a long time to load and even when you refresh it takes sometime to reload. This doesn't happen all the time but could present a huge problem.(without errors)

Thanks :grin:

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 4378
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Ajax-Dashboard.php problems?????
« Reply #15 on: July 23, 2011, 02:16:09 PM »
Ummm... it's not likely that's the cause currently because this feature is not yet installed on your site.

There are other cache files that are automatically refreshed from external websites (if need be) each time your index.php page is loaded.  These are to support the forecast icons (advforecast2.php) and world weather extremes .. the cache files generally mitigate most of the delay to fetch data, but when the cache has to be refreshed due to age, the page load will be slower since it includes the time for the background fetch of data from the other sites.

It's hard to say exactly which scripts you're using as you've removed some of my debugging stuff from your version of the template set.  But with my limited visibility, I think you're using the following:
get-metar-conditions-inc.php which gets a METAR from weather.gov
world-weather-extremes which gets data from ???
advforecast2.php which gets data from weather.gov
get-USNO-sunmoon which gets info from USNO.mil

A needed cache refresh for any of those entities will require a fetch to that external site for data, and that increases delay in loading your page.  Fortunately, most of those cache refreshes happen at longer intervals, so generally your page should load rapidly.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline TNETWeather

  • Kevin Reed (KrelvinAZ)
  • Senior Contributor
  • ****
  • Posts: 193
  • Davis Vantage Pro2+ with full FARS
    • TNET Weather - Mesa, AZ USA
Re: Ajax-Dashboard.php problems?????
« Reply #16 on: July 23, 2011, 02:36:29 PM »
I'll work up some code based on Kevin's idea and let you know :)

Best regards,
Ken

Most likely would be a neat addon to what I assume are standard scripts.   It should be fairly straight forward, especially if the loading of the tags file is done in a central location.

All you need is Time, Aptitude and Desire ... and you can build just about anything...

Offline weathermayhem

  • Member
  • *
  • Posts: 41
Re: Ajax-Dashboard.php problems?????
« Reply #17 on: July 23, 2011, 03:03:51 PM »
Dang sorry I didn't think about that when I was building the site, I tried to leave as much intact that you had done.

I will get a list of cache pages I am using on the index.php.....and maybe increase there times more????? :sad:

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 4378
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Ajax-Dashboard.php problems?????
« Reply #18 on: July 23, 2011, 03:08:41 PM »
Here's what I've worked out .. seems to take all the contingencies I've found in testing into account.

The only update needed is to the top.php script .. replace
Code: [Select]
<?php if(isset($SITE['WXtags']) and $SITE['WXtags'] <> '') {include_once($SITE['WXtags']);} ?>
with
Code: [Select]
<?php 
 
if(isset($SITE['WXtags']) and $SITE['WXtags'] <> '') {
// see if upload copy should be done
$siteUploadFile preg_replace('|\.php$|','-new.php',$SITE['WXtags']);
if(file_exists($siteUploadFile) and 
   is_writable($SITE['WXtags']) and
   filesize($siteUploadFile) > filesize($SITE['WXtags']) - 1023 and
   filemtime($siteUploadFile) > filemtime($SITE['WXtags']) ) {
 $didCopy copy($siteUploadFile,$SITE['WXtags']);
 if($didCopy) {
 print "<!-- WXtags file updated successfully from $siteUploadFile -->\n";
 } else {
 print "<!-- WXtags file update failed from $siteUploadFile -->\n";
 }
}
if (isset($_REQUEST['debug']) and strtolower($_REQUEST['debug']) == 'y') {
  $canWriteTags is_writable($SITE['WXtags'])?"is":"IS NOT";
  print "<!-- WXtags '".$SITE['WXtags']. "' $canWriteTags writeable. -->";
}
include_once($SITE['WXtags']);
 }
?>


Then change your upload of VWStags.php to be named VWStags-new.php

Then each time your site is loaded, the VWStags-new.php file will be checked, and if newer (and complete) it will be copied to VWStags.php so the error you see with incomplete loads should be removed.   

I do check to see if the -new.php file is within 1023 bytes of size to the old .php file to make sure an FTP upload is completed before trying to copy it.  Also the VWStags.php file must be writable by PHP for this to work.

Let me know how it works for you.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 4378
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Ajax-Dashboard.php problems?????
« Reply #19 on: July 23, 2011, 03:12:39 PM »
I'll work up some code based on Kevin's idea and let you know :)

Best regards,
Ken

Most likely would be a neat addon to what I assume are standard scripts.   It should be fairly straight forward, especially if the loading of the tags file is done in a central location.

Yes, a simple addition to top.php should handle it and should support all the weather station software tags files .. but WD doesn't need it as it already does the FTP upload-as-temp/rename function.  But.. VWS, WeatherLink and Cumulus users can use this method since the tags filename is specified in the Settings-weather.php.

Thanks for the overall concept, Kevin!

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline TNETWeather

  • Kevin Reed (KrelvinAZ)
  • Senior Contributor
  • ****
  • Posts: 193
  • Davis Vantage Pro2+ with full FARS
    • TNET Weather - Mesa, AZ USA
Re: Ajax-Dashboard.php problems?????
« Reply #20 on: July 23, 2011, 03:34:25 PM »
Nice code.

All you need is Time, Aptitude and Desire ... and you can build just about anything...

Offline weathermayhem

  • Member
  • *
  • Posts: 41
Re: Ajax-Dashboard.php problems?????
« Reply #21 on: July 23, 2011, 04:23:41 PM »
Awesome... I will make the changes tonight and let you know.... :grin:

Thanks so very much!!!!!!

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 4378
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Ajax-Dashboard.php problems?????
« Reply #22 on: July 23, 2011, 04:31:58 PM »
Awesome... I will make the changes tonight and let you know.... :grin:

Thanks so very much!!!!!!

You're very welcome .. do let me know how it works out for you.  I've tried it on my test site with VWS, WL, Cumulus and even WD .. seems to work fine for all.

Nice code.
Thanks Kevin!

My only concern left on this one is how to really ensure that the FTP of the -new.php tags file is completed before the copy is done.  (I used copy instead of move so that permissions could be set on the tags file to enable writing if needed).

The code
Code: [Select]
filesize($siteUploadFile) > filesize($SITE['WXtags']) - 1023 just tries to see that the upload file is at least within one block of being done (and allow for some natural variations in the internal data).  There appears to be nothing in PHP that can reliably do a lock on the source file and have the FTP daemon honor that lock, so the size compare seemed to be the only way available .. if you know of another way that improves the reliability, please share that idea...

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis Vantage Pro Plus - FARS, Boltek-PCI/NexStorm, GRLevel3, WD, WL, VWS, Cumulus, Meteohub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline weathermayhem

  • Member
  • *
  • Posts: 41
Re: Ajax-Dashboard.php problems?????
« Reply #23 on: July 24, 2011, 02:41:06 AM »
Bare with me on VWStags-new.php because I haven't got it done yet.......tomorrow I hope.

I worked on reloading my weather station computer which was running the weather station.
VWS was running on my main computer for testing and setup purposes and it ran networked to the other computer, you know to find all the data.
My goal was to have everything running on the weather station computer.
After I moved everthing and got it situated I noticed something strange now that VWS and Heavy weather are on the same computer.......
VWS stole and placed the currdat.ist file and placed it in its own directory....
The problem I have is that the Heavy weather publisher is still feeding the old site... and it can't find currdat.ist to refresh its data......
Any thoughts on this, because I still need to feed the old site until the 1st and I was wanting to keep feeding it there after.
Can I accomplish this, Feed the new site with VWS in conjunction with heavy weather and continue to feed the old site with Heavy Weather publisher?????

Disregard there was a setting in Heavy Weather Publisher I over looked to direct it to the new location.....DUH

Problem Solved :grin: :grin: :grin:
« Last Edit: July 24, 2011, 12:16:22 PM by weathermayhem »

Offline n3ouc

  • Contributor
  • ***
  • Posts: 117
    • Air Products Campus Weather
Re: Ajax-Dashboard.php problems?????
« Reply #24 on: July 25, 2011, 12:43:58 PM »
Ken,
I did implement this change to the top.php and VWStags-new.php and it seems to be working just fine. I often logged onto the site and met with the error screen and now I do not see it at all.

Thank You!
Mike
Mike Stanton
Air Products Campus Weather

 

anything