mtatsuma / MMM-WeatherChart

Magic Mirror Module for displaying weather chart
MIT License
26 stars 8 forks source link

Numbers are missing since last update #27

Closed OberfragGER closed 3 years ago

OberfragGER commented 3 years ago

Hi, i like your module. But since the last update i dont see any temperatures or rain amount data. image

Here is my config. { module: 'MMM-WeatherChart', position: 'bottom_center', config: { apiKey: 'apihere', title: 'Wettervorhersage', height: '250px', width: '800px', lat: 53.62568, lon: 10.10084, units: 'metric', showRain: true, includeSnow: true, showSnow: true, showIcon: true } },

mtatsuma commented 3 years ago

Hi

Thank you for using the module.

I guess the char.js data label plugin is not loaded successfully on your environment.

You can check the console log from your browser and check if the plugin script is successfully loaded from https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels@0.7.0/dist/chartjs-plugin-datalabels.min.js.

If the scripts is loaded successfully, you can find the messages as follows.

Load script: https://cdn.jsdelivr.net/npm/chart.js@2.9.3/dist/Chart.min.js
Load script: https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels@0.7.0/dist/chartjs-plugin-datalabels.min.js
Scripts loaded for: MMM-WeatherChart

If the problem is not solved, could you share the version of magicmirror you are using?

OberfragGER commented 3 years ago

ttps://cdn.jsdelivr.net/npm/chart

Sorry for my late reply. Im a bit lost how to do that.

I opened VNC ( MM2, Version 2.15), quitted MM (ALT+Q), the the restarts begin. After that i opened the deveopment console. Got some security warnings by electron and got this info about weathercharts:

Translations loaded for: MMM-DWD-WarnWeather loader.js:185 Load script: modules/MMM-WeatherChart/MMM-WeatherChart.js module.js:508 Check MagicMirror version for module 'MMM-WeatherChart' - Minimum version: 2.12.0 - Current version: 2.15.0 module.js:510 Version is ok! module.js:516 Module registered: MMM-WeatherChart loader.js:157 Bootstrapping module: MMM-WeatherChart loader.js:185 Load script: https://cdn.jsdelivr.net/npm/chart.js@2.9.3/dist/Chart.min.js loader.js:185 Load script: https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels@0.7.0/dist/chartjs-plugin-datalabels.min.js loader.js:162 Scripts loaded for: MMM-WeatherChart loader.js:164 Styles loaded for: MMM-WeatherChart loader.js:166 Translations loaded for: MMM-WeatherChart loader.js:185 Load script: modules/MMM-OpenmapWeather/MMM-OpenmapWeather.js

Looks like everything worked as expected...? Did you looked for this?

OberfragGER commented 3 years ago

@mtatsuma I just did the following. Rename the "MMM-WeatherChart" Folder and installed it again. Still no luck!

Load script: modules/MMM-WeatherChart/MMM-WeatherChart.js module.js:508 Check MagicMirror version for module 'MMM-WeatherChart' - Minimum version: 2.12.0 - Current version: 2.15.0 module.js:516 Module registered: MMM-WeatherChart loader.js:157 Bootstrapping module: MMM-WeatherChart loader.js:185 Load script: https://cdn.jsdelivr.net/npm/chart.js@2.9.3/dist/Chart.min.js loader.js:185 Load script: https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels@0.7.0/dist/chartjs-plugin-datalabels.min.js loader.js:162 Scripts loaded for: MMM-WeatherChart loader.js:164 Styles loaded for: MMM-WeatherChart loader.js:166 Translations loaded for: MMM-WeatherChart loader.js:185 Load script: modules/MMM-withings/Chart.bundle.min.js module.js:199

Any Ideas?

mtatsuma commented 3 years ago

I have confirmed the module works well for MagicMirror v2.15.0 and found data labels on my environment.

Your console output looks good and I have no idea for now.

The latest version of chart.js and Its datalabels plugin may solve the problem. So, I will try to update the version. There is not much hope of success though.

OberfragGER commented 3 years ago

The latest version of chart.js and Its datalabels plugin may solve the problem.

Do you have any hint to how to update it? I just found how to install. https://chartjs-plugin-datalabels.netlify.app/guide/getting-started.html#integration

But where is the "right" folder to install? Inside the module MMM-Weathercharts folder? -> ok, found it. Inside MM-Folder.

2nd Question- is it somehow possible to rollback or to "update to an older version"? How?

mtatsuma commented 3 years ago

The module have two config options to change the version.

chartjsVersion
chartjsDatalablesVersion

You can change these options to update. But I don't test the any other versions except charjsVersion=2.9.3 and charjsDatalablesVersion=0.7.0.

mtatsuma commented 3 years ago

I updated the whole code and use the latest version of chart.js and its datalabels plugin. Please try it by cloning this module from the latest master branch.

Note that the datalabels plugin is still rc version for 3.x chart.js. I will release v3.0.0 after the datalabels plugin v2.0.0 is released.

OberfragGER commented 3 years ago

I updated the whole code and use the latest version of chart.js and its datalabels plugin. Please try it by cloning this module from the latest master branch.

Note that the datalabels plugin is still rc version for 3.x chart.js. I will release v3.0.0 after the datalabels plugin v2.0.0 is released.

No luck so far. I renamed the MMM_whatercharts folder and did a github pull. Then Start MM2. Same thing.

I will make the mirror new from scratch in the next weeks. Lets see- hope everything is fine.

OberfragGER commented 3 years ago

@mtatsuma - that is new... image Failed to fetch...

mtatsuma commented 3 years ago

Are you still using Chart.js v2.9.3? If you still have the old directory, you may want to remove the old ones.

I expect to see the following console logs.

Module registered: MMM-WeatherChart
loader.js:157 Bootstrapping module: MMM-WeatherChart
loader.js:185 Load script: https://cdn.jsdelivr.net/npm/chart.js@3.2.1/dist/chart.min.js
loader.js:185 Load script: https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels@2.0.0-rc.1/dist/chartjs-plugin-datalabels.min.js
loader.js:162 Scripts loaded for: MMM-WeatherChart
loader.js:164 Styles loaded for: MMM-WeatherChart
loader.js:166 Translations loaded for: MMM-WeatherChart
loader.js:204 Load stylesheet: css/custom.css
clock.js:46 Starting module: clock
main.js:507 All modules started!
OberfragGER commented 3 years ago

I have deleted the old MM-Weathercharts folder. Did sudo apt-get update, sudo apt-get upgrade Also update NPM and Update Chart.js (sudo npm install chart.js). reboot

Still no success.

I have the following in the log.

Load script: modules/MMM-WeatherChart/MMM-WeatherChart.js module.js:508 Check MagicMirror version for module 'MMM-WeatherChart' - Minimum version: 2.12.0 - Current version: 2.15.0 module.js:516 Module registered: MMM-WeatherChart loader.js:157 Bootstrapping module: MMM-WeatherChart loader.js:185 Load script: https://cdn.jsdelivr.net/npm/chart.js@2.9.3/dist/Chart.min.js loader.js:185 Load script: https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels@0.7.0/dist/chartjs-plugin-datalabels.min.js loader.js:162 Scripts loaded for: MMM-WeatherChart loader.js:164 Styles loaded for: MMM-WeatherChart

I dont have any clue why there is ....https://cdn.jsdelivr.net/npm/chart.js@2.9.3/dist/Chart.min.js

mtatsuma commented 3 years ago

Cloud you check the latest commit of MMM-WeatherChart with the following commands?

$ cd modules/MMM-WeatherChart
$ git log

You will see the message like below if you use the latest one.

commit 1b0515cbf75e14aab6643e0cb093c8e1d39e12bb
Author: mtatsuma <tatsuma.matsuki@gmail.com>
Date:   Fri May 21 22:24:11 2021 +0900

    Major version up (v3.0.0)

    1) Bump up default Chart.js version to the latest version
    2) Apply prettier auto formatter
    3) Add fontWeight option

    Note: Chart.js datalabels plugin is rc version for 3.x Chart.js.
    I will release v3.0.0 after datalabels plugin v2.0.0 is released.

If not, you should clone the latest module in MMM-WeatherChart directory.

$ rm modules/MMM-WeatherChart -rf
$ cd modules
$ git clone https://github.com/mtatsuma/MMM-WeatherChart.git

In addition, you don't need to install Chart.js with npm because it will be loaded automatically from CDN as described in the console logs, and it may conflict with other versions.

OberfragGER commented 3 years ago

image Now its not loading any longer.

Load script: modules/MMM-WeatherChart/MMM-WeatherChart.js module.js:508 Check MagicMirror version for module 'MMM-WeatherChart' - Minimum version: 2.15.0 - Current version: 2.15.0 module.js:516 Module registered: MMM-WeatherChart loader.js:157 Bootstrapping module: MMM-WeatherChart loader.js:185 Load script: https://cdn.jsdelivr.net/npm/chart.js@3.2.1/dist/chart.min.js loader.js:185 Load script: https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels@2.0.0-rc.1/dist/chartjs-plugin-datalabels.min.js loader.js:162 Scripts loaded for: MMM-WeatherChart loader.js:164 Styles loaded for: MMM-WeatherChart loader.js:166 Translations loaded for: MMM-WeatherChart loader.js:185 Load script: modules/MMM-withings/Chart.bundle.min.js :8080/modules/MMM-WeatherChart/MMM-WeatherChart.js:670 Uncaught (in promise) TypeError: Cannot set property 'size' of undefined at Class.getDom (:8080/modules/MMM-WeatherChart/MMM-WeatherChart.js:670) at main.js:114 at new Promise (<anonymous>) at updateDom (main.js:113) at Object.updateDom (main.js:558) at Class.updateDom (module.js:364) at Class.processData (:8080/modules/MMM-WeatherChart/MMM-WeatherChart.js:750) at :8080/modules/MMM-WeatherChart/MMM-WeatherChart.js:110 module.js:199 MMM-WeatherChart is suspended

OberfragGER commented 3 years ago

Dammitn. Now ist broken. Even after a reboot- the module ist not loading any longer. After a reboot i did.

image

OberfragGER commented 3 years ago

pi@MagicMirror:~ $ cd modules/MMM-WeatherChart -bash: cd: modules/MMM-WeatherChart: Datei oder Verzeichnis nicht gefunden pi@MagicMirror:~ $ cd MagicMirror/modules/MMM-WeatherChart pi@MagicMirror:~/MagicMirror/modules/MMM-WeatherChart $ git log commit cead757087b643d52310c9d58cee56890f80454f (HEAD -> master, origin/master, origin/HEAD) Merge: c2e51eb 1b0515c Author: tatsuma tatsuma.matsuki@gmail.com Date: Mon Jun 14 23:41:45 2021 +0900

Merge pull request #28 from mtatsuma/update_chartjs

Major version up (v3.0.0)

commit 1b0515cbf75e14aab6643e0cb093c8e1d39e12bb Author: mtatsuma tatsuma.matsuki@gmail.com Date: Fri May 21 22:24:11 2021 +0900

Major version up (v3.0.0)

1) Bump up default Chart.js version to the latest version
2) Apply prettier auto formatter
3) Add fontWeight option

Note: Chart.js datalabels plugin is rc version for 3.x Chart.js.
I will release v3.0.0 after datalabels plugin v2.0.0 is released.

:...skipping... commit cead757087b643d52310c9d58cee56890f80454f (HEAD -> master, origin/master, origin/HEAD) Merge: c2e51eb 1b0515c Author: tatsuma tatsuma.matsuki@gmail.com Date: Mon Jun 14 23:41:45 2021 +0900

Merge pull request #28 from mtatsuma/update_chartjs

Major version up (v3.0.0)

commit 1b0515cbf75e14aab6643e0cb093c8e1d39e12bb Author: mtatsuma tatsuma.matsuki@gmail.com Date: Fri May 21 22:24:11 2021 +0900

Major version up (v3.0.0)

1) Bump up default Chart.js version to the latest version
2) Apply prettier auto formatter
3) Add fontWeight option

Note: Chart.js datalabels plugin is rc version for 3.x Chart.js.
I will release v3.0.0 after datalabels plugin v2.0.0 is released.

commit c2e51eba59a52e3a110bd56238cf6926f72da2d0 (tag: v2.6.0) Merge: d5703dd d1f0a23 Author: tatsuma tatsuma.matsuki@gmail.com Date: Tue May 11 21:49:25 2021 +0900

Merge pull request #26 from burberius/more-color-and-locale

More colors and localized day names

commit d1f0a233b3692c5779f541b2942880a625e58d04 Author: Jens Oberender burberius@users.noreply.github.com Date: Mon May 3 21:58:41 2021 +0200

Added colors for the minimum, maximum, rain and snow line to distinguish them easier. Also changed the displaying of the day names to use the locale of MagicMirror.

commit d5703dd7696bf979a15a610ec32396bf0302cd98 (tag: v2.5.0) Merge: 0eb4c49 3655618 Author: tatsuma tatsuma.matsuki@gmail.com Date: Sun Jan 17 00:21:23 2021 +0900

Merge pull request #25 from mtatsuma/hide_rain

Add an option to hide rain chart when there is no rain

commit 36556184eb3beb5d81c12c99cf5bcaf2e155f10a Author: mtatsuma tatsuma.matsuki@gmail.com Date: Sat Jan 16 23:54:27 2021 +0900

Add an option to hide rain chart when there is no rain

Related issue:
https://github.com/mtatsuma/MMM-WeatherChart/issues/24

commit b6dfe88dfe7a4aed26046f55c683141496de7262 Author: mtatsuma tatsuma.matsuki@gmail.com Date: Sat Jan 16 23:41:33 2021 +0900

Update configuration example in README

commit 0eb4c4909114376ecdc716811c78851e1bf80b74 (tag: v2.4.0) :

mtatsuma commented 3 years ago

Thank you! I have checked your console logs.

Is it possible to remove MMM-withings module and uninstall Chart.js with npm for debugging?

The message modules/MMM-withings/Chart.bundle.min.js indicates that it also loads Chart.js and it seems to be an older version v2.7.3.

See https://github.com/kodymallory/MMM-withings/blob/master/Chart.bundle.min.js

The message MMM-WeatherChart.js:670 Uncaught (in promise) TypeError: Cannot set property 'size' of undefined at Class.getDom means the size property is not available. v2.x Chart.js don't have this property.

OberfragGER commented 3 years ago

Ok. You have found it! image Puuh. Somehow- MMM-withings wasnt even working. Thank you for your help and sorry for your waste of time!

OberfragGER commented 3 years ago

Now i know why MMM-witings "wasnt working"...

It was working. I just have the sleep data and steps in my Withings-History. So then- none of this can displayed. I tought my weight is transmitted via iPhone-App to withings...