Page 1 of 1

Cloud Base Gauges no reaction

Posted: Thu 27 Aug 2015 7:19 am
by HenryFFO
Hello Steve,
at first excuse my bad english.
I'm using CMX on a Raspberry Pi (Old) with a WH3080 (with solar and uv) and it works very fine. I'm calling via win10 (edge and firefox) the 192.168.X.X:8998 and there are no problems without the Cloud Base Gauges. Do I have to change something in the Cumulus.ini?

Best Regards
Henry
Cumulus.ini
CumulusMX_02.PNG

Re: Cloud Base Gauges no reaction

Posted: Thu 27 Aug 2015 7:37 am
by steve
What are your current temperature, humidity, and dew point readings?

Re: Cloud Base Gauges no reaction

Posted: Thu 27 Aug 2015 7:47 am
by HenryFFO
Hi Steve,

thanks for the fast answer.
Here my actual screenshots from the gauges.


Henry

Re: Cloud Base Gauges no reaction

Posted: Thu 27 Aug 2015 8:26 am
by steve
MX doesn't supply a cloud base value to the user interface gauges, so the script calculates it using your temperature and dew point. It's the standard script which comes with the gauges. I don't know why yours doesn't update, it should be showing a figure of about 1400m with your readings. I've tried feeding in your figures as a test, and it works fine for me. Have you tried with a different browser (although Edge shows the gauges fine for me)? Are there any javascript errors in the browser F12 console?

Re: Cloud Base Gauges no reaction

Posted: Thu 27 Aug 2015 9:28 am
by HenryFFO
I can't find any errors in firefox and in edge.
All the gauges in all sites working perfect without Cloud Base.

Re: Cloud Base Gauges no reaction

Posted: Thu 27 Aug 2015 9:36 am
by steve
Sorry, the only thing I can suggest is that you use the javascript debugger in your browser to step through the code which calculates the value and updates the gauge, to see what it's doing. The code which sets the value is in lib/steelseries/gauges.js, at line 2793:

if (config.showCloudGauge && (
(config.weatherProgram === 4 || config.weatherProgram === 5) ||
data.cloudbasevalue === "")) {
// WeatherCat and VWS (and WView?) do not provide a cloud base value, so we have to calculate it...
// assume if the station uses an imperial wind speed they want cloud base in feet, otherwise metres
data.cloudbaseunit = (data.windunit === 'mph' || data.windunit === 'kts') ? 'ft' : 'm';
data.cloudbasevalue = calcCloudbase(data.temp, data.tempunit, data.dew, data.cloudbaseunit);
}

and the gauge gets updated in function update() starting at line 2546.

Unless Mark or anyone else has any suggestions...

Re: Cloud Base Gauges no reaction

Posted: Thu 27 Aug 2015 11:18 am
by mcrossley
Nope, hard to suggest what it could be without access to the failing page.

I'd put a breakpoint on line 2793 and see what happens, but I know some people wouldn't know where start doing that, and providing written instructions is v. difficult.

Re: Cloud Base Gauges no reaction

Posted: Thu 27 Aug 2015 11:48 am
by HenryFFO
Hmm, maybe i found the reason but i can't solve this.
In the realtime.txt (/home/pi/CumulusMX) I found a entry with "ft".
And in realtimegaugesT.txttmp (/home/pi/CumulusMX/web) is written :
..."cloudbasevalue":"320",
"cloudbaseunit":"ft"....

So where it comes from and should it be "m" for the "cloudbaseunit" ?

attachment realtimegaugesT.txt is in original the ...txttmp-file

Re: Cloud Base Gauges no reaction

Posted: Thu 27 Aug 2015 12:03 pm
by steve
Those files aren't used by the gauges in the user interface, the data gets 'pushed' from MX using web sockets, then the gaugefeed.js file converts the JSON into the format expected by the gauges code. No cloud base data is sent, so the gaugefeed.js file just puts "" for the value and the unit. The gauges.js code detects this and knows it has to calculate the cloud base itself. It infers the unit to use based on the unit you are using for wind speed (mph and kts -> ft, km/h and m/s -> m).

Re: Cloud Base Gauges no reaction

Posted: Thu 27 Aug 2015 12:53 pm
by HenryFFO
Something wrong with cloudbasevalue.

Re: Cloud Base Gauges no reaction

Posted: Thu 27 Aug 2015 1:28 pm
by steve
Looks like another 'decimal comma' issue. The gauges.js code is trying to do arithmetic on items which have commas in them, and javascript doesn't recognise those as numbers. I think the gauges.js code needs to convert them before using them in the calculation.

Re: Cloud Base Gauges no reaction

Posted: Thu 27 Aug 2015 4:50 pm
by mcrossley
Yep, calcCloudbase() is using the raw values, it should be running them through extractDecimal first. I'll get a fix...

Re: Cloud Base Gauges no reaction

Posted: Thu 27 Aug 2015 4:54 pm
by mcrossley
Replace with... (around line 3982)

Code: Select all

        calcCloudbase = function (temp, tempunit, dew, cloudbaseunit) {
            var sprd = extractDecimal(temp) - extractDecimal(dew);
            var cb = sprd * (tempunit[1] === 'C' ? 400 : 227.3); // cloud base in feet
            if (cloudbaseunit === 'm') {
                cb = ft2m(cb);
            }
            return cb;
        },
And it should work a bit better.

Re: Cloud Base Gauges no reaction

Posted: Fri 28 Aug 2015 3:40 pm
by HenryFFO
Hi Mark,

with the correction of gauges.js al works very fine.
Thanks for your help. Good job.
By the way, is it possible to set the value for graph-hours more than 24 (perhaps 48 or 72) to show more days in the charts?

Best Regards
Henry

Re: Cloud Base Gauges no reaction

Posted: Tue 01 Sep 2015 7:23 am
by steve
HenryFFO wrote:By the way, is it possible to set the value for graph-hours more than 24 (perhaps 48 or 72) to show more days in the charts?
Yes, it's in the 'Graphs' section in the Station settings.