cloudy cloudy

Author Topic: Temperature Gauges Show Wrong Temp  (Read 795 times)

0 Members and 1 Guest are viewing this topic.

Offline novawx

  • Posts: 45
  • OS/Browser:
  • Win NT 10.0
  • Chrome 64.0.3282.186
Temperature Gauges Show Wrong Temp
« on: March 15, 2018, 12:48:50 AM »
Just got steel gauges page up and running (http://www.willowsfordfarmweather.org/wxgauges.php) and when the page first opens, the outside temperature (34) and dew point (14) are showing the correct values in F but the radio button at the bottom of the page shows C is selected (see attached Temp C.png). When I tick the F radio button (see attached Temp F.png), the values change to 1.6 and -9.7, respectively, which are the values in C.  Any idea how to fix this? I'm using WD. The values in customclientraw.txt are the correct values in F.

Offline jgillett

  • John - W7JKG
  • Posts: 962
  • Phoenix, AZ
  • OS/Browser:
  • Mac OS X 10.13
  • Firefox 58.0
    • TiggrWeather Phoenix
Re: Temperature Gauges Show Wrong Temp
« Reply #1 on: March 15, 2018, 01:39:43 AM »
I would first suggest updating your WD - it's w-a-y behind. Current is 10.37S b69.
John
W7JKG


Offline mcrossley

  • Posts: 646
  • Wilmslow, Cheshire, UK
    • none
  • OS/Browser:
  • Win NT 10.0
  • Chrome 65.0.3325.162
    • WilmslowAstro Weather
Re: Temperature Gauges Show Wrong Temp
« Reply #2 on: March 15, 2018, 11:40:14 AM »
It looks like when you edited gauges.js it was not saved in UTF8 format and has been corrupted.

Look at the gauges, instead of "C" you have "°C" - always a giveaway that something isn't right.

You need to go back to the original source gauges.js, and edit/save it with a "decent editor"* that understands different file formats.

* For Windows lots of people use Notepad++, or Sublime, or Visual Studio Code, or...
Mark

Offline novawx

  • Posts: 45
  • OS/Browser:
  • Win NT 10.0
  • Chrome 64.0.3282.186
Re: Temperature Gauges Show Wrong Temp
« Reply #3 on: March 16, 2018, 12:23:37 AM »
Thanks for the tip - I knew something was wrong when I saw "°C".

However, I did edit gauges.js in Notepad++, it's the only editor I use for .php, .html, .js, etc. I'll try again starting with the original source.

Offline mcrossley

  • Posts: 646
  • Wilmslow, Cheshire, UK
    • none
  • OS/Browser:
  • Win NT 10.0
  • Chrome 65.0.3325.162
    • WilmslowAstro Weather
Re: Temperature Gauges Show Wrong Temp
« Reply #4 on: March 16, 2018, 09:11:23 AM »
Actually, if you pull the file directly it isn't corrupted. http://www.willowsfordfarmweather.org/scripts/gauges.js

So it must be because the containing page is XHTML 1.0 Transitional.  The gauges were designed for HTML 5 and UTF8 encoding. However lots of other people are using them with the Saratoga template so they can be made to work, but I'm not sure how they have done it at the moment...
Mark