Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

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

Legacy Cumulus 1 release 1.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

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

Removing realtime updates

Topics about the Beta trials up to Build 3043, the last build by Cumulus's founder Steve Loft. It was by this time way out of Beta but Steve wanted to keep it that way until he made a decision on his and Cumulus's future.

Moderator: mcrossley

Locked
User avatar
mcrossley
Posts: 14384
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Removing realtime updates

Post by mcrossley »

I keep toying with the idea of stopping the realtime upload of data to my web server. It uploads every 5 seconds 24x7 whether or not anyone is interested. This seems both wasteful and a tad old school.

So the plan was...
1. Client connects to a page
2. Web server connects to CMX (either Web Sockets (WS) or Ajax)
3. CMX sends the data to the web server
4. Web server constructs page and sends back to client[/list]

There are a number of potential problems/features...
1. CMX probably has limits on the number of WS connections it can handle.
- Could cache the result, use the cache and only create a new connection if the cache is no longer being updated
2. CMX WS/http isn't secure
- Use firewall to limit access to web host only
3. If the client supports it you could use WS back to the client for updates too (gauges page would be a prime candidate)
- That should give near the fastest data updates possible
4. Would setting up the connection back to CMX delay the page load time too much for the client?
5. PHP doesn't have a WS client/server built-in, so need to find a suitable library
6. Is all the required data available from CMX via the API?

Steve, I know you haven't documented the API, but here's a suggestion for the future (like you haven't got enough to do!)...
In addition to the 'fixed' data sets, how about a custom option, where via WS (or HTTP Ajax), you can 'subscribe' to a set of values. CMX then sends a WS message for the initial data set, then a further message whenever one (or more) of the subscribed values changes (for Ajax it just returns the requested data), or at a requested interval. Oh, and while you're at it, secure the connections so they require authorisation ;-)

That's as far as I ever get, one day I may find the time to create a test implementation.

Thoughts?
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Removing realtime updates

Post by steve »

I was planning on adding an Ajax call where you send a set of web tags and it returns the corresponding data. I hadn't really considered extending that to web sockets.
Steve
Locked