Read the statement by Michael Teeuw here.
Need help with MMM-BMWConnect
-
I’m getting this error message upon starting MagicMirror:
Failed to read file: Error: ENOENT: no such file or directory, open 'modules/MMM-BMWConnected/bmwtoken.json' Failed to read token:Couldn't find token in response
I understand that the module is failing to create the token. Looking through the code, I see a reference to the “co.uk” site, as well as locale of “GB-en”. So I tried adding:
apiBase: "www.bmw-connecteddrive.com"
to config.js–still get the error. I wiped the module and pulled a fresh copy from github. I’ve validated my username/password by directly logging into the the US-based connecteddrive site.
Anyone have a suggestion on how to fix this error?
-
@cenotaph said in Need help with MMM-BMWConnect:
MMM-BMWConnected
and u did these last two steps of install?
cd MMM-BMWConnected npm install
-
Yes.
pi@raspberrypi:~/MagicMirror/modules/MMM-BMWConnected $ npm install added 3 packages from 7 contributors and audited 3 packages in 2.069s found 0 vulnerabilities
-
edit the module lib/tokenmanager.js
add the line marked below
console.log("token data ="+JSON.stringify(json)) // add this line before the one following already there if (typeof (json.token_type) === 'undefined' || typeof (json.access_token) === 'undefined') { _error("Couldn't find token in response"); return; }
if using pm2, then stop mm, (pm2 stop 0)
run your MM again withcd ~/MagicMirror npm start >somefile.txt
then stop MM with ctrl-c
then edit the somefile.txt
and file the line
“token data =”
post the rest, its possible the api changed -
@sdetweil said in Need help with MMM-BMWConnect:
console.log(“token data =”+JSON.stringify(json))
[2020-05-09 16:47:59.840] [LOG] token data ={"https://www.bmw-connecteddrive.com/app/default/static/external-dispatch.html?error":"access_denied"}
I do have active subscriptions for Remote Services and BMW Connected+. I’m able to interact with cardata through the app on my phone (just in case there was a question as to whether or not I should be able to use the module.)
I really appreciate your taking time to help me with this.
-
@cenotaph and u added your userid and password to the module config
like this
config: { email: "email@example.com", password: "myComplexPassword" }
-
Yes. And I’ve copy/pasted from config.js to the login form on the web site to make sure that there’s no typo in config.js.
-
@cenotaph where r u located? in the US someplace
-
@cenotaph yeh, I think the authorization credentials in the token manager won’t work.
I don’t know where that came from … but I suspect it needs to be per user, like spotify, amazon, google, u need to make an ‘app’ with permissions to connect to the data
-
I have been using this module for the past 3 or so months. Initially I had the same issue. What you need to do is to download the powershell scripts from the module’s GitHub page. Run those and see if you get any data back. I can help you if you experience any issues with this.
You will have to try different end points until you find the correct one for your region. I then changed the locale as described in the above posts and it’s been working since.
I have since changed the module a bit to add more functionality.