Read the statement by Michael Teeuw here.
MMM-Strava
-
@ianperrin
From the new authorization process I’m getting a bad request from Strava:{ "message": "Bad Request", "errors": [ { "resource": "Application", "field": "redirect_uri", "code": "invalid" } ] }I have the feeling that I have an error in my Strava API config.
There is a “website” and a “Callback domain” that I need to put in. Does this have to do anything with the address I’m using for the authentication process via /MMM-Strava/auth?EDIT: Can it be because I’m currently accessing the mirror through a ddns service, so the address is not localhost:8080 but something else?
-
@lavolp3 are you browsing to http://localhost:8080/MMM-Strava/auth/ and using the authorisation process there? If so, where is the bad request being displayed?
It should look something like this:

-
@ianperrin No I’m browsing from a laptop like always. So it’s http://magicmirror:8080/MMM-Strava/auth/.
Do you think that makes a difference? -
-
@ianperrin Did it again as described, but still a “Bad Request” Message. Maybe I’m doing something wrong: Error message says invalid redirect_uri, so I guess I need to play around with it a bit more.
-
@ianperrin OK now it works.
I set my ddns domain “xxxx.ddns.net” as callback domain in the Authentication profile.
Then it works. The link for the authorisation inquires that the request is being sent from inside that domain. I had set localhost as the callback domain and made the request from the ddns which in that specific case did not work.Maybe you could include a description for anyone trying to do the authentication from a browser not on the RasPi itself. You would need to set the callback domain appropriately.
-
@lavolp3 that makes sense, I understand your issue now. Good pick up and we’ll done for finding that solution. I’ll look to update the read me with notes for creating the application as well as authorising the modules.
In the meantime, let me know how the token refresh works, or if any other errors appear.
-
@ianperrin Table mode doesn’t seem to rotate the actual data into monthly data for me. I have done a run of 6.4 km on Tuesday. But much more in Jan and Feb :-)


Can you confirm that?
-
@lavolp3 said in MMM-Strava:
@ianperrin Table mode doesn’t seem to rotate the actual data into monthly data for me. I have done a run of 6.4 km on Tuesday. But much more in Jan and Feb :-)
Can you confirm that?Hi @lavolp3 - can you post your config for the module and if possible the output from the log?
-
@ianperrin said in MMM-Strava:
rom the log?
My config:
//disabled: true, module: 'MMM-Strava', position: 'bottom_right', config: { client_id: "2xxxx", client_secret: "9bdxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", // strava_id: '23128899', // access_token: 'af1a3e4xxxxxxxxxxxxxxxxxxxxxxxxxxxx', // period: 'recent', auto_rotate: true, animationSpeed: 0, mode: "chart", debug: true }Regarding logs: This comes from the developer’s tab:
Load script: modules/MMM-Strava//MMM-Strava.js loader.js:182:4 Check MagicMirror version for module 'MMM-Strava' - Minimum version: 2.2.0 - Current version: 2.6.0 module.js:469:3 Module registered: MMM-Strava module.js:477:2 Bootstrapping module: MMM-Strava loader.js:152:3 Scripts loaded for: MMM-Strava loader.js:157:4 Load stylesheet: modules/MMM-Strava/MMM-Strava.css loader.js:197:4 Styles loaded for: MMM-Strava loader.js:159:5 MMM-Strava - Load translation: translations/de.json translator.js:172:5 MMM-Strava - Load translation fallback: translations/en.json translator.js:174:5 Translations loaded for: MMM-Strava loader.js:161:6 Starting module: MMM-Strava MMM-Strava.js:114:9 MMM-Strava received a system notification: ALL_MODULES_STARTED module.js:156:4 MMM-Strava received a system notification: MODULE_DOM_CREATED module.js:156:4 MMM-Strava received a system notification: DOM_OBJECTS_CREATED module.js:156:4 MMM-Strava: "Receiving notification: DATA for module_25_MMM-Strava" MMM-Strava.js:201:13 MMM-Strava received a module notification: DARK_SKY_FORECAST_WEATHER_UPDATE from sender: MMM-DarkSkyForecastnpm start dev does only give me:
MMM-Strava: "Received notification: SET_CONFIG" -
@lavolp3 - thanks and good spot. Currently rotation is only supported for
tablemode. I’ve pushed a fix to the develop branch to enforce this behaviour. Please usegit pullto get and test the changes. -
@ianperrin Confirmed! Chart is not rotating anymore.
However it might be worth to think about several rotating charts. Like for weekdays and a range of several months? -
@lavolp3 said in MMM-Strava:
@ianperrin … it might be worth to think about several rotating charts. Like for weekdays and a range of several months?
Good idea, could you add it as an issue in the Github repository so I don’t forget it?
-
@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.
-
@hattlegr thanks for testing and sorry to hear you’re having issues. Perhaps you can post your config and any logs from the mirror.
-
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"}]} -
@hattlegr said in MMM-Strava:
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
On your personal Strava API website (strava.com/settings/api), you need to set a “callback domain” for your project. What did you set?
-
@lavolp3 I am not sure how to setup a call back domain.
-
@hattlegr You need to create an application in your strava account to use this module. Have you done that?
- Go to www.strava.com/settings/api
- Create an application. As far as I understand the only really important value is the callback domain. I GUESS (!!) this would need to be http://localhost OR the hostname (or IP) of your magicmirror, something like http://magicmirror
- Then you get a client secret and access token, which you need for the further procedure.
-
@lavolp3 said in MMM-Strava:
@hattlegr You need to create an application in your strava account to use this module. Have you done that?
- Go to www.strava.com/settings/api
- Create an application. As far as I understand the only really important value is the callback domain. I GUESS (!!) this would need to be http://localhost OR the hostname (or IP) of your magicmirror, something like http://magicmirror
- Then you get a client secret and access token, which you need for the further procedure.
The easiest way to authorise the module is
-
On the My API Application page update the application by entering
localhostas the callback domain. -
Once the Strava API application is updated, copy the
client idandclient secretfrom the same page, then use these to update the module configuration in theconfig.jsfile and restart the Magic Mirror. -
Finally, on the Pi itself, browse to http://localhost:8080/MMM-Strava/auth/ and follow the steps.
If it helps, here are the settings I’ve been using to test the module:


Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login