Magicmirror: After updating, weather goes all wonky

Created on 16 Apr 2016  路  49Comments  路  Source: MichMich/MagicMirror

After my weather updates I see this at the top:

screen shot 2016-04-16 at 11 17 10 am

The Weather Forecast looks like it is ignoring CSS (overlapping the calendar) and the header containing the wind and sunset somehow gains random text. Just moved to v2 today (reformatted SD card).

bug

Most helpful comment

Its an overflow issue (the 2.2250... number isn't a random number, it's the minimum value javascript can handle.)

Just to be sure, it only happens on a Raspberry Pi, right?

All 49 comments

+1 I am having this problem as well.

Can you check which module generates the random string (by disabling all others.) and resubmit a screenshot? Thanks!

I tried disabling all but the current weather module and it doesn't seem to be the cause. I'm adding in other modules now until I find the problem one.

The weird thing is that the error shows up between the sunset image and the sunset time.

Leaving it a bit longer looks like this:

screen shot 2016-04-16 at 1 20 27 pm

I'll try turning everything else off and letting it sit a bit now.

I've narrowed it down to running the clock module and the current_weather modules at the same time.

screenshot

Don't read too deep into the wind speed and direction.

Intecpsp, can you confirm it is those two modules?

I actually found it with just the 2 weather modules

screen shot 2016-04-16 at 1 39 07 pm

Leaving it alone for a bit longer, it goes back to normal.

screen shot 2016-04-16 at 1 51 02 pm

It looks like the weather forecast is only extending left because of the sunset string being so long.

I just pushed an update. Could you give it a try?

I'm stuck at "Loading weather ... "

Sorry, stupid mistake. Please try again.

Looking good so far, I'll let you know in a few minutes how it goes.

Just had it again

If it happens, could you please check what your mirror received from the open weather api using the web inspector?

It seems to only happen ON the Raspberry Pi. The left is Chrome on my Mac, the right is my Pi on VNC.

screen shot 2016-04-16 at 2 27 34 pm

Was just about to update with the same thing.

Actually, I did a reboot a little while ago and started up the rest of the modules and since then there hasn't been any issue in the top right corner on the Pi. The problem is only on the clock module now.

screenshot_clock

Everything looks good when viewed from Chrome on my Windows computer.

I just enabled everything again and I concur with roxasvalor. Weather looks okay so far, but the clock is now having that issue.

screen shot 2016-04-16 at 3 05 17 pm

If multiple modules have this issue, it seems like a moment.js issue. Ill investigate further.

This looks like a previous issue:

https://github.com/MichMich/MagicMirror/issues/159

Clock and sunset still having issues:

screen shot 2016-04-16 at 3 13 08 pm

The problem is i can't debug since it doesn't happen here. Anyone able to debug it?

Could you test this fiddle to see if it gives the same issue: https://jsfiddle.net/qs0zq8n9

I'm running the snippet on the Pi without any issues.

Do you have any idea where I should look in the web inspector to find the source of the data?

Wish I could be more help but Javascript is pretty new to me.

Since the clock has the same issues. It isn't based on the data source.

Check this line:
https://github.com/MichMich/MagicMirror/blob/v2-beta/modules/default/clock/clock.js#L52

That's all it does. Maybe we could ask someone of the moment.js team to look at this issue ...

I wonder if moment.js can handle inline if statements? I modified the clock to take out the inline if, no issue so far. I didn't modify the sunrise/sunset inline if and it messed up.

That should not matter. The incline part just returns a string Moment uses.
Are you using 12 or 24 hour mode?

I'm using 12

I am using 12 as well. I modified the inline out too and so far no trouble.

Ok, please pull the latest version. This removed the inline statement.
(If this solves the issue, we discovered a javascript bug ... ;))

Just pulled, will let you know what I find.

Still have the issue:

screen shot 2016-04-16 at 3 47 09 pm

Could you try 24 hour mode. To see if that solves the issue? (The I know where to look ...)

Been running 24 hour format for 10 minutes with no issues. Looks like the issue is with the 12 hour format.

In that case, could you try the fiddle again: https://jsfiddle.net/qs0zq8n9/1/

The fiddle runs as expected but replicating that line in clock.js still fails.

This may be pretty obvious but the bug is also present when using "moment().format("h:mm a")".

Ok. I need to make a test setup for this. If I find a solution I'll let you know.
Just to be sure; 24 hour mode gives no issues. Right?

Not that I've seen. 24 hour mode looks good.

No issues to report in 24 hour mode.

Confirmed bug with 12 hour mode.
Edit: it fixed it self after hitting 12am, odd right.

Its an overflow issue (the 2.2250... number isn't a random number, it's the minimum value javascript can handle.)

Just to be sure, it only happens on a Raspberry Pi, right?

I'm using a Raspberry Pi 3

I just pushed a fix which seems to solve the issue in my test setup. Could you give it a try?

Just pulled it, will let you know how it goes.

It did not happen anymore on my test setup. I close this issue for now, but if it happens again. Feel free to let me know in this issue.

This issue still messes up the calendar. I'm in contact with the moment.js team to look for a solution.

I just pushed an update with a modification to moment.js to find the cause of this issue. My Raspberry Pi seems to work ok now. Could you guys give it a try?

This problem seems to be solved. Let me know if it returns.

Was this page helpful?
0 / 5 - 0 ratings