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

Process Exited Before Completing Request #70

Open bthonk opened 6 years ago

bthonk commented 6 years ago

Your help would be much appreciated!!!!! After two days of screwing around I'm hanging it up and either quitting or waiting for help. I've made it so far but just can't get over the last hurdle.

Problem: Lambda Site: {"errorMessage": "RequestId: 518a1006-f9a2-11e7-a9a2-edcb7db05812 Process exited before completing request"} AWS Site: When I "Test" the 'service request' works but the 'service response': "The remote endpoint could not be called, or the response it returned was invalid."

More clues: START RequestId: 518a1006-f9a2-11e7-a9a2-edcb7db05812 Version: $LATEST 2018-01-15T03:15:20.663Z 518a1006-f9a2-11e7-a9a2-edcb7db05812 session applicationId: amzn1.ask.skill.984832fd-ea28-403a-9f59-51fd81474dd2 2018-01-15T03:15:20.669Z 518a1006-f9a2-11e7-a9a2-edcb7db05812 dispatch intent = DirectvIntent 2018-01-15T03:15:20.780Z 518a1006-f9a2-11e7-a9a2-edcb7db05812 Error: connect ECONNREFUSED 208.81.159.2:8080 at Object.exports._errnoException (util.js:1018:11) at exports._exceptionWithHostPort (util.js:1041:20) at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1086:14) END RequestId: 518a1006-f9a2-11e7-a9a2-edcb7db05812 REPORT RequestId: 518a1006-f9a2-11e7-a9a2-edcb7db05812 Duration: 223.70 ms Billed Duration: 300 ms Memory Size: 128 MB Max Memory Used: 20 MB
RequestId: 518a1006-f9a2-11e7-a9a2-edcb7db05812 Process exited before completing request

Based on everything I've read it would appear that I've not properly forwarded my port. I've watched numerous videos, read more about port forwarding than I care to mention but can't figure out my problem.

Port Forwarding info: Directv HR44: This is the info found in the settings Server IP: Subnet Mask:
Default Gateway:
DNS:
Mac Address: Link-Local:

Router: I'm using Netgear Genie Server Name: Protocol: External Port Range: Internal IP Address:

I would be so grateful if you could tell me what the heck I'm doing wrong!!!!!!!!!!!!!!!

vmweaver commented 6 years ago

@bthonk Have you looked at this post? https://github.com/bklavet/Echo-skill-to-control-Directv/issues/12

I don't see any info in the details you posted about your settings.

For the NetGear Genie, it looks like this is a fairly good guide for setting up the port forwarding. https://kb.netgear.com/23416/Port-Forwarding-to-an-IP-camera-on-a-NETGEAR-genie-router

Once you have the port forwarding working, please run through the various validation steps in the first link from above.

It is possible that your ISP blocks inbound connections. We have certainly seen this before. Who is your service provide?
How are you getting your external IP Address? Are you doing it from a phone or a laptop?

bthonk commented 6 years ago

Thanks a bunch for the info...unfortunately I'm still drowning but I think I'm getting closer. I went to the link above for the Netgear genie and mine isn't the same. When it says to click "security" there is no "firewall rules". where it appears most of the magic happens. I've got a Netgear Genie R6400. The security tab options: Parental Controls, Access Control, Block Sites, Block Services, Schedule and Email.

I do have a tab under Advanced/Advanced called "Port Forwarding/Port Triggering". I was able to follow most of the setup you sent me by clicking on this tab (assuming that mine is either an older/newer router) and I can set protocol to TCP/UDP and set the "External Port Range" to 8080-8080.

After going through my router I cannot find my WAN Address. I see it when I go to "MyIPAddress". I noticed that my router "get's dynamically from ISP" and I think I saw on a video that I need to be "Use Static IP Address". Could you confirm? I believe my current setup means that my IP Address can change.

I also stumbled across an area in the router that has a "DMZ" option. It states, "Default DMZ Server" and the box is NOT checked. I recall you mentioning something about DMZ.

Sorry for all the questions.

bklavet commented 6 years ago

Hello bthonk! this will work with dynamic. dynamic means it will change from time to time, and when this happens the wan will be updated in the index file that is uploaded to lambda.
have you confirmed the steps in #12 ? are you able to control the dtv receiver from your browser? is so, then use the wan ip you get from goggleing "whats my ip" and then see if you can control the receiver from outside your network.

vmweaver commented 6 years ago

I will say, though, that many routers will support Dynamic DNS through certain providers. (Dyn, No-IP, etc.). If that is the case, you can often get a free/basic account with those services (mine is No-IP) and then configure your router with your account info. When my router detects a change in my address, it sends a request to my dynamic DNS provider to update my special fully-qualified-domain-name (FQDN). I chose this FQDN at the time I setup my account. Now I can just add that FQDN to my Lambda Index file as my "endpoint". When my IP changes, I don't do anything and things just get updated.

There are certainly other ways to solve this if your router doesn't support dynamic DNS, but that's for another day (maybe an add-on to my Securing DTV write up with RPi)

bklavet commented 6 years ago

mawrew19 you got me thinking. I installed the no-ip duc client on the same pi zero w that is running your enhancement and it all seems to be working. Here is the link I found on how to do it.
http://sizious.com/2017/04/30/how-to-properly-install-no-ip-dynamic-update-client-duc-under-raspbian/

my modem supports dynamic dns but only with dyndns and that looks like 7 bucks a month... and i'm the cheapest person i know!

vmweaver commented 6 years ago

Awesome and nice tweak. My router supports the free, no-ip dynamic DNS service, but you have to "renew" it every month. Kind of a pain, but I am cheap too! ;-) I click links all day long for FREE, what is one more click every month to save $7?

On Tue, Jan 16, 2018 at 9:20 PM, B money notifications@github.com wrote:

mawrew19 you got me thinking. I installed the no-ip duc client on the same pi zero w that is running your enhancement and it all seems to be working. Here is the link I found on how to do it. http://sizious.com/2017/04/30/how-to-properly-install-no-ip- dynamic-update-client-duc-under-raspbian/

my modem supports dynamic dns but only with dyndns and that looks like 7 bucks a month... and i'm the cheapest person i know!

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

bklavet commented 6 years ago

agr$$d

I just realized i'm taking this thread off topic, what alterations did you make to the voice guide to make it work with no-ip? I just tried to get it rolling and i believe i have the auth screwed up in the var method.

how do you have yours looking? single quotes or doubles?

vmweaver commented 6 years ago

Updated my implementation guide with some of the details you provided for Dynamic DNS. Thanks!

bthonk commented 6 years ago

bklavet - sorry for the delayed response...rough work week. I'm back and hoping I can get this thing working this weekend!!

If I type in: WAN IP Address, colon, Port # Example - 111.111.111.1.1:8080 I get nothing.

I think everyone is working at about 4 or 5 levels higher than I am so it's assumed that I understand the basics and I think that's where I'm getting screwed up. Is there a report, screenshot (Is there a way to post images on this post??) or anything I can provide you to help figure out what I'm doing wrong? I feel pretty confident that I followed the original instructions correctly and that my problem is with the router setup. I don't know for sure but my gut tells me router.

If you're able to get me set up then I'd strongly suggest that you start some kind of business working on issues like this.

vmweaver commented 6 years ago

I was just working with Marcus on his and some ISPs and Routers prevent "hairpinning", where you are trying to access your own external IP address. You may try from a mobile phone on your wireless carrier (not connected to your wifi) and go to http://www.xxx.yyy.zzz:8080/tv/getTuned
If successful, you should see some formatted text telling you what you are watching.

Just going to http://[address]:8080 won't do anything, you will need the bits after it.

{EDIT} .......I just tried this and I get:

{"status": { "code": 403, "commandResult": 1, "msg": "Forbidden.", "query": "/" }}

bthonk commented 6 years ago

Thanks Ma, I typed in my IP address and tried from my cell phone and get the message "This site can't be reached". I typed in: http://www.www.xxx.yyy.zzz:8080/tv/getTuned - is this correct?

vmweaver commented 6 years ago

I see where my previous recommendation would have caused confusion. From a web browser, go to http://www.whatsmyip.org/ At the top you will see something like this: Your IP Address is 124.215.34.129 Your numbers/address will be different but write down whatever that comes back as. From your phone go to http://124.215.34.129:8080/tv/getTuned, but replace the "124.215.34.129" with the address you wrote down.

bthonk commented 6 years ago

Sorry mawrew, still get a "This site can't be reached" message. The message also states, "XXX.XX.XXX.X refused to connect". The last message on the page states, "ERR_CONNECTION_REFUSED.

X'S ABOVE ARE IN PLACE OF MY ACTUAL IP ADDRESS. I TYPED IN THE ADDRESS ABOVE EXACTLY AS YOU TYPED IT (I USED MY OWN IP ADDRESS).

If I'm not able to log into my TV does that help you to know where to focus? I'm not sure if you caught the exchange above between bklavet and me but I'm suspicious that my router isn't set up correctly or that it's blocking traffic or something. I also have Kaspersky. When I first started this I disabled it for 10 minutes back when I'd just finished bklavet's youtube video in hopes that it was an anti virus software/firewall issue. As I mentioned, I only disabled Kaspersky that one time so let me know if you think that may be my problem as well.

Really appreciate all the help!!!!!

bklavet commented 6 years ago

Hello bthonk Does the pause command work within your local network? if the ip to the dtv receiver is 192.168.0.2... does this work http://192.168.0.2:8080/info/getLocations from the browser. you will need to change 192.168.0.2 to the dtv's ip.

image

vmweaver commented 6 years ago

It would also be helpful to know what make/model of the router you have and who your internet provider is. Definitely sounds like something is blocked externally. "CONNECTION REFUSED" means it made the attempt and something said "Nope, not gonna do it!"
Thanks for the perseverance and patience as we work this out.

bthonk commented 6 years ago

Okay, I've got some more info for you...and I apologize I'm not able to get it to you quicker!! I did you what said above (pause command) and I got the following message:

{"status": { "code": 404, "commandResult": 1, "msg": "Not Found.Resource not found.", "query": "/info/getlocations" }}

Also, my internet provider is "Air to Air". I live in Idaho (just moved a year ago) and found out very quickly that Idaho is far behind on the technology front (personally I don't mind). I'm surrounded by mountains and they've got a technology here called "Microwave". I have a dish on the side of my house and it points to a tower on the top of a mountain. The tower and my dish can't have anything blocking the line of site. It actually works great (better than satellite!!!). Maximum speed is 30 Mbps. Coming from Seattle where the speeds are 4 times this amount I thought we would be in trouble. To my surprise I've not noticed any difference. Anyway, that's the story on my internet service.

Thanks for your help!!!

bthonk commented 6 years ago

I forgot to tell you about my router. Last night I just bought a new router. It's the Orbi AC2200. I bought it for a different reason and found out I don't need it. My old router is a Netgear R6400. I was planning on keeping the Orbi, however, if I'm able to get the Alexa working with DTV. The Orbi user interface is much better so I'm hoping to try some more things that you guys send my way and if it works I'm keeping it.

vmweaver commented 6 years ago

@bthonk Thanks for the great info. I did want to point out that the DirecTV API is case sensitive. Because of that, it won't recognize the call you made with "getlocation" as it needs to be "getLocations" (with a capital "L"). Give that a try and let us know if you get something different back. Amazing how we "think" we need so much speed, but in reality, never use it. 30Mbps is a very respectable speed. I will dig into the 2 routers and the service provider to see if I can identify any potential issues or to refine guidance on getting your port-forwarding to work.

bthonk commented 6 years ago

Hey, I think we may be getting somewhere!!! Here's what I get now:

{ "locations": [{ "clientAddr": "0", "locationName": "LR" }], "status": { "code": 200, "commandResult": 0, "msg": "OK.", "query": "/info/getLocations" } }

bklavet commented 6 years ago

Woo hoo!

vmweaver commented 6 years ago

Just to be clear, you were using your local address to make that call, right? I was looking at your net gear router and it should be fine for setting up the port forwarding. I could not find info about your Internet provider, though. Do you have a website you could point me at?

bthonk commented 6 years ago

Sure, it's www.air-pipe.com

I used my local address for my DVR. Does this mean it's working?

vmweaver commented 6 years ago

Not yet, but it was important to confirm this. Can you maybe take some screenshots of your port forwarding configuration and share that?

bthonk commented 6 years ago

Yes but I've not been able to figure out how to upload to this text box

bthonk commented 6 years ago

capture

This is what happens when I post a screen shot. is there a format I should be using? (PDF)

bthonk commented 6 years ago

Nevermind....it was a bunch of gibberish until I posted. So this is a screen shot of my Port Forwarding...

bthonk commented 6 years ago

Another pic...same screen but I captured all of the options on the left side menu.

capture

vmweaver commented 6 years ago

Great. So you will want to click "add custom service", It will ask you for a name, so just put in DTV or something. Service type will be tcp/udp External starting port: 8080 External ending port: 8080 I think you will have a box checked that says use same port for internal... make sure that is checked. Internal ip address: your directvs ip address (the one you tested from earlier ) Then click apply. You should see the new rule in the list. Take another screen shot after and post.

bthonk commented 6 years ago

Okay, I see the new rule in the list!!

capture

vmweaver commented 6 years ago

Now do the same test you did previously ( /tv/getLocations ) but with your external Internet ip address. This should be similar to what you did before when you got the "request rejected" message.

bthonk commented 6 years ago

Just when we were getting momentum!!! To make sure I used the correct IP address, I went to "myipaddress" and used that IP Address. Is that correct? If so, this is what I got:

capture

vmweaver commented 6 years ago

Hmm. Yeah that's right... do you see an address in any of the administration parts of your router?

bthonk commented 6 years ago

There's an IP address for the "internet port"

bthonk commented 6 years ago

That's the only other IP address I'm seeing in the administration section

vmweaver commented 6 years ago

Hmm. Will need to dig some more. You may be getting double nated. Will need to pick this up tomorrow. Great progress so far.

bthonk commented 6 years ago

Okay, thanks much!!

vmweaver commented 6 years ago

Is the screen shot you posted of the "left side" the complete list? Looking at the Orbi Manual: Click the ADVANCED tab.

In the Internet Port pane, click the Connection Status button.

The Connection Status window displays the following information: • IP Address. The IP address that is assigned to the router. • Subnet Mask. The subnet mask that is assigned to the router. • Default Gateway. The IP address for the default gateway that the router communicates with.

Do you see any of this? If so, does the IP Address listed match whatever address myipaddress gave you?

bklavet commented 6 years ago

Is the orbi serving as a router or an AP? Another question, Is this plugged into a modem from the Phone/Cable company? If it is, what type of modem is that?

vmweaver commented 6 years ago

@bklavet good points. I am not that familiar with the Canopy/Cambrium microwave technology being used to get @bthonk's internet service. I assume router instead of AP and thought maybe double-NAT which would make things challenging.

bthonk commented 6 years ago

It's used as the router. Line comes in from the satellite dish on roof and into my router. Not sure what double-NAT is. Are you guys thinking it's something to do with Air-Pipe (Canopy/Cambrium microwave service provider)

Yes, the screenshot of the "left side" is the full, complete menu of options.

The IP address listed on "My IP Address" isn't even close to what I'm seeing in the "Internet Port" screen of my router.

vmweaver commented 6 years ago

Interesting.
So can you try using the address that shows on your "Internet Port" screen in your testing? (http://{address from internet port screen}:8080/tv/getTuned) Can you share the first 2 numbers of that "internet port" address? This is a good description of double-NAT: https://kb.netgear.com/30186/What-is-Double-NAT Another link discussing Carrier Grade NAT: https://en.wikipedia.org/wiki/Carrier-grade_NAT

If this is occurring, then you may need to contact Air-Pipe to see what options are available.

bthonk commented 6 years ago

the internet port IP starts with 172.28 and the my IP starts with 208.81.

This is what i get when the other IP address is used:

{"status": { "code": 403, "commandResult": 1, "msg": "Forbidden.Command not allowed.", "query": "/tv/getTuned" }}

vmweaver commented 6 years ago

I am afraid it isn't good news. 172.28.XXX.YYY is part of RFC 1918 (https://tools.ietf.org/html/rfc1918) and is considered "private space", similar to 192.168.xxx.yyy .

So, it appears that your ISP is doing some type of carrier-grade-NAT or some other type of double-NAT.

You may want to reach out to their support team and ask them if there is anything they can do to get this traffic to your router. I don't think there is anything that you can do to resolve this without them. They may have some solutions since this is becoming more and more a normal thing with IOT and gaming.

Sorry.

bklavet commented 6 years ago

I you aren't able to get your provider to get port 8080 passed through, you could try an hue emulator on a raspberry pi. I did this approach at first. it keeps everything on your local lan. Then only bad thing is all the phrases are ON/OFF commands. example "turn CNN on, turn list on, etc. with the shef documentation on #12 and looking at the index files you could put together something that would work. This approach would require no lambda or developer portal, but would need a raspberry pi.

this was the emulator I was using before this https://github.com/armzilla/amazon-echo-ha-bridge

vmweaver commented 6 years ago

Or even a Harmony Hub (which I have for other things). I don't have Channel Name voice commands setup for that, but it does to all of my "universal remote" activities. I prefer the channel name since I never remember the channel numbers.

On Sat, Jan 27, 2018 at 5:02 PM, B money notifications@github.com wrote:

I you aren't able to get your provider to get port 8080 passed through, you could try an hue emulator won a raspberry pi. I did this approach at first. it keeps everything on your local lan. Then only bad thing is all the phrases are ON/OFF commands. example "turn CNN on, turn list on, etc. with the shef documentation on #12 https://github.com/bklavet/Echo-skill-to-control-Directv/issues/12 and looking at the index files you could put together something that would work. This approach would require no lambda or developer portal, but would need a raspberry pi.

this was the emulator I was using before this https://github.com/armzilla/amazon-echo-ha-bridge

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

bthonk commented 6 years ago

Well at least I know I'm not completely losing my mind!!

Before I started down this road I purchased a Harmony Hub. I got it set up but couldn't figure out how to program commands for things like guide, menu, info, etc. The DTV remote isn't IR so the Hub can't 'learn' these commands. The Harmony Hub support sent instructions for a work around but I couldn't figure them out so started down the road I'm currently on.

Any chance you guys know how I can program the Harmony Hub to do these other commands?

vmweaver commented 6 years ago

Will dig into it. Should be fun to play with it this morning.

bthonk commented 6 years ago

One other question while you're working on the Harmony. Is it possible for me to use my old R6400 router as an "Extender" in the Orbi network? I've got the one satellite included with the Orbi so I'm sure this would be overkill but I've got a 5 acre lot and currently my WiFi will some days work to the edge of my property and some days won't. I'm thinking if I install the R6400 in the garage or in my shop (where ever it gets a good signal from the Orbi) I can drive to the store and maintain WiFi :) I've once again been doing a bunch of digging and everyone says it can be done but none of the sites match what I'm seeing on my screen. You guys have already done so much so don't feel like you have to do any work on this.

Thanks again!!

vmweaver commented 6 years ago

On your Wifi thing. The R6400 should be able to act as a Wifi "repeater". I think there is a config to do that, but not entirely sure. You may check out this: https://www.youtube.com/watch?v=6YhVzhESUy4 to give you some ideas. You also might check out the DD-WRT project. This is an opensource alternative firmware for many routers which really does unlock many capabilities.

vmweaver commented 6 years ago

@bthonk On the Harmony Hub, you CAN setup up to 50 channels to respond to "names". You can configure those in the app (I just found that). I have played a little bit with it, but not too much. Can you share the instructions that support sent you for setting these other things up?