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

Port forwarding is not working #62

Closed royatatl closed 6 years ago

royatatl commented 6 years ago

Hello guys,

I followed the instructions from https://github.com/bklavet/Echo-skill-to-control-Directv/issues/12 I found out that the port forwarding is not working. When I typed http://[local_ip of my direct TV]:8080/remote/processKey?key=pause&hold=keyPress in the internet browser, my tv actually paused. Then I typed http://192.168.1.254:8080/remote/processKey?key=pause&hold=keyPress in the browser, it shows "safari could not connect to the server". So I logged in my modem http://192.168.1.254, and allowed the port forwarding with port 8080.

untitled copy

Ideally, that should allow the port forwarding. But it did not help.

I telnet the ip of modem with port 8080, it was refused, while telnetting direct tv is connected.

untitled1

Any suggestion?

Thanks,

vmweaver commented 6 years ago

Typically NATing will create the network listener on your EXTERNAL (internet facing) interface, not the internal one (192.168.1.254). You should try telneting to port 8080 on your external address. If you don't know what it is, you can go to http://www.whatsmyip.org/ and it should tell you what it is.

The next part of the NAT is to make sure that this is actually passing traffic down your DirecTV. You can test this in the browser by going to http://[external address]:8080/info/getLocations {updated this comment}

If you connect, the browser should respond with some details about your setup.

On Sat, Jan 6, 2018 at 6:32 PM, royatatl notifications@github.com wrote:

Hello guys,

I followed the instructions from #12 https://github.com/bklavet/Echo-skill-to-control-Directv/issues/12 I found out that the port forwarding is not working. When I typed http://[local_ip of my direct TV]:8080/remote/processKey?key=pause&hold=keyPress in the internet browser, my tv actually paused. Then I typed http://192.168.1.254:8080/remote/processKey?key=pause& hold=keyPress in the browser, it shows "safari could not connect to the server". So I logged in my modem http://192.168.1.254, and allowed the port forwarding with port 8080.

[image: untitled copy] https://user-images.githubusercontent.com/35180944/34645304-b383f642-f317-11e7-8654-5ffb80229c38.jpg

Ideally, that should allow the port forwarding. But it did not help.

I telnet the ip of modem with port 8080, it was refused, while telnetting direct tv is connected.

[image: untitled1] https://user-images.githubusercontent.com/35180944/34645332-3c550f7e-f318-11e7-8b58-283ef5f425e6.jpeg

Any suggestion?

Thanks,

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bklavet/Echo-skill-to-control-Directv/issues/62, or mute the thread https://github.com/notifications/unsubscribe-auth/ACibPVHOzdmkNydfcfn3VLo4Jap2vLWqks5tIBCDgaJpZM4RVfX6 .

royatatl commented 6 years ago

@mawrew19 Thank you so much for your response. I tried https://[External IP]8080/remote/processKey?key=pause&hold=keyPress on my mobile phone through LTE. That actually worked.

Then I tested https:///info/getLocations. However, it did not get any response. Any suggestion?

royatatl commented 6 years ago

BTW, here are the test logs untitled2

bklavet commented 6 years ago

http://192.168.1.254/info/getLocations for local lan

replace with wan if you want to do it from outside your network.

vmweaver commented 6 years ago

@bklavet I don't believe this will work since the NAT isn't likely on the internal interface as well as the external. 192.168.1.254 is the inside address of the router, I believe.

@royatatl If the pause worked from your mobile on LTE, then your NAT config looks to be good. I should have been more specific. You can try "http://[externalAddress]:8080/info/getLocations"

The "index" file should include this "[external address]" on line 8.

Are there any more detailed messages on the errors you post? Was this when attempting to upload the project?

royatatl commented 6 years ago

@mawrew19 "http://[externalAddress]:8080/info/getLocations" on my phone finally works It shows { "locations": [{ "clientAddr": "0", "locationName": "LR" }], "status": { "code": 200, "commandResult": 0, "msg": "OK.", "query": "/info/getLocations" } }

Did you mean the format of IP address in the index file is like var local_ip = "xx.xx.xxx.xxx" instead of var local_ip = 'xx.xx.xxx.xxx' ?

Here are the detailed error messages after I configured a test event on https://console.aws.amazon.com

02:53:50 START RequestId: fd4e5bba-f355-11e7-8d83-67d313b0b20e Version: $LATEST START RequestId: fd4e5bba-f355-11e7-8d83-67d313b0b20e Version: $LATEST  02:53:50 Unable to import module 'index': Error at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) at Module.require (module.js:497:17) at require (internal/module.js:20:19) Unable to import module 'index': Error at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) at Module.require (module.js:497:17) at require (internal/module.js:20:19)  02:53:51 END RequestId: fd4e5bba-f355-11e7-8d83-67d313b0b20e END RequestId: fd4e5bba-f355-11e7-8d83-67d313b0b20e  02:53:51 REPORT RequestId: fd4e5bba-f355-11e7-8d83-67d313b0b20e Duration: 50.65 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 18 MB REPORT RequestId: fd4e5bba-f355-11e7-8d83-67d313b0b20e Duration: 50.65 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 18 MB

vmweaver commented 6 years ago

Good news on the NAT!

No. I was more clarifying which address you should put on line 8. This should be your EXTERNAL Address. The "index" file should be inside a ZIP file which is then uploaded. If you are attempting to upload just the index file, it will fail. This may be the error you are experiencing. @bklavet has some GREAT tutorial videos that you should review, if you haven't already.

royatatl commented 6 years ago

My bad. http://[externalAddress]:8080/info/getLocations works The index file zipped up with the AlexaSkill file as I did follow b Money's tutorial video. :(

vmweaver commented 6 years ago

Cool. So you get the error while uploading the zip file?

On Sat, Jan 6, 2018 at 9:54 PM, royatatl notifications@github.com wrote:

My bad. http://[externalAddress]:8080/info/getLocations works The index file zipped up with the AlexaSkill file as I did follow b Money's tutorial video. :(

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bklavet/Echo-skill-to-control-Directv/issues/62#issuecomment-355797358, or mute the thread https://github.com/notifications/unsubscribe-auth/ACibPRaNB099FpHHmT4tFKALA1JbTFzrks5tID_hgaJpZM4RVfX6 .

royatatl commented 6 years ago

No error when I upload and save it.

bklavet commented 6 years ago

Hey royatatl! What happens when you test from the service simulator in the developer site?

royatatl commented 6 years ago

I figured out the reason. When I zip the files, I actually zip the directory, not the content of the directory. I think it could a Mac thing.

It is working now!!!!! I am so glad. Thank you folks so much for your help and patience.

Have a wonderful weekend!