vintlabs / fauxmoESP

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

fauxmoESP with WiFiManager requires a hard reset before Alexa Discovery #123

Closed ddweber456 closed 3 years ago

ddweber456 commented 3 years ago

@pvint, I have a strange issue going on with the use of WiFiManaager autoConnect (0.15.0) and using fauxmoESP (3.1.1). If my sketch successfully complete autoConnect and saves the WiFi credentials and any custom parameters, I can't get Alexa to discover the Fauxmo devices until after I do a hard reset. Is there something that autoConnect uses that the UDO doesn't like or the other way around?

pvint commented 3 years ago

That's pretty strange. Can you post your sketch?

ddweber456 commented 3 years ago

Here is the sketch.


sketch removed...
}```
pvint commented 3 years ago

Haven't had time to look at this yet... will be busy for the next couple days, but hopefully Monday I can have a look.

ddweber456 commented 3 years ago

@pvint Now that the discovery resolution is looking very good, maybe you can give your thoughts on this issue. I'm still not sure if the hard reset is a WiFiManager or FauxmoESP issue. I'm thinking it might have something to do with the UDP vs STA mode. Your help is greatly appreciated.

pvint commented 3 years ago

I've been able to reproduce the issue (noting the steps for my own reference):

  1. Upload sketch with Erase Flash "All Flash Contents"
  2. Set the AP in WiFiManager (which is really cool, BTW - I'll be using this in the future!)
  3. Once it is connected, I can ping the device, but "Discover" does not work.
  4. Reset the 8266, then discover works.

I'll dig into it a bit more.

ddweber456 commented 3 years ago

Set the AP in WiFiManager (which is really cool, BTW - I'll be using this in the future!)

Thanks, that make me feel good. The code needs to be updated to ArduinoJson library v 6. Right now the code uses the latest of v 5 (5.13.5).

pvint commented 3 years ago

Just looking at this a bit more, and I'm able to repeat it every time. I did a couple packet captures to try to see what's happening.

[Edit: The Amazon Echo device is 192.168.2.78 and the ESP8266 is 192.168.2.234]

From the first try after setting the AP in WiFiManager (when it fails to discover): Selection_103

And after resetting the ESP8266, when the discovery works: Selection_104

Note the line in red on the first one (where it fails), the ESP is sending a RST, ACK to the Amazon (which pretty much amounts to "bugger off, I'm closing the connection"), and because of this the Amazon device simply gives up.

Very strange, and not sure why yet.

ddweber456 commented 3 years ago

Thanks for doing the investigation. I was waiting to see what developed but have heard nothing yet. At least we know what's happening. Any ideas as to why?

ddweber456 commented 3 years ago

Paul, I just posted some more details on this issue, please see #1142 WiFiManager. Sorry I couldn't figure out how to give you the exact link. Thanks again for looking into this.

I'll try to figure out how to link this to the WiFiManager comments so others can easily follow the details. (not tonight) :-)

ddweber456 commented 3 years ago

I have been using this mod for several days and have not been able to get the Echo not to discover the new devices.

I would be interested in knowing if anyone else is still having issues getting Echo doing a consistent discovery. If so please post here.

marauderlabs commented 3 years ago

I face the same issue. For me it's worse. I can't get it to discover even with a reset. So how do I make this work? Any workarounds?

ddweber456 commented 3 years ago

@marauderlabs - Make sure you are using FauzmoESP v3.1.2 or greater. Via the phone app or web alexa.amazon.com delete any past discoveries of the ESP you are trying to discover and delete any past discoveries with the same Alexa device name.

GAndrews98 commented 3 years ago

I have the same issue. My Echo dot won't discover the ESP even with a reset. It used to work consistently a few months ago, but for the past few weeks I haven't been able to get it to discover the device at all.

pvint commented 3 years ago

@GAndrews98 Please make sure you are updated - versions below 3.1.2 will no longer work.

@ddweber456 Given that this seems to be fixed in the current master branch of ESP8266-Arduino (See issue referenced above), I'm closing this. Who knows when it will actually be released though ;)