bklavet / Echo-skill-to-control-Directv

amazon echo skill that will control a networked Directv Receiver so that users can control Directv with their voice
18 stars 67 forks source link

LAMBDA Response: The remote endpoint could not be called, or the response it returned was invalid. #11

Closed hellohowareyougood closed 7 years ago

hellohowareyougood commented 7 years ago

Hello all and thank you for this. I am new to all of this and was able to set it up per the instructions and youtube video. When I test it in Alexa Skit Set, I get this message "The remote endpoint could not be called, or the response it returned was invalid"

I am aware that this means it cannot connect from an outside network. I have port forwarded the directv on the router with port 8080.

In the index file, I do not need to to put the local IP address for the directv box (10.0.1.5)? Any other suggestions would be great. Thank you!!

bklavet commented 7 years ago

Hello, the var local_ip needs to be your wan ip address. Best way to find this is to do a web search and google "what's my ip" and in the results it will show your wan ip. Give that a try and let me know if that does the trick.

If that doesn't work the next thing to sort out is if you can control the receiver from within your home network. On a computer connected to the same network as you receiver open a browser and enter this and hit enter. http://10.0.1.5:8080/remote/processKey?key=pause&hold=keyPress This should pause the receiver. If it does alter the ip address to your wan ip and try the command from another network than your directv. Report back if you are able to do this from both your local network and outside network.

hellohowareyougood commented 7 years ago

Thanks for the response.

http://10.0.1.5:8080/remote/processKey?key=pause&hold=keyPress works from within the network.

using the WAN IP does not work.

hellohowareyougood commented 7 years ago

I can access other devices using my public WAN (IP cameras, thermostat, etc). However, using port 8080, I cannot access any devices.

bklavet commented 7 years ago

double check that the receiver is set to "allow". on the receiver go to Menu->System Setup->Whole-Home->External Device. make sure allow is selected.

Then double check that port 8080 is forwarded, or throw 10.0.1.5 into your DMZ and try, if you cannot send the pause command from outside your network the skill will not work.

hellohowareyougood commented 7 years ago

I can now access it remotely. I checked the external device and it is set to allow.

However, when using service simulator, I am still getting ""The remote endpoint could not be called, or the response it returned was invalid"

Do I need to set port 8080 anywhere in the index file?

bklavet commented 7 years ago

the only lines that need to be modified is var local_ip = 'XXX.XXX.XXX.XXX'; and the APP ID port 8080 is in the index file so you don't need to add that.
when you put in a request in the simulator there are two boxes underneath, one shows what alexa is sending to lambda and the other is the response from lambda, what does the alexa box show when you type cnn in the simulator and hit enter?

Thanks

hellohowareyougood commented 7 years ago

that's what it says in the alexa box

hellohowareyougood commented 7 years ago

and thank you very much for your help thus far:)

bklavet commented 7 years ago

so that looks the way I would expect it to. As long as you can now send commands through the wan ip from a different network than the your local network the directv receiver is on. I would delete the lambda function and start over on the lambda side. make sure that both the Alexa folder and Index file are placed in a zipp file. It looks like there trouble is on the lambda side and not the alexa developer side.

hellohowareyougood commented 7 years ago

I deleted and readded. Still same issue. In LAMBA, when I run configure test event and then Alexa Smart Home Control, I get { "errorMessage": "Unexpected token ILLEGAL", "errorType": "SyntaxError", "stackTrace": [ "Object.Module._extensions..js (module.js:416:10)", "Module.load (module.js:343:32)", "Function.Module._load (module.js:300:12)", "Module.require (module.js:353:17)", "require (internal/module.js:12:17)" ] }

hellohowareyougood commented 7 years ago

got it working. THANK YOU!!!!!!!!!

bklavet commented 7 years ago

That's Great! Where was the problem?