Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4017) - 17 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

php long poll problem

Discussion of Mark Crossley's HTML5/Javascript gauges

Moderator: mcrossley

Post Reply
n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

php long poll problem

Post by n9mfk »

hi Mark
if i hit f12 the php long poll seams to be having trouble
http://n9mfk.info/cumulus/wxssgauges.php
I have set realtime to 30
beau
User avatar
mcrossley
Posts: 12691
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: php long poll problem

Post by mcrossley »

You have realtime set to 5, and the script is timing out the long poll before it returns any data.

Code: Select all

        config = {
            // Script configuration parameters you may want to 'tweak'
            scriptVer         : '2.5.5',
            weatherProgram    : 0,                      //Set 0=Cumulus, 1=Weather Display, 2=VWS, 3=WeatherCat, 4=Meteobridge, 5=WView, 6=WeeWX
            imgPathURL        : '../../../images/',             //*** Change this to the relative path for your 'Trend' graph images
            oldGauges         : 'gauges.htm',           //*** Change this to the relative path for your 'old' gauges page.
            realtimeInterval  : 5,                      //*** Download data interval, set to your realtime data update interval in seconds
            longPoll          : true,                  // if enabled, use long polling and PHP generated data !!only enable if you understand how this is implemented!!
n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

Re: php long poll problem

Post by n9mfk »

Thanks Mark
that helps it drops a few but better
Beau
User avatar
mcrossley
Posts: 12691
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: php long poll problem

Post by mcrossley »

I watched it for over 15 minutes and didn't see any problems? Can you be more specific, and capture a failure?

It sends the long poll request about 10 seconds after the previous response, and gets a reply at about the 30 second mark - just what I'd expect with a 30 sec real time interval.
n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

Re: php long poll problem

Post by n9mfk »

Hi Mark here a image showimg ome its marked in red i have seen up to 4
beau
You do not have the required permissions to view the files attached to this post.
User avatar
mcrossley
Posts: 12691
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: php long poll problem

Post by mcrossley »

OK, I see the problem. When I implemented long polling I thought it would be used for fast updates, that people doing 5 - 10 second real time updates. I had only partially thought about using it on 30 second or longer updates. So the code actually has a fixed time out at 21 seconds. Yours normally takes about 20.4 seconds so it is right on the edge of timing out all the time, as will any real time interval of 20 seconds or more.

I'll fix the script and let you know when it is available, meantime edit line 2631 and change it to say 35000, which gives a 35 second time out.

Code: Select all

                            timeout: 35000 // 35 second time-out
water01
Posts: 3215
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: php long poll problem

Post by water01 »

Mark should we all apply that fix as mine seems to be working fine with a 30 second realtime interval?
David
Image
User avatar
mcrossley
Posts: 12691
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: php long poll problem

Post by mcrossley »

David, are you using long polling? If so you will only be getting a 1 second 'grace' on the realtimegauges.txt being updated. If your uplink is good, and your server fast then you may get away with it.

If you aren't using long polling then there isn't a problem.

I'll have the fix out tomorrow morning - I hope, just about to test it now.
water01
Posts: 3215
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: php long poll problem

Post by water01 »

I am indeed and it hasn't caused me a problem so I guess I am on a fast server.
David
Image
n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

Re: php long poll problem

Post by n9mfk »

Hi Mark,
have made the change for now will wait for your fix
Thanks Beau
User avatar
mcrossley
Posts: 12691
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: php long poll problem

Post by mcrossley »

v2.5.8 is now available to fix this problem.
n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

Re: php long poll problem

Post by n9mfk »

Hi mark
How do I download it from https://github.com/mcrossley/SteelSeries-Weather-Gauges
or if i get the master do i get all ?
thanks Beau
User avatar
mcrossley
Posts: 12691
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: php long poll problem

Post by mcrossley »

On the right 'Download ZIP', but you only need the gauges.js file.
water01
Posts: 3215
Joined: Sat 13 Aug 2011 9:33 am
Weather Station: Ecowitt HP2551
Operating System: Windows 10 64bit
Location: Burnham-on-Sea
Contact:

Re: php long poll problem

Post by water01 »

I must have been using an old copy of realtimegauges-longpoll.php as when I did a diff on it comparing the one I was using there were also some changes.
David
Image
Post Reply