MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. hattlegr
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    H
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 9
    • Groups 0

    hattlegr

    @hattlegr

    0
    Reputation
    182
    Profile views
    9
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    hattlegr Unfollow Follow

    Latest posts made by hattlegr

    • RE: MMM-Strava

      @ianperrin I went right back to the beginning and started the installation again to ensure I save each step.
      During the process I picked up on an error I did not follow up on. After installing --production I had to run ‘npm audit fix’

      After running this I tried the authentication again. This time the process did add the token.js file to the MMM=Strava module.

      I believe it is working now. I have logged off and rebooted to confirm and the Strava module was working correctly.

      
      pi@raspberrypi:~/MagicMirror/modules/MMM-Strava $ git checkout develop && git pull
      Branch develop set up to track remote branch develop from origin.
      Switched to a new branch 'develop'
      Already up-to-date.
      pi@raspberrypi:~/MagicMirror/modules/MMM-Strava $ npm install --production
      npm WARN conflict A git conflict was detected in package-lock.json. Attempting to auto-resolve.
      npm WARN conflict To make this happen automatically on git rebase/merge, consider using the npm-merge-driver:
      npm WARN conflict $ npx npm-merge-driver install -g
      npm WARN deprecated nomnom@1.8.1: Package no longer supported. Contact support@npmjs.com for more info.
      added 55 packages from 67 contributors and audited 3075 packages in 32.396s
      found 1 moderate severity vulnerability
        run `npm audit fix` to fix them, or `npm audit` for details // Was important to run this command to make authentication process work correctly
      
      
      pi@raspberrypi:~/MagicMirror/modules/MMM-Strava $ npm audit fix
      npm WARN deprecated nomnom@1.8.1: Package no longer supported. Contact support@npmjs.com for more info.
      added 537 packages from 583 contributors in 92.726s
      fixed 1 of 1 vulnerability in 3075 scanned packages
      pi@raspberrypi:~/MagicMirror/modules/MMM-Strava $ npm audit
                                                                                      
                             === npm audit security report ===                        
                                                                                      
      found 0 vulnerabilities
       in 3075 scanned packages
      pi@raspberrypi:~/MagicMirror/modules/MMM-Strava $
      
      // Config 
      {
      			module: "MMM-Strava",
      			position:  "center",
      			config: {
      				client_id: "3---6",
      				client_secret: "f22b--------------------0d9f7",
      				mode: "chart",
      				auto_rotate: "true",
      				units: "imperial"
      			}
      
      posted in Health
      H
      hattlegr
    • RE: MMM-Strava

      @hattlegr Note the error on line 20 related to a token which could be a possible reason MM does not remember the authorization.

      posted in Health
      H
      hattlegr
    • RE: MMM-Strava

      @ianperrin Here is the log after installing --production.

      0 info it worked if it ends with ok
      1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install', '--production' ]
      2 info using npm@5.6.0
      3 info using node@v9.11.2
      4 verbose npm-session 72bb8575f86ed6c8
      5 silly install runPreinstallTopLevelLifecycles
      6 silly preinstall MMM-Strava@2.0.0-BETA
      7 info lifecycle MMM-Strava@2.0.0-BETA~preinstall: MMM-Strava@2.0.0-BETA
      8 silly install loadCurrentTree
      9 silly install readLocalPackageData
      10 silly install loadIdealTree
      11 silly install cloneCurrentTreeToIdealTree
      12 silly install loadShrinkwrap
      13 silly saveTree MMM-Strava@2.0.0-BETA
      14 verbose stack SyntaxError: Unexpected token < in JSON at position 9216
      14 verbose stack     at JSON.parse (<anonymous>)
      14 verbose stack     at module.exports (/usr/lib/node_modules/npm/lib/utils/parse-json.js:3:15)
      14 verbose stack     at BB.join (/usr/lib/node_modules/npm/lib/install/read-shrinkwrap.js:31:20)
      14 verbose stack     at tryCatcher (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
      14 verbose stack     at Holder$3._callFunction (eval at generateHolderClass (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/join.js:92:16), <anonymous>:14:44)
      14 verbose stack     at Holder$3.checkFulfillment (eval at generateHolderClass (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/join.js:92:16), <anonymous>:29:30)
      14 verbose stack     at Promise.eval (eval at thenCallback (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/join.js:14:16), <anonymous>:6:20)
      14 verbose stack     at Promise._settlePromise (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:566:21)
      14 verbose stack     at Promise._settlePromise0 (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
      14 verbose stack     at Promise._settlePromises (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
      14 verbose stack     at Promise._fulfill (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:638:18)
      14 verbose stack     at Promise._settlePromise (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:582:21)
      14 verbose stack     at Promise._settlePromise0 (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
      14 verbose stack     at Promise._settlePromises (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
      14 verbose stack     at Promise._fulfill (/usr/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:638:18)
      14 verbose stack     at /usr/lib/node_modules/npm/node_modules/bluebird/js/release/nodeback.js:42:21
      15 verbose cwd /home/pi/MagicMirror/modules/mmm-strava
      16 verbose Linux 4.9.80-v7+
      17 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "--production"
      18 verbose node v9.11.2
      19 verbose npm  v5.6.0
      20 error Unexpected token < in JSON at position 9216
      21 verbose exit [ 1, true ]
      
      posted in Health
      H
      hattlegr
    • RE: MMM-Strava

      @ianperrin Sorry, I can’t find any logs or sure what a debug console is.

      posted in Health
      H
      hattlegr
    • RE: MMM-Strava

      @ianperrin No, there is no file called tokens.json

      posted in Health
      H
      hattlegr
    • RE: MMM-Strava

      @ianperrin The description above is very good and I have successfully got through this process.

      I have added my new Client ID and Client-secret to the config file.
      When I run my magicmirror I am asked to follow link to strava/auth.
      I am able to select the module and click the authorize button. This brings me to an the authorize page with the three check boxes as described, when I click on the authorize button it brings me to the Stava login page. I am able to login, but the screen takes me to my dashboard page. with no home / back / close buttons. (it replaces the MM page). So I can’t get out of this stage.

      Out of interest, I tried opening a browser using localhost:8080 once MM is running and get the same screen. When I click on the authorize button in the browser environment the process works fine and I am eventually taken back to the MM page and the strava data is working. However, when I shut down and star again the authorization is forgotten.

      posted in Health
      H
      hattlegr
    • RE: MMM-Strava

      @lavolp3 I am not sure how to setup a call back domain.

      posted in Health
      H
      hattlegr
    • RE: MMM-Strava

      @ianperrin

      Here is my config file

      {
      			module: "MMM-Strava",
      			position:  "bottom_right",
      			config: {
      				client_id: "6054923"
      				// client_secret: "tokin"
      			}
      		},
      

      I got my client ID using the last series of numbers from the Strava URL after I log in.

      I am not sure how to get through the Strava API application. to get client secret code.

      Here is the error i get after running authorise from my localhost:8080 URL

      {"message":"Bad Request","errors":[{"resource":"Application","field":"client_id","code":"invalid"}]}
      
      posted in Health
      H
      hattlegr
    • RE: MMM-Strava

      @ianperrin I too am stuck on the authorization; I am not sure where to get a valid “web address” and “call back domain “ from to complete the API Application on the strava site To obtain my client ID and client secret numbers The local Host:8080/MMM-Strava/auto does bring up the same screen you posted, but the authorization process fails, I presume because I don’t have the correct client information.

      posted in Health
      H
      hattlegr