TheThingSystem / steward

The Thing System is a set of software components and network protocols that aims to fix the Internet of Things. Our steward software is written in node.js making it both portable and easily extensible. It can run on your laptop, or fit onto a small single board computer like the Raspberry Pi.
http://thethingsystem.com
Other
346 stars 81 forks source link

1.5 on RPi: Stewie's a little dickered when it comes to the weather up here in Canada, eh? #194

Closed deftdawg closed 10 years ago

deftdawg commented 10 years ago

I'm in Toronto, Canada, so the customary unit of measure here for weather is Celsius...

However the data appears to be being displayed in F along with F converted to F (temperatures forecast are way hotter then any in our local news). Work around for this is for Canadians to manually choose metric. That gets the temperatures back into the expected range.

Second problem is that compared to Yahoo Weather the forecast is behind by 2 days (it's now Sat 1:21AM Eastern); so to Steward the forecast for Tomorrow is High 7C, Low 1C (which was Friday's forecast), Monday's forecast is High of 1C, Low -14C (which is actually Saturday's forecast).

Here's what the console says:

status=green, pairing=on, strict=on, displayUnits=metric, review=[], monitoring=idle, version=commit 311f48529 from last week, solar=night, physical=Toronto, ON, Canada, location=[43.7, -79.4], code=33, text=fair, temperature=10, humidity=27, pressure=1014.1, windchill=7, visibility=16.09, lastSample=1394855640000, forecasts=[code=31, text=clear, highTemperature=17, lowTemperature=3, nextSample=1394755200000, code=34, text=mostly sunny, highTemperature=20, lowTemperature=-2, nextSample=1394841600000, code=30, text=am clouds/pm sun, highTemperature=9, lowTemperature=-3, nextSample=1394928000000, code=30, text=partly cloudy, highTemperature=21, lowTemperature=6, nextSample=1395014400000, code=30, text=partly cloudy, highTemperature=14, lowTemperature=1, nextSample=1395100800000]
mrose17 commented 10 years ago

first, thanks for the series of reports...

i've just pushed a fix to github that may address the displayUnits issue.

you will need to "get the latest", and then force the steward to geocode your location again (do this by going to http://steward.local:8887, clicking on the gearbox, and then clicking on either "USE GEOCODING …" or "USE BROWSER …" - then click "Done" and after it goes back, close the window.

the weather issue is fairly tricky. it looks like the weather being reported is old. i've also put in a fix for that. let's hope i get it right… either way, let me know. thanks!

deftdawg commented 10 years ago

I had a chance to test this earlier...
One thing I noticed is that Tomorrow is actually "Today" and all days are shifted off 1 day. Seems if you added a "Today" forecast between Current conditions and Tomorrow, then everything would line up.

I reconfigured my address a second time to see if I would get a more accurate forecast then just the metro area, I ended up breaking the ability to view the weather at all... Here's what's in the Chrome browser error console:

TypeError {stack: (...), message: "Cannot read property '0' of undefined"}  @ index.html:211

Here's what's in the Steward log after a reconfigure and a re-login:

warning: [steward] place/1 Home event=getWeather, diagnostic=check in 1393.071 seconds
warning: [steward] place/1 Home event=getWeather, diagnostic=check in 1390.540 seconds
info: [server] https 192.168.1.30 53926 /d3/index.html loopback=false, subnet=true, local=true, remoteAddress=192.168.1.30, secure=true, event=request, method=GET
info: [server] https 192.168.1.30 53926 /d3/index.html code=200, type=text/html, octets=10587
info: [server] wss 192.168.1.30 53849 /console loopback=false, subnet=true, local=true, remoteAddress=192.168.1.30, secure=true, event=close, userID=1, clientID=admin/1, code=1001, message=
info: [server] wss 192.168.1.30 53850 /manage loopback=false, subnet=true, local=true, remoteAddress=192.168.1.30, secure=true, event=close, userID=1, clientID=admin/1, code=1000, message=
info: [server] https 192.168.1.30 53926 /d3/d3.v2.js loopback=false, subnet=true, local=true, remoteAddress=192.168.1.30, secure=true, event=request, method=GET
info: [server] https 192.168.1.30 53926 /d3/d3.v2.js code=200, type=application/javascript, octets=239674
info: [server] https 192.168.1.30 53933 /d3/master.css loopback=false, subnet=true, local=true, remoteAddress=192.168.1.30, secure=true, event=request, method=GET
info: [server] https 192.168.1.30 53934 /d3/popover.css loopback=false, subnet=true, local=true, remoteAddress=192.168.1.30, secure=true, event=request, method=GET
info: [server] https 192.168.1.30 53935 /d3/d3.steward.js loopback=false, subnet=true, local=true, remoteAddress=192.168.1.30, secure=true, event=request, method=GET
info: [server] https 192.168.1.30 53936 /d3/onactors.js loopback=false, subnet=true, local=true, remoteAddress=192.168.1.30, secure=true, event=request, method=GET
info: [server] https 192.168.1.30 53926 /d3/login.js loopback=false, subnet=true, local=true, remoteAddress=192.168.1.30, secure=true, event=request, method=GET
info: [server] https 192.168.1.30 53937 /d3/drilldown.js loopback=false, subnet=true, local=true, remoteAddress=192.168.1.30, secure=true, event=request, method=GET
info: [server] https 192.168.1.30 53933 /d3/master.css code=200, type=text/css, octets=14963
info: [server] https 192.168.1.30 53934 /d3/popover.css code=200, type=text/css, octets=11237
info: [server] https 192.168.1.30 53935 /d3/d3.steward.js code=200, type=application/javascript, octets=26538
info: [server] https 192.168.1.30 53936 /d3/onactors.js code=200, type=application/javascript, octets=10018
info: [server] https 192.168.1.30 53934 /d3/apprentices.js loopback=false, subnet=true, local=true, remoteAddress=192.168.1.30, secure=true, event=request, method=GET
info: [server] https 192.168.1.30 53936 /d3/popover.js loopback=false, subnet=true, local=true, remoteAddress=192.168.1.30, secure=true, event=request, method=GET
info: [server] https 192.168.1.30 53926 /d3/login.js code=200, type=application/javascript, octets=33350
info: [server] https 192.168.1.30 53933 /d3/colorpicker.min.js loopback=false, subnet=true, local=true, remoteAddress=192.168.1.30, secure=true, event=request, method=GET
info: [server] https 192.168.1.30 53937 /d3/drilldown.js code=200, type=application/javascript, octets=88508
info: [server] https 192.168.1.30 53934 /d3/apprentices.js code=200, type=application/javascript, octets=35908
info: [server] https 192.168.1.30 53936 /d3/popover.js code=200, type=application/javascript, octets=68809
info: [server] https 192.168.1.30 53933 /d3/colorpicker.min.js code=200, type=application/javascript, octets=8021
info: [server] https 192.168.1.30 53936 /d3/images/thing.sys.logo.black.svg loopback=false, subnet=true, local=true, remoteAddress=192.168.1.30, secure=true, event=request, method=GET
info: [server] https 192.168.1.30 53934 /d3/roadgeek2005v2-complete/Roadgeek%202005%20Series%20D.otf loopback=false, subnet=true, local=true, remoteAddress=192.168.1.30, secure=true, event=request, method=GET
info: [server] https 192.168.1.30 53936 /d3/images/thing.sys.logo.black.svg code=200, type=image/svg+xml, octets=8363
info: [server] https 192.168.1.30 53934 /d3/roadgeek2005v2-complete/Roadgeek%202005%20Series%20D.otf code=200, type=application/x-font-otf, octets=24184
info: [server] https 192.168.1.30 53934 /favicon.ico loopback=false, subnet=true, local=true, remoteAddress=192.168.1.30, secure=true, event=request, method=GET
info: [server] https 192.168.1.30 53934 /favicon.ico code=200, type=image/x-icon, octets=318
info: [server] wss 192.168.1.30 53938 /manage loopback=false, subnet=true, local=true, remoteAddress=192.168.1.30, secure=true, event=connection
info: [server] wss 192.168.1.30 53949 /console loopback=false, subnet=true, local=true, remoteAddress=192.168.1.30, secure=true, event=connection
notice: [server] wss 192.168.1.30 53949 /console loopback=false, subnet=true, local=true, remoteAddress=192.168.1.30, secure=true, event=login, userID=1, clientID=admin/1
info: [server] wss 192.168.1.30 53950 /manage loopback=false, subnet=true, local=true, remoteAddress=192.168.1.30, secure=true, event=connection
notice: [manage] wss 192.168.1.30 53950 /manage loopback=false, subnet=true, local=true, remoteAddress=192.168.1.30, secure=true, event=login, userID=1, clientID=admin/1
info: [server] wss 192.168.1.30 53938 /manage loopback=false, subnet=true, local=true, remoteAddress=192.168.1.30, secure=true, event=close, code=1000, message=

Restarting steward did not fix the issue, still can't get to weather after re-login.

mrose17 commented 10 years ago

in your browser, see if you can get the javascript error console to display, so we can see the stack trace as to where the HTML5/D3 client is going off the rails...

deftdawg commented 10 years ago

Does this help?

: "TypeError: Cannot read property '0' of undefined↵    at Object.weather_drilldown [as page] (https://steward.local:8888/d3/drilldown.js:1895:15)↵    at WebSocket.ws2.onmessage (https://steward.local:8888/d3/index.html:186:18)"
mrose17 commented 10 years ago

thanks. that helps. i'm tracking it now.

mrose17 commented 10 years ago

ok, get the latest, restart your steward and see how that looks...

deftdawg commented 10 years ago

You nailed it! Good stuff!

mrose17 commented 10 years ago

every now and then i get lucky, thanks!