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 4019) - 03 April 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
Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024
Cumulus MX V4 beta test release 4.0.0 (build 4019) - 03 April 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
Undefined units in trends.htm
Moderator: mcrossley
- laulau
- Posts: 678
- Joined: Tue 13 Oct 2009 10:52 pm
- Weather Station: WeatherDuino Pro2
- Operating System: Win 7
- Location: Meyenheim, Alsace, FR
- Contact:
Undefined units in trends.htm
I have (undefined) as units in trends.htm, it's ok in charts.html.
Is something missing somewhere ?
Is something missing somewhere ?
You do not have the required permissions to view the files attached to this post.
- steve
- Cumulus Author
- Posts: 26701
- Joined: Mon 02 Jun 2008 6:49 pm
- Weather Station: None
- Operating System: None
- Location: Vienne, France
- Contact:
Re: Undefined units in trends.htm
The javascript reads the units from the units.json file that MX uploads. The contents of that file downloaded from your site look OK, but your web server is returning it with Content-Type application/octet-stream, unlike my web server, which returns it as application/json. Perhaps this stops the javascript being able to interpret it correctly.
Steve
- jpsc
- Posts: 179
- Joined: Tue 23 Aug 2011 6:06 pm
- Weather Station: Davis Vantage Vue, belfryboy USB
- Operating System: Raspbian Bullseye
- Location: Wye valley, Herefordshire, UK
- Contact:
Re: Undefined units in trends.htm
I see the same 3009 and 3010, Windows 7 serving to Chrome
- mcrossley
- Posts: 12763
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Bullseye Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: Undefined units in trends.htm
I have a nagging memory that this is why I stuck with .txt for the ss gauges, too many web servers don't have the mime types up to date. Though using .txt also has its own problems.
- laulau
- Posts: 678
- Joined: Tue 13 Oct 2009 10:52 pm
- Weather Station: WeatherDuino Pro2
- Operating System: Win 7
- Location: Meyenheim, Alsace, FR
- Contact:
Re: Undefined units in trends.htm
I think I'll do a test on my main website (paying hosting with OVH.com) rather than Chez.com that is a free hosting (but with less capable services)
- laulau
- Posts: 678
- Joined: Tue 13 Oct 2009 10:52 pm
- Weather Station: WeatherDuino Pro2
- Operating System: Win 7
- Location: Meyenheim, Alsace, FR
- Contact:
Re: Undefined units in trends.htm
http://laurentmey.fr/test/trends.htm
(not updated for the moment)
(not updated for the moment)
- steve
- Cumulus Author
- Posts: 26701
- Joined: Mon 02 Jun 2008 6:49 pm
- Weather Station: None
- Operating System: None
- Location: Vienne, France
- Contact:
Re: Undefined units in trends.htm
Currently, the code does this:
And the problem is that 'result' is not being given to the script as an object but a string.
If I change it to use JSON.parse() instead, would that get around the problem? But would it break the case where it's working already?
Code: Select all
$.ajax({url: "units.json", success: function (result) {
createTemp(result.temp);
If I change it to use JSON.parse() instead, would that get around the problem? But would it break the case where it's working already?
Steve
- mcrossley
- Posts: 12763
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Bullseye Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: Undefined units in trends.htm
Steve, you could tell jQuery that it is a json query by adding the parameter
dataType: "json",
Or switch to using the jQuery $.getJSON() function rather than the $.ajax()
http://api.jquery.com/jquery.getjson/
dataType: "json",
Or switch to using the jQuery $.getJSON() function rather than the $.ajax()
http://api.jquery.com/jquery.getjson/
- steve
- Cumulus Author
- Posts: 26701
- Joined: Mon 02 Jun 2008 6:49 pm
- Weather Station: None
- Operating System: None
- Location: Vienne, France
- Contact:
Re: Undefined units in trends.htm
I tried adding "dataType: "json"," (using the Chrome developer tools) on Laurent's site and it works.
Steve
- mcrossley
- Posts: 12763
- Joined: Thu 07 Jan 2010 9:44 pm
- Weather Station: Davis VP2/WLL
- Operating System: Bullseye Lite rPi
- Location: Wilmslow, Cheshire, UK
- Contact:
Re: Undefined units in trends.htm
Good, I prefer to add the parameter rather than use $.getJSON() - which is just a wrapper to $.ajax anyway.
iirc, adding that parameter also auto-enables appending a browser cache buster string to the query?
iirc, adding that parameter also auto-enables appending a browser cache buster string to the query?
- steve
- Cumulus Author
- Posts: 26701
- Joined: Mon 02 Jun 2008 6:49 pm
- Weather Station: None
- Operating System: None
- Location: Vienne, France
- Contact:
Re: Undefined units in trends.htm
It looks like it might have changed the cache headers to no-cache?
Steve
- steve
- Cumulus Author
- Posts: 26701
- Joined: Mon 02 Jun 2008 6:49 pm
- Weather Station: None
- Operating System: None
- Location: Vienne, France
- Contact:
Re: Undefined units in trends.htm
I've done this change to the cumuluscharts.js file in build 3011 - you'll need to upload it to the web site, of course.
Steve