ianperrin / MMM-Strava

A MagicMirror Module for your Strava data.
https://forum.magicmirror.builders/topic/457/mmm-strava?_=1616840157932
MIT License
51 stars 15 forks source link

Enhancement wishes #5

Closed khassel closed 7 years ago

khassel commented 7 years ago

Hi Ian,

thank you for your strava module!

I‘m building my first MM and your module is a must for a cyclist.

There are 2 wishes.

In Table-mode I miss the altitude difference:

grafik

Second wish: My girlfriend is cyclist too. So I tried a second module in MM, but this doesn‘t work. To compare 2 strava profiles I appreciate to see e.g. the cycle activities one below the other:

grafik

The screenshots are not build with photoshop, I changed your code already … and modified the following files:

node_helper.js StravaAPI.js MMM-Strava.js

So if you are interested in this changes let me know how to push them to your repository.

Thanks,

Karsten.

P.S.: Sorry for my bad english ...

Papi77 commented 7 years ago

Hi, would it be possible to get the 3 files You mentioned above? I have new raspberry pi 3 with new OS - and have same issues: the strava module starts to flicker and/or disappears after 10-15 mins. This issues still not fxied? Also "chart" mode not working... :(

khassel commented 7 years ago

Hi, I forked the original-repo and you find the updated version here. Karsten.

ianperrin commented 7 years ago

Thanks @khassel

If you want to submit a pull request we can incorporate the changes here

khassel commented 7 years ago

done. But the Travis CI build failed ... May take a look into the code, I'm not so familiar with js. Thanks, Karsten.

Papi77 commented 7 years ago

Hi, the I have updated the module this morning (from khassel) but the flickering/disappearing issue still persists. The "chart" mode still doesn't work for me - it just renders the module into "Loading ..." state all the time :( Specifying the elevation option doesn't seem to work... I don't see any effect on it. The code I'm using is:

            {
                    module: 'MMM-Strava',
                    header: 'Strava',
                    position: 'top_right',
                    config: {
                            strava_id: '<id>',
                            access_token: '<token>',
                            elevation: true,
                            auto_rotate: true
                            }
            },

Another issue I see is that in [Year to date] and [All time] views, only number and length columns are seen - so we miss the trophy icon. In [Last 4 weeks] view - I can see all columns just fine.

khassel commented 7 years ago

Hi, I think you fetched my old master branch ... i updated this a few minutes ago, so it now points to the latest commit. So please fetch again. Your config is O.K. Karsten.

Papi77 commented 7 years ago

Yep, I fetched it again and this time I see the elevation column as expected! I will check if the issue with the flickering / disappearing is still there over weekend... (it's midnight my timezone already ;) Many thanks for Your files! BTW - any idea how to troubleshoot the issue with "chart" mode? It just doesn't work... :( but I can't find any logs which would point into right direction...

khassel commented 7 years ago

Chart mode works in my configurations. Did you use your config-code from above plus the line

mode: 'chart',

? Is your access_token correct?

Ian has merged my code in his repo, so you should use his original repo ...

Karsten.

Papi77 commented 7 years ago

Hi, after two days of running both the elevation and flickering issue seems to be fixed! Cool! Regarding the chart mode, I am using the following in my config.js:

                {
                        module: 'MMM-Strava',
                        header: 'Strava',
                        position: 'top_left',
                        config: {
                                strava_id: '<id>',
                                access_token: '<token>',
                                //elevation: true,
                                //auto_rotate: true,
                                mode: 'chart'
                                }
                },

This gives me "Loading ..." status which never completes. I believe I'm using correct access_token as I'm able to view the information in "table' mode without any issues... I have also tried using "chart" instead of 'chart' but don't see any difference... Also, I'm using Ian's code as well. Any ideas how to troubleshoot it further?

khassel commented 7 years ago

Sorry, no ideas to chart-problem, can't reproduce it ...

Papi77 commented 7 years ago

One thing I noticed when viewing pm2 log mm... When the mode is set to "table", in the log file I see:

> 0|mm       | MMM-Strava received a notification: CONFIG
> 0|mm       | MMM-Strava is fetching athlete stats
> 0|mm       | 2017-04-02T20:45:46.071Z Make request: /api/v3/athletes/<id>/stats (GET) accessToken=<token>
> 

However, in "chart" mode I see:

> 0|mm       | MMM-Strava received a notification: CONFIG
> 0|mm       | MMM-Strava is fetching athlete activity after 1490565600
> 0|mm       | 2017-04-02T20:46:59.502Z Make request: /api/v3/athlete/activities?after=1490565600 (GET) accessToken=<token>
khassel commented 7 years ago

Thats O.K., different API calls to strava.

Papi77 commented 7 years ago

Found the cause of the problem! If I set my language to 'en' I am able to see the chart mode. However, when I have it set to 'pl' - it doesn't work. So, would it be possible to enable the "chart" mode for other languages?

khassel commented 7 years ago

'pl' works in my environment ... so still nothing to debug ... Working with MagicMirror Version v.2.1.1

Papi77 commented 7 years ago

If You set Your language of the whole config.js to 'pl' - what letters do You see under the days of the week? In my case if my language is set to 'pl' globally - right at the top of my file (so that my date is in Polish):

var config = {
        port: 8080,
        ipWhitelist: ["192.168.12.1/24", "127.0.0.1", "::ffff:127.0.0.1", "::1"],
        language: 'pl',

the chart mode doesn't work. This could make sense as in Polish the letters describing days of the week would be different... e.g. N P W Ś C P S

khassel commented 7 years ago

grafik

Papi77 commented 7 years ago

Hmm... that looks correct! Could this be related to my pi's environmental settings? pi@raspberrypi3:~/MagicMirror/config $ cat /etc/default/locale

#  File generated by update-locale
LANG=pl_PL.UTF-8
Papi77 commented 7 years ago

Got it! I ran raspi-config and changed localization options (option 4). I chose to change locale (option 1) and selected the following:

[*] pl_PL ISO-8859-2 
[*] pl_PL.UTF-8 UTF-8 

-> After generating some localization files and rebooting my pi all works well!

So, I'd like to thank You khassel for for Your time and help on this issue. Your checks and comments allowed me finally to pin-point and fix the issue. Very much appreciated!