MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord
    1. Home
    2. blackpanda
    B
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 11
    • Best 1
    • Controversial 0
    • Groups 0

    blackpanda

    @blackpanda

    3
    Reputation
    287
    Profile views
    11
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    blackpanda Unfollow Follow

    Best posts made by blackpanda

    • RE: MMM-MirrorMirrorOnTheWall installation issue

      @OceanK @richland007

      Just a heads up –

      I was running into the same issues as you both. After hours of research I eventually discovered that the AWS IoT security policy for your certificates must be properly configured…otherwise you’ll be hit with authorization issues when clients attempt to connect to the IoT thing for subscribing, publishing, connections, etc. Once i corrected this, I had no further issues with the installation.

      The change I made to my policy in ‘AWS IoT>Secure>Policies’ is below:

      {
        "Version": "2012-10-17",
        "Statement": [
          {
            "Effect": "Allow",
            "Action": [
              "iot:Publish",
              "iot:Receive"
            ],
            "Resource": [
              "arn:aws:iot:us-east-1:543211234567:topic/sdk/test/java",
              "arn:aws:iot:us-east-1:543211234567:topic/sdk/test/Python",
              "arn:aws:iot:us-east-1:543211234567:topic/topic_1",
              "arn:aws:iot:us-east-1:543211234567:topic/topic_2",
              "arn:aws:iot:us-east-1:543211234567:topic/MagicMirror:new-text",
              "arn:aws:iot:us-east-1:543211234567:topic/MagicMirror:new-images",
              "arn:aws:iot:us-east-1:543211234567:topic/MagicMirror:change-module",
              "arn:aws:iot:us-east-1:543211234567:topic/MagicMirror:new-video"
            ]
          },
          {
            "Effect": "Allow",
            "Action": [
              "iot:Subscribe"
            ],
            "Resource": [
              "arn:aws:iot:us-east-1:543211234567:topicfilter/sdk/test/java",
              "arn:aws:iot:us-east-1:543211234567:topicfilter/sdk/test/Python",
              "arn:aws:iot:us-east-1:543211234567:topicfilter/topic_1",
              "arn:aws:iot:us-east-1:543211234567:topicfilter/topic_2",
              "arn:aws:iot:us-east-1:543211234567:topicfilter/MagicMirror:new-text",
              "arn:aws:iot:us-east-1:543211234567:topicfilter/MagicMirror:new-images",
              "arn:aws:iot:us-east-1:543211234567:topicfilter/MagicMirror:change-module",
              "arn:aws:iot:us-east-1:543211234567:topicfilter/MagicMirror:new-video"
            ]
          },
          {
            "Effect": "Allow",
            "Action": [
              "iot:Connect"
            ],
            "Resource": [
              "arn:aws:iot:us-east-1:543211234567:client/sdk-java",
              "arn:aws:iot:us-east-1:543211234567:client/basicPubSub",
              "arn:aws:iot:us-east-1:543211234567:client/sdk-nodejs-*",
              "arn:aws:iot:us-east-1:543211234567:client/MagicMirror*"
            ]
          }
        ]
      }
      

      Make sure your client id defined in MirrorMirror.js matches the wildcard (“MagicMirror” in this case) that was added to iot:Connect action of the policy. This needs to be modified locally in the module and also in the uploaded lambda function!

      // Setup our AWS IoT device and receive messages
      app.setup = function() {
        app.device = awsIot.device({
          keyPath: __dirname + "/certs/MagicMirror.private.key",
          certPath: __dirname + "/certs/MagicMirror.cert.pem",
          caPath: __dirname + "/certs/root-CA.crt",
          clientId: "MagicMirror" + (new Date().getTime()),
          region: "us-east-1",
          host: "YOURID.iot.us-east-1.amazonaws.com",
        });
      
      

      Best of luck and happy new year!

      posted in Troubleshooting
      B
      blackpanda

    Latest posts made by blackpanda

    • RE: MMM-MirrorMirrorOnTheWall installation issue

      @radu_stancu @OceanK posted his json config yesterday. Just need to go back a page or two in this thread.

      You’ll still need to understand what’s configured, in my opinion. Otherwise you’ll run into issue troubleshooting or extending the model. It’s pretty straight forward.

      posted in Troubleshooting
      B
      blackpanda
    • RE: MMM-MirrorMirrorOnTheWall installation issue

      @radu_stancu AMAZON.LITERAL has been deprecated.

      Check this out: https://developer.amazon.com/docs/custom-skills/literal-slot-type-reference.html

      posted in Troubleshooting
      B
      blackpanda
    • RE: MMM-MirrorMirrorOnTheWall installation issue

      @oceank you have to understand what you’ve configured in your interaction model.

      {
      “name”: “TurnOffModuleIntent”,
      “slots”: [
      {
      “name”: “moduleName”,
      “type”: “LIST_OF_MODULES”
      }
      ],
      “samples”: [
      “close {moduleName}”,
      "close module {moduleName} ",
      “hide {moduleName}”,
      "hide module {moduleName} ",
      “turn off {moduleName}”,
      “turn off module {moduleName}”
      ]
      },
      

      Check and understand your interaction model and intents. Does the type “LIST_OF_MODULES” defined in your interaction model include the module that you are trying to turn off?

      posted in Troubleshooting
      B
      blackpanda
    • RE: MMM-MirrorMirrorOnTheWall installation issue

      @OceanK @Radu_Stancu “turn off magic mirror”

      posted in Troubleshooting
      B
      blackpanda
    • RE: MMM-MirrorMirrorOnTheWall installation issue

      @oceank magic mirror… turn off {whatever you named your mm module}. Check out ModuleNames.json in your local mm module. There’s a mapping of variables to modules.

      posted in Troubleshooting
      B
      blackpanda
    • RE: MMM-MirrorMirrorOnTheWall installation issue

      @oceank Cool beans. I think this was referenced in the installation doc passively. But you have to use your invocation command again and then “turn off {whatever you module is named}”

      posted in Troubleshooting
      B
      blackpanda
    • RE: MMM-MirrorMirrorOnTheWall installation issue

      @richland007 Yep. Ran into that one. The interaction model from the project is outdated. You’ll have to refactor it a bit.

      AMAZON.LITERAL was deprecated and you’ll have to create a Custom literal (pretty easy to do from the UI).

      Check this out: https://developer.amazon.com/docs/custom-skills/literal-slot-type-reference.html

      Regarding the app id, you’re sure you copied the skill value and added it to the APP_ID variable before uploading it to Lambda? Also, did you disable skill verification in Lambda (this was mentioned in the install doc)?

      posted in Troubleshooting
      B
      blackpanda
    • RE: MMM-MirrorMirrorOnTheWall installation issue

      @oceank does it compile? what happens when you test? That model can vary, mine has been customized a bit.

      posted in Troubleshooting
      B
      blackpanda
    • RE: MMM-MirrorMirrorOnTheWall installation issue

      pro-tip:

      A way to check and see if you’re actually subscribing to the topics that are publishing search results:

      if you run the following command from a remote putty session…

      cd ~/MagicMirror
      Display=:0 npm start
      

      you should eventually see that you’re subscribing to the topics!

      0_1546647936057_ee77adc1-bc3d-485e-b41a-8db53529a743-image.png

      Initially, the misconfigured security policy was preventing this from happening and authorization errors were being thrown in the background (had to dig into cloudwatch logs for this). In putty, the command would simply hang at “Attempt to connect to AWS”

      Basically your youtube api search results will be published to the “new-video” queue…and if your aren’t subscribed to that queue then you wont see anything change on your monitor. Same for your google image searches and “new-images”. and so on.

      posted in Troubleshooting
      B
      blackpanda
    • RE: MMM-MirrorMirrorOnTheWall installation issue

      @richland007 so you changed the clientId in the lambda function and uploaded it. Did you change the client id in the module as well? Can you post your security policy? You should also define your queues (modules) there.

      The app id is defined in index.js of the skill. APP_ID is defined in a variable near the top of the file.

      Looks like this currently:

      alexa.appId = APP_ID
      

      Also, you can verify what your skill id is by checking in the amazon developer console then selecting ‘endpoint’ (it’s an option on the left pane under interaction model and interfaces).

      posted in Troubleshooting
      B
      blackpanda