Author Topic: Auto updating has stopped (PHP/Ajax)  (Read 1848 times)

0 Members and 1 Guest are viewing this topic.

Offline ole.vik

  • Member
  • *
  • Posts: 9
Auto updating has stopped (PHP/Ajax)
« on: September 04, 2017, 05:38:49 AM »
Hi,

Somehow my carterlake/saratoga based website, has stopped the
auto-refresh on the front page. The "counter" just continues on, and no
data refreshes. I have no clue about where to start looking. Any obvious
places to start?

All help appreciated :-)

Site:  http://storm.tyrirabben.net




Offline Maumelle Weather

  • Forecaster
  • *****
  • Posts: 1824
    • Maumelle Weather
Re: Auto updating has stopped (PHP/Ajax)
« Reply #1 on: September 04, 2017, 08:25:42 AM »
Hi,

In your Saratoga template files that you uploaded to your website, there is a file called ajaxCUwx.js. I have attached an updated version of your ajaxCUwx.js file which should correct the issue. It is in .zip format. You will need to unzip and upload this to your website. Your FTP program will ask about over-writing the current file. This is okay.

The line I changed was:  var realtimeFile = '/realtime.txt'; //  URL location of realtime.txt relative to document root of website

to

var realtimeFile = './realtime.txt'; //  URL location of realtime.txt relative to document root of website

Hope this helps,

John
GR2AE, GR3, Cumulus

Offline ole.vik

  • Member
  • *
  • Posts: 9
Re: Auto updating has stopped (PHP/Ajax)
« Reply #2 on: September 04, 2017, 08:34:31 AM »
Hi and thanx for your effort! However, it doesn't seem to have made any difference
in this case. Counter still going strong, without any data being refreshed.

Offline Maumelle Weather

  • Forecaster
  • *****
  • Posts: 1824
    • Maumelle Weather
Re: Auto updating has stopped (PHP/Ajax)
« Reply #3 on: September 04, 2017, 08:44:31 AM »
Hi,

Did you download the Saratoga World template and the associated plugin for Cumulus? Then, change the appropriate settings for your site, etc?  I'm not see a Settings.php or a Settings-weather.php file for your site.
GR2AE, GR3, Cumulus

Offline wvdkuil

  • Wim van der kuil
  • Forecaster
  • *****
  • Posts: 1986
    • My PWS at Leuven Belgium Europe
Re: Auto updating has stopped (PHP/Ajax)
« Reply #4 on: September 04, 2017, 11:28:48 AM »
Hi and thanx for your effort! However, it doesn't seem to have made any difference
in this case. Counter still going strong, without any data being refreshed.
Your realtime file http://storm.tyrirabben.net/realtime.txt is loaded every three seconds, but it seems to have an unsupported date-time format.
This is the javascript code in ajaxCUwx.js which checks the realtime file
Code: [Select]
    var realtime = x.responseText.split(' ');
// now make sure we got the entire realtime.txt  -- thanks to Johnnywx
    var cupattern=/\d+(\/|-|\.)\d+(\/|-|\.)\d+ \d+:\d+:\d+/; // looks for 'dd/dd/dd' date string followed by 'hh:mm:ss'
// If we have a valid realtime file AND updates is < maxupdates
if( cupattern.test(x.responseText) &&
    ( updates <= maxupdates || maxupdates > 0  ) ) {
It searches for  date- time-fields such as  04/09/17 17:18:04 Your date- time-fields are formatted as "04.09.17 17.18.04"

Maybe you can check if that is the problem?

Wim


« Last Edit: September 04, 2017, 12:02:53 PM by wvdkuil »

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Auto updating has stopped (PHP/Ajax)
« Reply #5 on: September 04, 2017, 12:00:26 PM »
The date format of dd.mm.yyyy is ok.  The time format must use ':' as the delimiters for hh:mm:ss -- change your OS locale settings for time to use hh:mm:ss as the time format and it should work fine.  Nice spotting, Wim!
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline ole.vik

  • Member
  • *
  • Posts: 9
Re: Auto updating has stopped (PHP/Ajax)
« Reply #6 on: September 06, 2017, 04:55:17 AM »
Some time ago, my os got updated (win10) and the date/time format changed. This change messed up my Cumulus
logger, which complained about invalid date/time format. I have since then updated all my log files to mirror this change, just to get
Cumulus starting up without an error.

I guess i have to do a new round on this then.

Thanks for your help people!

 

anything