datech / node-red-contrib-amazon-echo

Alexa controlled Node-Red nodes supporting latest Amazon Echo devices. NO Alexa Skills required. NO cloud dependencies.
MIT License
140 stars 42 forks source link

Still unable to discover new devices #144

Open gobigdave opened 3 years ago

gobigdave commented 3 years ago
SUMMARY

Recently got an Echo Dot g3. I have HA installed on a Pi, with NodeRed as an Add-On. My Pi is on my main LAN (vlan 1). My Echo Dot is on my IoT vlan (vlan 10). I have confirmed that both can talk to each other, and I successfully access the hub with:

curl http://192.168.1.xx/api/pi/lights

This works from both the LAN and IoT subnets.

When I ask Alexa to discover devices, nothing is ever found.

I have a Unifi USG, and multicast DNS and UPnP are both on.

ECHO DEVICES

Echo Dot 3rd generation

MODULE VERSION
CONFIGURATION
0.1.10
CONSOLE OUTPUT
None
STEPS TO REPRODUCE
  1. Create Amazon Echo Hub with all defaults
  2. Create "Office Lights" echo device and link to hub
  3. Deploy
  4. Verify that /api/pi/lights is returning Office Lights info from LAN and IoT
  5. "Alexa, discover devices" - try from Dot on the IoT and iOS app which is on the LAN.

My Office Lights device is never discovered.

EXPECTED RESULTS

Expected my Office Lights device to be discovered.

ACTUAL RESULTS

Alexa declares that no devices were found.

3ative commented 3 years ago

@gobigdave It should sort most of problems you're facing.

jmorris644 commented 3 years ago

Ok, to try and get this working here is what I have tried now. Still not working....

  1. I set up a new pi with the lite image
  2. I installed node red without sudo. When I did this I got two unable-to-write errors. One for /usr/lib/node_modules and the other for /usr/bin. I changes the security on both so it would install.
  3. I then installed this contrib.
  4. It did not work.
  5. I then ran the two ip table commands recommended in the troubleshooting section
sudo iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT
sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
  1. I then changed the port in the echo hub to 8080.

Still not discoverable.... I am out of thoughts to try.

edit: I then realized that I had to change the PREROUTING command to WLAN0 as my pi is wireless. Still not working. I am able to get a response from curl http://192.168.1.xx/api/pi/lights on both port 80 and port 8080. Still no go for discovery.

jmorris644 commented 3 years ago

I just installed node-red and this contrib on a windows machine and it WORKED!!!! So, it is something specific with the pi installations that is preventing it from working.

gobigdave commented 3 years ago

I wonder what the deal with the Pi is. I tried everything firewall related. Possible that the wired network was a problem? I didn’t get a chance to try the wireless network.

3ative commented 3 years ago

@jmorris644 @gobigdave

It's Defo a Pi thing and how it uses the network - I still think it's a Port 80 issue.

Like I said, I've never had any issues (that weren't easy to fix) on my rig

jmorris644 commented 3 years ago

Further testing:

Thinking the problem might be Debian I installed Ubuntu on a Pi. Same issue. Not discoverable...

At least Ubuntu provided the hub node with an error initially on port 80. Which I never got with Debian.

I then did the two iptables commands to accept port 80 and route it to 8080. Still no good.

I really don't want to run home network stuff on Windows. So I will keep trying...

Barabba11 commented 3 years ago

why not use a raspbian like all of us? You need absolutely to install NR from the "no root" user and map the 80 port from a >1024 port. Avoid use 2 network interfaces.

jmorris644 commented 3 years ago

why not use a raspbian like all of us? You need absolutely to install NR from the "no root" user and map the 80 port from a >1024 port. Avoid use 2 network interfaces.

Raspbien (Now Pi OS) is Debian. Same thing. Sorry for the confusion. Not working for me.

Barabba11 commented 3 years ago

how you can have response on both port 80 and port 8080?? It should be impossible. Node red should be installed without root priviledges, as I told, and it sould not be allowed to use port 80. If it does there is something wrong

jmorris644 commented 3 years ago

I understand and have followed those instructions. I can read the xml file through port 8080 when I do not use Sudo, and when I try Sudo I can read it through port 80. So normal http commands ae getting through. I think that there is an issue with IGMP and SSDP. Your contrib IS working fine on a Windows NR that I spun up.

Barabba11 commented 3 years ago

Again, I tell you, you don't have to run node red from root, you don't have to install it from root. PLease reinstall everything again and use Raspbian. Thank you for your efforts trying to solve this issue yourself, to all of us it works

gobigdave commented 3 years ago

I received a new NUC today, install Ubuntu server and setup a VirtualBox VM for a clean install of HassOS. I restored the snapshot of my original Pi installation so I got all my config back. HA works perfectly -- much snappier now as well. Again, this is HassOS, so it is a black box in the VM. I have zero control over what happens in the VM. HassOS is in full control. NodeRed is installed as an AddOn.

Still does not discover new devices. http://[my_ha_ip]/api/description.xml returns correctly.

Needless to say, I'm disappointed.

3ative commented 3 years ago

@gobigdave I'm shocked, from what I can tell, it sounds like you have [pretty much] the same setup as me now - and mine works without issue.

When state "NodeRed is installed as an AddOn." - is that within Ha or a separate install?

gobigdave commented 3 years ago

NodeRed is installed in HA from the AddOn store. I’m tempted to try it elsewhere just to see if it works.

randytsuch commented 3 years ago

I'm running NR v1.1.3, recently upgraded NR and node js. Running on separate pi3b, recently moved HA to a pi4. NR is installed from command line using the instructions from NR's site.
I'm using an io pin as an input to NR, so I left it on a dedicated pi to make that easier. I tried running sudo node-red to start, and if I do this, the echo node says its connected, but I can't discover any devices. With iptables commands, I could not even get the echo node connected.

But I tried running NR on a PC I have running 24/7, and discover devices works great there. I'm going to run all my alexa related routines over there.

I've been using node-red-contrib-alexa-home-skill. But it sometimes doesn't work (works maybe 75% of the time), and is cloud based so I'm happy I found that running on a PC works.

gobigdave commented 3 years ago

After trying on a PC, a Pi4, and a VM on a NUC without success, I gave up. I’m trying the HA Cloud, and it worked immediately. Discovered all my new devices instantly, and it works reliably. Worth the $60/year for me.

3ative commented 3 years ago

After making another NR install within Docker on my UnRaid server (as opposed to having the one within HA) I could only get Alexa nodes to work (discover devices) if I iptable-ed port 80 to to something else - I can't remember what port I used.

But that screwed the UnRaid web interface. Lluckily I didn't make the iptable permanent and a server reboot got me back in and I gave up! LOL

Next thing I'm gonna look at is why NR in HA allows traffic on Port 80 and thus allowing Alexa nodes to communicate out.

Barabba11 commented 3 years ago

You probably guys have lack of knownledge how protocol TCP/IP works and how to debug it. I'm reading who is trying to run NR as root (as been told here many times to don't do that) or who can't figure out how another service already running on 80.

gobigdave commented 3 years ago

Ok, barabba11, Whatever you say. I’ve been writing software for 30+ years, CTO of several companies. I understand how TCP/IP works. Tried running NR as root and not as root, neither worked. I know how to scan if a process is using port 80 (none were). Tried same VLAN, different VLAN — didn’t work. Tried a Pi, Ubuntu NUC, Windows PC, installed NR directly or with Docker for all — none worked. Removed all firewall and iptables rules — didn’t work.

Bottom line is that multicast and discovery work fine for all devices except this plugin on NR for me.

You need to back off your high horse. You’re not smarter than everyone else.

imightbelosthere commented 3 years ago

I'm at the same stage as most of you here and I'm still trying to make my Amazon Echo Gen 2 to work with the NR instance deployed on a docker container. I am tempted on deploying the HASS appliance on a VM and see if it behaves differently, but my guess is... I'll still find myself at the same stage as everyone else here.

My Amazon Echo can find the printer that's on a different vLAN and all, but can't seem to find the docker container with NR on the exact same subnet as it is... So I'm a bit lost here...

I've checked every single point raised before (running with Host Network, uid 0, multicast goes through just fine...) so I don't really know or understand what might be causing this other than... something I'm missing.

imightbelosthere commented 3 years ago

So in my case... for some reason... my Echo Gen 2 decided to switch over to my Guest WiFi instead of the IOT WiFi for some reason and that was why it couldn't get to the NR. That sorted, I can work with the Flow without any issue :)