• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

Need help with MMM-BMWConnect

Scheduled Pinned Locked Moved Troubleshooting
10 Posts 3 Posters 1.3k Views 3 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    cenotaph
    last edited by May 9, 2020, 4:30 PM

    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?

    S 1 Reply Last reply May 9, 2020, 4:49 PM Reply Quote 0
    • S Offline
      sdetweil @cenotaph
      last edited by May 9, 2020, 4:49 PM

      @cenotaph said in Need help with MMM-BMWConnect:

      MMM-BMWConnected

      and u did these last two steps of install?

      cd MMM-BMWConnected
      npm install 
      

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      1 Reply Last reply Reply Quote 0
      • C Offline
        cenotaph
        last edited by May 9, 2020, 7:02 PM

        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
        
        S 1 Reply Last reply May 9, 2020, 7:51 PM Reply Quote 0
        • S Offline
          sdetweil @cenotaph
          last edited by May 9, 2020, 7:51 PM

          @cenotaph

          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 with

          cd ~/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

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          1 Reply Last reply Reply Quote 0
          • C Offline
            cenotaph
            last edited by May 9, 2020, 9:57 PM

            @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.

            S 1 Reply Last reply May 9, 2020, 9:59 PM Reply Quote 0
            • S Offline
              sdetweil @cenotaph
              last edited by May 9, 2020, 9:59 PM

              @cenotaph and u added your userid and password to the module config

              like this

                      config: {
                          email: "email@example.com",
                          password: "myComplexPassword"
                      }
              

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              1 Reply Last reply Reply Quote 0
              • C Offline
                cenotaph
                last edited by May 10, 2020, 12:06 AM

                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.

                S 2 Replies Last reply May 10, 2020, 1:01 AM Reply Quote 0
                • S Offline
                  sdetweil @cenotaph
                  last edited by sdetweil May 10, 2020, 1:40 AM May 10, 2020, 1:01 AM

                  @cenotaph where r u located? in the US someplace

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  1 Reply Last reply Reply Quote 0
                  • S Offline
                    sdetweil @cenotaph
                    last edited by May 10, 2020, 1:42 AM

                    @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

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    1 Reply Last reply Reply Quote 0
                    • P Offline
                      philmavedzenge
                      last edited by May 10, 2020, 9:25 PM

                      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.

                      1 Reply Last reply Reply Quote 0
                      • 1 / 1
                      1 / 1
                      • First post
                        1/10
                        Last post
                      Enjoying MagicMirror? Please consider a donation!
                      MagicMirror created by Michael Teeuw.
                      Forum managed by Sam, technical setup by Karsten.
                      This forum is using NodeBB as its core | Contributors
                      Contact | Privacy Policy