MMM-AssistantMk2 and auth_and_test.js



  • Reposting because I put this in the wrong forum the first time.

    I’ll try to make a long story short:

    Installed MMM-AssistantMk2 and MMM-Hotword. Added default config for both to config.js. Got nothing but a black screen. Narrowed the problem down to MMM-AssistantMk2 and grpc. So went through the troubleshooting tips to switch to grpc-js instead (same problem) and to downgrade to v1.13 of grpc. I’ve now (for the third time) created my credentials.json file and am trying to run

    node auth_and_test.js
    

    This is what shows up after a few seconds:

    /home/pi/MagicMirror/modules/MMM-AssistantMk2/node_modules/google-assistant/components/auth.js:27
      const oauthClient = new OAuth2(key.client_id, key.client_secret, key.redirect_uris[0]);
                                         ^
    
    TypeError: Cannot read property 'client_id' of undefined
        at new Auth (/home/pi/MagicMirror/modules/MMM-AssistantMk2/node_modules/google-assistant/components/auth.js:27:38)
        at new GoogleAssistant (/home/pi/MagicMirror/modules/MMM-AssistantMk2/node_modules/google-assistant/index.js:21:16)
        at Object. (/home/pi/MagicMirror/modules/MMM-AssistantMk2/auth_and_test.js:60:19)
        at Module._compile (internal/modules/cjs/loader.js:654:30)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
        at Module.load (internal/modules/cjs/loader.js:566:32)
        at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
        at Function.Module._load (internal/modules/cjs/loader.js:498:3)
        at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
        at startup (internal/bootstrap/node.js:201:19)
    

    And I’m stuck. Help?


  • Module Developer

    @sonicgoose
    Your credentials.json is wrong. Especially you’ve missed or failed something on making credentials on google console



  • @Sean I don’t think so. I got it to work twice. My browser launched, I logged in, I got a code back and paste that into the prompt presented by auth_and_test.js. Twice. Now the third time, after downgrading grpc to v1.13, it won’t work and I get the above error.


  • Module Developer

    @sonicgoose
    Weird, because it is not related grpc. error log says your credentials.json has been corrupted or missing something.

    Open your credentials.json and look into it.

    {"installed":{"client_id":"377258677000-2rv97u3b2....
    

    It should seems similar with above.
    Your file might have other text instead "installed". Isn’t it?



  • @sean My file starts with

    {"web":{"client_id":"10236352...
    


  • @Sean This is weird. I just downloaded my credentials again and this time got

    {"installed":{"client_id":"1023635200...
    

    I’ll try this again when I get home. No idea how it could have changed.



  • SUCCESS!!