ndg63276 / alexa-sky-hd

A smart home skill for Alexa to control a Sky+HD or SkyQ box
33 stars 15 forks source link

Server Unresponsive #35

Closed edclark1994 closed 1 year ago

edclark1994 commented 1 year ago

So, after much trial and error, I finally have my sky box recognised as a device in the app. Annoyingly though, it won't control the device in anyway, and says the server is unresponsive in the app. Any ideas where I might have gone wrong? Appreciate the help.

ndg63276 commented 1 year ago

If you go to Lambda (eg https://eu-west-1.console.aws.amazon.com/lambda/home?region=eu-west-1#/functions depending on your region), go to your Sky box skill, then click on the "Test" tab.

Choose "Create New Event", give it a name like "ChangeChannel", set it as Private, and then put this into the JSON:

{
  "directive": {
    "endpoint": {
      "cookie": {},
      "endpointId": "skybox-001",
      "scope": {
        "token": "",
        "type": "BearerToken"
      }
    },
    "header": {
      "correlationToken": "",
      "messageId": "",
      "name": "ChangeChannel",
      "namespace": "Alexa.ChannelController",
      "payloadVersion": "3"
    },
    "payload": {
      "channel": {},
      "channelMetadata": {
        "name": "bbc one"
      }
    }
  }
}

Click "Save" then "Test". Does your Sky box change to BBC One? If you expand the Details section, are there any errors? What does the log output say?

edclark1994 commented 1 year ago

This is what the log output says:

/var/task/fuzzywuzzy/fuzz.py:35: UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning') START RequestId: ff5254e6-2cff-435d-aa0b-134e9355e225 Version: 5 [INFO]      2022-12-20T09:00:44.572Z      ff5254e6-2cff-435d-aa0b-134e9355e225      Directive: [INFO]      2022-12-20T09:00:44.573Z      ff5254e6-2cff-435d-aa0b-134e9355e225      { "directive": { "endpoint": { "cookie": {}, "endpointId": "skybox-001", "scope": { "token": "", "type": "BearerToken" } }, "header": { "correlationToken": "", "messageId": "", "name": "ChangeChannel", "namespace": "Alexa.ChannelController", "payloadVersion": "3" }, "payload": { "channel": {}, "channelMetadata": { "name": "bbc one" } } } } channel_request: bbc one plus_one_request: False normal 101 78 normal 115 82 2022-12-20T09:00:47.577Z ff5254e6-2cff-435d-aa0b-134e9355e225 Task timed out after 3.01 seconds

END RequestId: ff5254e6-2cff-435d-aa0b-134e9355e225 REPORT RequestId: ff5254e6-2cff-435d-aa0b-134e9355e225      Duration: 3005.27 ms    Billed Duration: 3000 ms      Memory Size: 128 MB     Max Memory Used: 46 MB  Init Duration: 365.18 ms      


From: Mark W @.> Sent: 16 December 2022 23:52 To: ndg63276/alexa-sky-hd @.> Cc: edclark1994 @.>; Author @.> Subject: Re: [ndg63276/alexa-sky-hd] Server Unresponsive (Issue #35)

If you go to Lambda (eg https://eu-west-1.console.aws.amazon.com/lambda/home?region=eu-west-1#/functions depending on your region), go to your Sky box skill, then click on the "Test" tab.

Choose "Create New Event", give it a name like "ChangeChannel", set it as Private, and then put this into the JSON:

{ "directive": { "endpoint": { "cookie": {}, "endpointId": "skybox-001", "scope": { "token": "", "type": "BearerToken" } }, "header": { "correlationToken": "", "messageId": "", "name": "ChangeChannel", "namespace": "Alexa.ChannelController", "payloadVersion": "3" }, "payload": { "channel": {}, "channelMetadata": { "name": "bbc one" } } } }

Click "Save" then "Test". Does your Sky box change to BBC One? If you expand the Details section, are there any errors? What does the log output say?

— Reply to this email directly, view it on GitHubhttps://github.com/ndg63276/alexa-sky-hd/issues/35#issuecomment-1355843856, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A4GHEMAGBYN35F45C3DL6R3WNT6EBANCNFSM6AAAAAATAZOB7E. You are receiving this because you authored the thread.Message ID: @.***>

edclark1994 commented 1 year ago

It also doesn't change the channel 🤬

ndg63276 commented 1 year ago

Ah ok, it's just timing out. If you are still on Lambda, go to the Configuration tab, click Edit, and set the timeout to 0 min 9 seconds, then click Save.

edclark1994 commented 1 year ago

Thanks for the speedy reply. I still get a timeout error:

`/var/task/fuzzywuzzy/fuzz.py:35: UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning') START RequestId: 51e2c766-f00e-42ca-8f18-ba97c7d58c6d Version: 6 [INFO] 2022-12-20T09:18:27.733Z 51e2c766-f00e-42ca-8f18-ba97c7d58c6d Directive: [INFO] 2022-12-20T09:18:27.733Z 51e2c766-f00e-42ca-8f18-ba97c7d58c6d { "directive": { "endpoint": { "cookie": {}, "endpointId": "skybox-001", "scope": { "token": "", "type": "BearerToken" } }, "header": { "correlationToken": "", "messageId": "", "name": "ChangeChannel", "namespace": "Alexa.ChannelController", "payloadVersion": "3" }, "payload": { "channel": {}, "channelMetadata": { "name": "bbc one" } } } } channel_request: bbc one plus_one_request: False normal 101 78 normal 115 82 2022-12-20T09:18:36.743Z 51e2c766-f00e-42ca-8f18-ba97c7d58c6d Task timed out after 9.01 seconds

END RequestId: 51e2c766-f00e-42ca-8f18-ba97c7d58c6d REPORT RequestId: 51e2c766-f00e-42ca-8f18-ba97c7d58c6d Duration: 9011.16 ms Billed Duration: 9000 ms Memory Size: 128 MB Max Memory Used: 46 MB Init Duration: 440.27 ms
`

ndg63276 commented 1 year ago

Ah ok, best guess then is the port number is wrong. Can you go to https://replit.com/@ndg63276/PortForwardingTester, click the play button, and then it should ask you for your dynamic DNS address, and then the port number. It should tell you if the port number is correct.

edclark1994 commented 1 year ago

I was playing around with the port last week, but reverted back to port 80 and get the success message in the tester: "I was able to connect to your port, so it looks like your settings are correct."

I still get the same error message in lambda though. It's really bugging me!

ndg63276 commented 1 year ago

Port 80 doesn't sound right, that is just the port that websites are on. (You can put google.com and port 80 into my tester, and it will 'work').

Try to forward external port 49160 to your sky box port 49160 (TCP only), then try my tester with 49160.

edclark1994 commented 1 year ago

Okay, that worked perfectly. Test passed and channel changed. All working as expected. THANK YOU!!

ndg63276 commented 1 year ago

Awesome, happy to help!