vintlabs / fauxmoESP

Add voice control of your ESP32 and ESP8266 devices using Amazon Alexa
MIT License
379 stars 70 forks source link

No discovery of devices #149

Open chrisgimson opened 3 years ago

chrisgimson commented 3 years ago

Formally adding this as an issue after our discussion on Facebook forum.

  1. Using the example basic sketch exactly as written (of course with relevant wifi credentials) on a NodeMCU and then an ESP32-WROOM board
  2. No discovery of devices using Echo Dot Gen 2, Echo Plus Gen 1, Echo Gen 3, Iphone app and web app
  3. Tried ESP8266 Board Manager 2.4.2 and 2.7.4 - no difference
  4. Tried lwIP variants of V2 Lower Memory and V1.4 Higher Bandwidth - no difference
  5. All devices are on the same network
  6. Devices have a working of working fine with Alexa before the widely discussed breakdown mid last year
pvint commented 3 years ago

I just had a facepalm moment: On ESP8266 there is a limit of 3 devices (this does not seem to be a hard limit, but more of a general rule... with more than 3 devices there's an overflow when creating the reply packets, which needs more investigation).

Please remove all but one of the fauxmo.addDevice() lines and try again. If that works, you will likely find that you can use one two, or three, but not more.

Failing that, in fauxmoESP.h, uncomment the #define DEBUG_FAUXMO Serial line and retry and post the serial output.

Cheers Paul

chrisgimson commented 3 years ago

I did as you ask- limited to 3 devices with debug enabled. No change and debug showed the setup of the 3 devices but nothing else printed during and after attempted discovery apart from the heap statement

image

pvint commented 3 years ago

Dang - I was pretty hopeful there. Ready for a deeper dive?

In fauxmoESP.h, change the following #define's to true:

#ifndef DEBUG_FAUXMO_VERBOSE_TCP
#define DEBUG_FAUXMO_VERBOSE_TCP    false
#endif

#ifndef DEBUG_FAUXMO_VERBOSE_UDP
#define DEBUG_FAUXMO_VERBOSE_UDP    false
#endif

Also, for simpler debugging, make it only use one device.

Re-upload, clear the serial console, attempt another discovery, and then let's have a look at the serial output (there will be quite a lot)

chrisgimson commented 3 years ago

OK. Something very strange is going on - I enabled the verbose debugging as requested and reduced to one device- absolutely NO DEBUG information was printed beyond the boot up confirming only one device configured! I switched off my Norton 360 protection as a precaution and repeated discovery - NOTHING!

So the inference is that it is receiving nothing from Alexa - am I missing something here?!

I attach all my files so that you can see if I have missed something ..... fauxmoESP.TXT rename as fauxmoESP.h

fauxmoESPBasic-_Revised.TXT rename as fauxmoESPBasic-_Revised.ino

pvint commented 3 years ago

OK, that's still info though! I took a look at your files - they look fine.

The first thing this suggests to me is that your Alexa device is not in the same subnet as your ESP device. Are they connecting to the same WiFi router? Any VPN thing running on the router or anything?

chrisgimson commented 3 years ago

there is only one WiFi router in the house and is the same one that that allowed FauxMo discovery before the crash. I altered my file to print the full local connection details of the ESP8266 .... (they look good as far as I can tell) image

This is the ipconfig printout from my computer .... image

How do I establish the settings of the Echo connections?

There is a VPN feature on my recently installed Norton 360 but it is not turned on and as far as I know. Even if it was, it runs on the PC(?).

The router is provided by my local fiber supplier (Vodaphone) and I cannot access it so if you need me to look into that I will need to contact them ....

pvint commented 3 years ago

Hm. It sounds like your router isn't handling SSDP/UPNP broadcast traffic.

The VPN on your PC will not affect it, and as far as I know there's no direct way to read the IP settings of an Echo device.

I took a look at https://www.amazon.com/gp/help/customer/display.html?nodeId=201751350 and it pretty much says the same thing - check SSDP/UPNP settings on the router.

It's worth a try to log in to the router by going to http://10.0.0.254 - try logging in with admin/admin, and failing that, google the model of router and "default login".

I admit to being a bit at a loss as to how to do more diagnostics in Windows - if you happen to have a linux device you can do ngrep -d any -qWbyline '' port 1900 and retry discovery and see if you see any packets coming.

chrisgimson commented 3 years ago

Thanks for your help so far. I will have to contact my provider re the SSDP/UPNP settings as I am locked out of the router access. I will contact them and follow through and get back with any update. Again thanks so far. ... Chris

pvint commented 3 years ago

No worries - good luck!

chrisgimson commented 3 years ago

Paul - before I start the what can be painful discussion with my provider tech support (based on experience! :) ) I tries an "experiment" with my already existing Hue lamp sub-system. I introduced a brand new HUE lamp - my Echo Plus could not discover it BUT when I added it to my Hue Hub and Hue App set up, Echo discovered it immediately. Now my logic tells me that the FAUXMO is simulating what the Hue Hub is doing so there cannot be anything wrong with my WiFi router settings given that the Hue hub was clearly visible. Is there a flaw in my thinking?

pvint commented 3 years ago

I've been thinking about this over the past day, and I wish I had a good explanation.

I'm guessing (note the emphasis!) that maybe when you added the new bulb to the hub the discovery process is different. It would be interesting to delete all of the Hue devices/hub from Alexa and retry, but I suspect that you may not want to try that! (Potential for your Hue stuff to not work anymore).

If you're feeling adventurous, try installing Wireshark and do a packet capture with the filter udp.dstport == 1900 to capture SSDP and try "Alexa discover".

chrisgimson commented 3 years ago

I will certainly look into the Wireshark app and see what I can drum up.

Since not every one has an Echo Plus or even a Hue Hub (if they do not have any other Hue lights) so FauxMo must surely try to emulate the Hub protocol rather than anything to do with the bulb itself so I would expect the discovery process to be the same between Alexa+Hub and Alexa+FauxMo (?). It just seems so strange that you can have a working system and I have absolutely nothing! I may have to ask your advice re Wireshark when I get it installed but otherwise .... "I'll be back ... " I'll also try disconnecting the Hue Hub to check that it is not "interfering" with FauxMo.

ddweber456 commented 3 years ago

@chrisgimson I think I may have a client with the same issues with SSDP/UPnP. Have you been able to resolve your issue yet?

chrisgimson commented 3 years ago

@chrisgimson I think I may have a client with the same issues with SSDP/UPnP. Have you been able to resolve your issue yet?

Afraid not - I was not able to get the Wireshark app running so am no wiser. Given that my Hue lamp system is still working 100% on the same network, I am not convinced it is (as suggested) my router not allowing SSDP/UPnP

zia7474 commented 3 years ago

Hi Everyone, I am using the ESP WROOM 32 Board and facing the same issue that Alexa does not discover devices. After reading the above discussion, I reduced the number of virtual devices to one. But nothing happened.

I have enabled the Debug prints and it shows me something. But I don't know how to interrupt this.
I am attaching my debug prints. Please help me, how to proceed further ? Thanks. Debug_Prints.txt

b1gmans commented 3 years ago

Guys - I had exact same issue - no discovery. First you need to upgrade to V3.3 release. Second. Try with only one or two devices. If your echo or whatever wont discover the device, go in via the web page - e.g. for me alexa.amazon.co.uk - and under smart home, devices - click the discover button - this works far better for me.

Also see my comments on issue #166 - the extra info that fauxmo now sends when discovery is happening is restricting how many devices you can have, I have fixed that myself for now.

riban-bw commented 2 years ago

As mentioned in other similar tickets, if the device is not receiving the discovery message then the issue is likely to be on the network. The router holds a table of multicast group members. If this table is full or inaccurate then the router may not send messages to the device. Repowering the router may help this and maybe reducing the quantity of UPNP devices on the network (temporarily).