kakopappa / arduino-esp8266-alexa-multiple-wemo-switch

multiple belkin wemos switch emulator using ESP8266
https://sinric.pro
MIT License
307 stars 197 forks source link

Alexa SmartHome skill - not finding #22

Closed sciencegirl100 closed 6 years ago

sciencegirl100 commented 7 years ago

Installed on my NodeMCU, went through Alexa app to add... nothing. So, turns out you need the smart home skill for the devices you want to add. The WeMo skill requires you to enter your wireless SSID and the WeMo device's MAC address. This breaks the compatibility with these wemo emulator projects unfortunately.

So, has anyone gotten past this? Is there a generic smarthome skill I'm unaware of?

P.S. I made sure all devices were on the same network and I even reset my Echo Dot. Nothing :/

dougstrickland commented 7 years ago

Have you tried coding your ssid in your script?
like:

const char ssid = "My_Network"; const char password = "XXXXXXXXXXXXXXXX";

sciencegirl100 commented 7 years ago

I set the SSID and WPA2 password, I was able to ping it from my PC as well as my phone from the same network that the Echo is on

Braandn commented 7 years ago

Same problem

MacSass commented 7 years ago

Same problem here - but only after my Alexa updated to the latest firmware. Before I could discover the ESP emulated devices with no problem - you could monitor the answer to the Alexa search request in the serial console ... Now, when I do a search, the ESP does not seem to "see" any broadcast request and does not respond - thus Alexa does not show any devices. I will try with the WeMo skill, but if that required a MAC address and it only works this way it would mean we would need "false" MAC adresses??? As said - until lately no skill was needed and Alexa found the emulated Wemos devices on the ESP8266 with no problem ...

MacSass commented 7 years ago

Update: Using my "old" Amazon Echo (1st generation) the devices are discovered with no skill required (no wemos skill activated). Devices can be controlled. The Echo FW version is 591448720. The second generation Echo does not seem to be able to control or discover the devices with the latest Fw that was released today. Looks like Amazon is really messing up big time with the second generation Echo (sound is way worse than with the old one - now this). Let´s see if Amazon fixes that or if the kill my old Echo for this by updating it´s FW as well ...

sciencegirl100 commented 7 years ago

maybe someone just needs to make a smart home skill for the ESP8266. I might give it a shot, but no guarantees.

arnowillig commented 6 years ago

@MacSass Same here, 2nd gen. Echo does not finde the devices, Echo FW version is 592452720. However, the echo DOES send HTTP requests (GET to /setup.xml and /eventservice.xml and POST to /upnp/control/basicevent1). POST body is this: <?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetBinaryState xmlns:u="urn:Belkin:service:basicevent:1"><BinaryState>1</BinaryState></u:GetBinaryState></s:Body></s:Envelope>

I think the echo tries to read the current state of the emulated WeMo switch, but then fails to enumerate the device. :-(

Anyone a solution yet? akw

kakopappa commented 6 years ago

hello @MacSass @arnowillig @sciencedude100 @Braandn

Thank you for your input guys

I have added GetBinaryState support to single switch version. Can you guys test it and let me know. I have an Eco at home. It does not send GetBinaryState

https://gist.github.com/kakopappa/02299a8ceec0aaaad3ea3bd7f2af8066

ma7gdp commented 6 years ago

I just tried the code you have on a "WemosD1 mini" and the echo dot 2nd gen is still reports "No new devices found". The serial on the WemosD1 is outputting the usual though:

Sending response to 192.168.1.74 Port : 50000 Response sent ! 192.168.1.74, port 50000 192.168.1.74, port 50000 ########## Responding to setup.xml ... ########

Sending :<?xml version="1.0"?>urn:Belkin:device:controllee:1boxBelkin International Inc.Socket3.1415Belkin Plugin Socket 1.0

uuid:Socket-1_0-38323636-4558-4dda-9188-cda0e61957d9221517K01017690urn:Belkin:service:basicevent:1urn:Belkin:serviceId:basicevent1/upnp/control/basicevent1/upnp/event/basicevent1/eventservice.xml ########## Responding to setup.xml ... ######## Sending :urn:Belkin:device:controllee:1boxBelkin International Inc.Socket3.1415Belkin Plugin Socket 1.0 uuid:Socket-1_0-38323636-4558-4dda-9188-cda0e61957d9221517K01017690urn:Belkin:service:basicevent:1urn:Belkin:serviceId:basicevent1/upnp/control/basicevent1/upnp/event/basicevent1/eventservice.xml
RootCNC commented 6 years ago

Same, doesn't work with Sonos One with Alexa built in- unable to discover devices =[ great project and keep up the good work! I will be following it!

kakopappa commented 6 years ago

@RootCNC can you try https://gist.github.com/kakopappa/02299a8ceec0aaaad3ea3bd7f2af8066

tommyfranke commented 6 years ago

@kakopappa, thank's for the great work. The above code works wonderful on my new Amazon Dot V2 with actual Firmware 595459620. My Nodemcu was found at once, you don't need the Wemo-Skill!!! Switching works fine.

Btw: It seems to me that the "eventservice.xml" never get called by Echo Dot, is it not needed?

ZoMiGo commented 6 years ago

hi i have Amazon Dot V2 with actual Firmware 595459620 my problem is alexa dont found any devices. i use https://gist.github.com/kakopappa/02299a8ceec0aaaad3ea3bd7f2af8066

arnowillig commented 6 years ago

hi, same here. I got an Amazon Echo gen.2. Even with the original WeMo plug the Amazon Echo does not find the hardware. However, I can see the device is queried. Even an "GetDeviceState" upnp POST message is sent by the Echo hardware. Strange, hm? I suppose this is a bug in the firmware. My Amazon Echo gen.1 works beautifully with the original WeMo plug as well with a simulated device.

Ciao, Arno

2017-12-06 13:02 GMT+01:00 Goran notifications@github.com:

hi i have Amazon Dot V2 with actual Firmware 595459620 my problem is alexa dont found any devices. i use https://gist.github.com/kakopappa/02299a8ceec0aaaad3ea3bd7f2af8066

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kakopappa/arduino-esp8266-alexa-multiple-wemo-switch/issues/22#issuecomment-349619580, or mute the thread https://github.com/notifications/unsubscribe-auth/AAXll3MuXiEUCkXcXZcSZ9D45Odig2j-ks5s9oJDgaJpZM4QPwo4 .

-- Arno Willig akw@thinkwiki.org ウィリグ・アーノ

RootCNC commented 6 years ago

@kakopappa I've just ran the software now and unfortunately it doesn't seem to work. =[

I have gone into the Alexa app to see the version number and its not listed where amazon says it should, I was hoping this might help debug the problem.

I can see in the serial terminal Alexa is sending something to the ESP8266 but still doesnt discover any devices. =[

The Sonos one with Alexa does with the Wemo insight version perfectly so not too sure.

sciencegirl100 commented 6 years ago

This still isn't found on my Alexa V2 (Firmware: 597464620)

MacSass commented 6 years ago

Thanks for your work on this Kakopappa - I will try this latest version during the week, although I do not have too much hope looking at past responses. I could provide some network trace if that helps if you let me know what you would need ...

MacSass commented 6 years ago

Hello, I have tried with the new script found here: [https://gist.github.com/kakopappa/02299a8ceec0aaaad3ea3bd7f2af8066] and can confirm that no devices are found with that script with the new generation Alexa devices (tried Echo v2 and Echo Plus). Both - the old and the new script - do not show any reaction at all when I do a "discover" in the Alexa app if there is only a new generation Alexa doing the search. Interesting fact: As soon as I have one "old" Alexa device (Echo Dot in my case) in the same network then both scripts do find devices with no problem. It looks like the new devices send out a different broadcast string, as I never see a response from the ESP with the new devices. I would have expected that this:

if(request.indexOf('M-SEARCH') > 0) {
        if(request.indexOf("urn:Belkin:device:**") > 0) {
            Serial.println("Responding to search request ...");
            respondToSearch();
        }
    }

get´s triggered - but it does not with the new device (ip ....28 in attached logs), only if an old device is in the network as well the ESP responds to the broadcast of the old device (ip ...24 in attached logs)

I have attached the output of the script for V2 device only and for combination of V2+V1 Alexa device.

I think the broadcast of the generations is different and the listening ESP never get´s triggered by the new device. Thus it seems to be needed to modify the trigger criteria? If I find the time I will see if I can do a network trace to check what the difference in query broadcast of the two generations is, that should clarify things.

Regards - MacSass

New script - Echo Plus and Echo Dot.txt New script - Echo Plus only.txt

MacSass commented 6 years ago

Hi, I did a network trace and think I´m getting a little bit clearer on the issue: While old devices send a SSDP broadcast containing "urn:Belkin:device:**" (which the ESP is looking for) the new devices send a SSDP broadcast with "upnp:rootdevice". Thus the ESP does never respond to the broadcast of the new Alexa devices.

When I do change the trigger that ESP is looking for to:

if(request.indexOf('M-SEARCH') > 0) { if(request.indexOf("upnp:rootdevice") > 0) { Serial.println("Responding to search request ..."); respondToSearch(); } }

and also change the response string, then I can get the new device to discover the ESP!

I did an initial test and the script then seems to work fine for me. I have attached my modified script below and would appreciate any feedback, as I might not really fully understand what I´m doing :-)

irdevkit-macsass.txt

Regards - MacSass

sciencegirl100 commented 6 years ago

It Works! Arduino Log However, the repository's code doesn't work. Not sure why. I ended up having to reset my Echo Dot V2 ( hold Mute & Vol - ). Make sure the echo and esp8266 are on the same wireless. I've had issues with them on the same network, but on different APs.

EDIT: Odd, I added in printing the request to terminal in the master branch and now it works.

ma7gdp commented 6 years ago

Is anyone else having an issue with getting this working? The serial output on my WemosD1mini shows activity when EchoDotV2 is discovering, but only ever shows "########## Responding to setup.xml ... ########" never the piece which @sciencedude100 shows in their Arduino log: "########## Responding to /upnp/control/basicevent1 ... ##########". It feels like it is almost there.

MacSass commented 6 years ago

Hello ma7gdp, yes - I´m still having issues. As long as I only have my Echo Plus (new gen) in the network, devices still do NOT get discovered. I see requests for UDP Belkin in the log and responses being sent, but devices do not show up. Also I do NOT see responses like "######### Responding to setup.xml ... ########".

As much as I can say this is caused by the fact that the response that get´s send currently is having: "USN: uuid:" + persistent_uuid + "::urn:Belkin:device:**\r\n" while the new gen devices expect a response of: "USN: uuid:" + persistent_uuid + "::upnp:rootdevice\r\n"

I will verify my assumption in a minute, but I´m pretty confident because as soon as I add a 1st gen device (echo dot) to the network the discovery works fine (because 1st gen device is happy with the response).

Doing some more testing right now ...

MacSass commented 6 years ago

Hi again, ok - I can confirm that this seems to be the root cause. Changing "USN: uuid:" + persistent_uuid + "::urn:Belkin:device:**\r\n" in switch.cpp to "USN: uuid:" + persistent_uuid + "::upnp:rootdevice\r\n" does allow to discover devices with 2nd generation Echos. Also it still works if only a 1st gen Echo is in the network - so this seems to be a solution as much as I can see.

After changing a devices state I do see continious responses to

Responding to /upnp/control/basicevent1 ...

about every 1 second. Not sure if those requests really happen or if this is another issue that should be looked at in a different thread / issue.

ma7gdp commented 6 years ago

Hey thanks @MacSass for taking a look. I only have Gen2 echo dot so cannot test the various combinations of scenarios with Gen1 etc. I can say though that even with the change to rootdevice in switch.cpp there are still no devices found by Alexa on the Gen2 dot. The serial output I get is as below (.97 is the Gen2 and the WemosD1mini is on .98). Still just "Responding to setup.xml" nothing else. Looks like the Gen2 is expecting a different response to the setup.xml request (assuming that the setup.xml request is Gen2 asking WemosD1mini to identify itself so Gen2 can list it via Alexa app).

btw... Thanks for taking the time. If only I had a Gen1 ... I probably would not have even noticed things weren't quite as they should be.

Udp multicast server started at 239.255.255.250:1900 WebServer started on port: 80 WebServer started on port: 81 Adding switches upnp broadcast responder Adding switch : office lights index : 0 Adding switch : kitchen lights index : 1 Got UDP Belkin Request..

Sending response to 192.168.1.97 Port : 50000 Response sent ! ########## Responding to setup.xml ... ########

Sending :<?xml version="1.0"?>urn:Belkin:device:controllee:1office lightsBelkin International Inc.Socket3.1415Belkin Plugin Socket 1.0

uuid:Socket-1_0-38323636-4558-4dda-9188-cda0e61957d9-80221517K01017690urn:Belkin:service:basicevent:1urn:Belkin:serviceId:basicevent1/upnp/control/basicevent1/upnp/event/basicevent1/eventservice.xml
MacSass commented 6 years ago

Hi ma7gdp, I can get devices discovered with both, my Echo Dot (current version - whatever that is) and my "new" Echo Plus, depending on what I put into the switch.cpp. But I still have some issues with devices switching if only one of them is on the network. Currently I´m not clear if devices are "linked" to a certain Echo if they are only linked to the account. So I need to do more testing or additional network traces to get clarity on this.

So there definitely seems still something to be going on in what the devices expect as response for discovery and switching. Fortunately the Christmas break is coming up and I should have some more time to look into this into more detail and do more testing. I hope to have some more information / data in the upcoming days ... hopefully even before Christmas ...

ma7gdp commented 6 years ago

Great. No more work this year for me so happy to help out with any testing or traces at my end. Tricky part is understanding whats in the echo code without the original/working devices to "sniff". Cheers again.

ma7gdp commented 6 years ago

Picked up on your comment regarding the accounts. After lots of various testing I found issues with having a "household" Amazon account. Saying "Alexa switch accounts" and then "Alexa discover devices" did the trick. Not only did the Echo find the devices but it also allowed me to trigger them and the serial output of the WemosD1mini showed the catch of the event. Bottom line .... I can now trigger a relay by saying "Alexa switch office lights on" etc.. Thanks all. To confirm I have 2x latest EchoDots only on my network.

jerrishjacob commented 6 years ago

Hi ma7gdp, may I request you to post the modified code for esp8266 nodemcu. Really appreciate your efforts to solve this issue.

ioanvapi commented 6 years ago

Hi. I have an Echo Dot 2nd gen. and loaded my nodemcu with code from main but it didn't work. I have started Wireshark and monitor the communication on UDP port 1900 and asked Alexa to discover devices. I got the upnp search message sent by my Echo and the message starts with "M-SEARCH". My device wasn't discovered because of the code:

if(request.indexOf('M-SEARCH') > 0) { 
....
  respondToSearch();
}

Because 'M-SEARCH' is at index 0 (in my case) the above if statement is never true and respondToSearch() is never invoked. I've changed the code to:

if(request.indexOf('M-SEARCH') >= 0) { 
....
  respondToSearch();
}

and my Echo has been discovered successfully.

This could be the fix for those with devices that are not discovered.

tonywye commented 6 years ago

I have just an Echo 2 and its now working for me when I make the changes above.Good stuff ! ToWy

hinkey247 commented 6 years ago

Hi tonywye - been spending days trying to get this to work as new to alexa 2nd gen - Please could you give full instructions to get this to work THANK YOU :)

tonywye commented 6 years ago

@hinkey247 this .ino is working on my ESP8266-12, when I discover devices it finds 1 device and "Alexa turn on light" makes GPIO4 go on. There was no need to enable the Wemo skill on Alexa. Alexa-test_Echo_2_add_wifi_info.ino.txt

hinkey247 commented 6 years ago

Thanks :) Ive been pulling my hair out trying to get this to work.

hinkey247 commented 6 years ago

ps could you send this file as .ino thanks

hinkey247 commented 6 years ago

HI tonywye - just got this working - A BIG THANK YOU :)

hotelafrica commented 6 years ago

I am still pulling my hair for this... I have echo 2nd gen. I've applied all the stuff commented above and also tried all the ino files above. Still nothing, Alexa can't discover the esp8266. Here's my current setup. Hopefully someone can give me a direction so I can sort this out... Q.Q Thanks in advance...

here's what I get from Serial monitor....: 192.168.1.55, port 58631 192.168.1.55, port 51710 192.168.1.55, port 51710 192.168.1.55, port 51710 192.168.1.55, port 51710 192.168.1.55, port 58631 192.168.1.57, port 52543 192.168.1.57, port 52543 192.168.1.57, port 52543 192.168.1.57, port 52543 192.168.1.55, port 58631 192.168.1.85, port 50000 192.168.1.85, port 50000 Responding to search request ...

Sending response to 192.168.1.85 Port : 50000 Response sent ! ########## Responding to setup.xml ... ########

Sending :<?xml version="1.0"?>urn:Belkin:device:controllee:1lightBelkin International Inc.Socket3.1415Belkin Plugin Socket 1.0

uuid:Socket-1_0-38323636-4558-4dda-9188-cda0e651b70f221517K01017690urn:Belkin:service:basicevent:1urn:Belkin:serviceId:basicevent1/upnp/control/basicevent1/upnp/event/basicevent1/eventservice.xml ########## Responding to eventservice.xml ... ######## ########## Responding to setup.xml ... ######## Sending :urn:Belkin:device:controllee:1lightBelkin International Inc.Socket3.1415Belkin Plugin Socket 1.0 uuid:Socket-1_0-38323636-4558-4dda-9188-cda0e651b70f221517K01017690urn:Belkin:service:basicevent:1urn:Belkin:serviceId:basicevent1/upnp/control/basicevent1/upnp/event/basicevent1/eventservice.xml 192.168.1.85, port 50000 192.168.1.85, port 50000 Responding to search request ... Sending response to 192.168.1.85 Port : 50000 Response sent ! ########## Responding to /upnp/control/basicevent1 ... ########## request:"1.0" encoding="utf-8"?>1 Got binary state request 192.168.1.85, port 50000 192.168.1.85, port 50000 Responding to search request ... Sending response to 192.168.1.85 Port : 50000 Response sent ! ########## Responding to /upnp/control/basicevent1 ... ########## request:"1.0" encoding="utf-8"?>1 Got binary state request 192.168.1.55, port 6641 Responding to search request ... Sending response to 192.168.1.55 Port : 6641 Response sent ! 192.168.1.55, port 6641 Responding to search request ... Sending response to 192.168.1.55 Port : 6641 Response sent !
hinkey247 commented 6 years ago

Hi mate I will email you later today and give you help I have now got my alexa 2nd gen to work thanks to this website.

Sent from Yahoo Mail on Android

On Sun, 31 Dec 2017 at 3:30, hotelafricanotifications@github.com wrote:
I am still pulling my hair for this... I have echo 2nd gen. I've made sure that all the stuff commented above and also tried all the ino files above. Still nothing, Alexa can't discover the it. Here's my current setup. Hopefully someone can give me a direction so I can sort this out... Q.Q Thanks in advance...

here's what I get from Serial monitor....: 192.168.1.55, port 58631 192.168.1.55, port 51710 192.168.1.55, port 51710 192.168.1.55, port 51710 192.168.1.55, port 51710 192.168.1.55, port 58631 192.168.1.57, port 52543 192.168.1.57, port 52543 192.168.1.57, port 52543 192.168.1.57, port 52543 192.168.1.55, port 58631 192.168.1.85, port 50000 192.168.1.85, port 50000 Responding to search request ...

Sending response to 192.168.1.85 Port : 50000 Response sent ! ########## Responding to setup.xml ... ########

Sending :urn:Belkin:device:controllee:1lightBelkin International Inc.Socket3.1415Belkin Plugin Socket 1.0 uuid:Socket-1_0-38323636-4558-4dda-9188-cda0e651b70f221517K01017690urn:Belkin:service:basicevent:1urn:Belkin:serviceId:basicevent1/upnp/control/basicevent1/upnp/event/basicevent1/eventservice.xml

########## Responding to eventservice.xml ... ########

########## Responding to setup.xml ... ########

Sending :urn:Belkin:device:controllee:1lightBelkin International Inc.Socket3.1415Belkin Plugin Socket 1.0 uuid:Socket-1_0-38323636-4558-4dda-9188-cda0e651b70f221517K01017690urn:Belkin:service:basicevent:1urn:Belkin:serviceId:basicevent1/upnp/control/basicevent1/upnp/event/basicevent1/eventservice.xml

192.168.1.85, port 50000 192.168.1.85, port 50000 Responding to search request ...

Sending response to 192.168.1.85 Port : 50000 Response sent ! ########## Responding to /upnp/control/basicevent1 ... ########## request:"1.0" encoding="utf-8"?>1</u:GetBinaryState></s:Body></s:Envelope> Got binary state request 192.168.1.85, port 50000 192.168.1.85, port 50000 Responding to search request ...

Sending response to 192.168.1.85 Port : 50000 Response sent ! ########## Responding to /upnp/control/basicevent1 ... ########## request:"1.0" encoding="utf-8"?>1</u:GetBinaryState></s:Body></s:Envelope> Got binary state request 192.168.1.55, port 6641 Responding to search request ...

Sending response to 192.168.1.55 Port : 6641 Response sent ! 192.168.1.55, port 6641 Responding to search request ...

Sending response to 192.168.1.55 Port : 6641 Response sent !

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

jerrishjacob commented 6 years ago

Thanks @tonywye @kakopappa for all the guidance. I have been able to get it working on my 2nd generation and nodemcu esp8266.

hkauroberoi commented 6 years ago

None of the code is working in my case. I have an existing ESP installed under a switchboard since last two months and it is working fine. However, with the new ESP boards that I purchased, Alexa can't discover and there's no activity in the serial console.... Used previously tested code and copied from here also but to no avail... What could be the issue??

hinkey247 commented 6 years ago

Hi hkauroberoi - could the problem be the alexa has the new firmware update? but cant understand why no activity in serial console - surely it must not be flashing right.

hkauroberoi commented 6 years ago

My bad. Im using the same alexa dot with which my previous esp is working. The code flashes perfectly and as im also using mqtt, the mqtt messages are being received normally. It is just alexa detection which shows no activity in the console. I suspect firmware as till last week on the same esp the detection worked. Would run packet capture to see what's going on.

MacSass commented 6 years ago

Hello, let me try to get some structure to this, because I think there are some confusing things and we (including myself) have not been very exact in our communication so far.

There are two "types" of Echo devices out there currently obviously - but they different types are NOT aligned to the different Echo "generations". So instead of speaking of "generation xy" let´s talk about "type 1" or "type 2".

The "type 1 = old style" devices have been working in the past. Currently in the field they are the Echo Dot generation 1 Echo Dot generation 2 Echo generation 1

The devices that came out end of this year are the "type 2" devices - namely Echo generation 2 Echo Plus

For Echo Show and Echo Spot I do not know what "type" they are, but I suspect they will be "type 2" as thy are very new or just releasing now. I´m not sure if Amazon will update the "type 1" devices to the new type by updating firmware in the future, so far my Echo Dot still works the "old style".

What is the difference between "type 1" and "type 2"? "Type 1" devices during discovery look for a response with ""urn:Belkin:device:**"" "Type 2" devices during device discovery look for a response with "upnp:rootdevice"

I´m currently looking into the fact if there is also a difference in what the devices send for a switch command - I think so.

I have a slightly modified code running here now that works with my "type 2 Echo Plus" for discovery and switching with no problem, but I think it does not work for my "type 1 Echo Dot Gen2" anymore. So we might have to make the code to react to both "types" which it does not right now if I´m not mistaken.

I´ll do some more testing as I have both "types" available and come back with final conclusion hoping that kakopappa will be able to fix it, so it works for all of us ...

Regards - MacSass

MacSass commented 6 years ago

@hotelafrica If you have a "Echo Gen 2" (the newer, smaller version of the Echo, but not Echo Dot) then this is a "type 2" device looking for a response with "upnp:rootdevice", while your log shows that your ESP sends the "type 1" response. It should work for you! if you change "USN: uuid:" + persistent_uuid + "::urn:Belkin:device:\r\n" in switch.cpp** to "USN: uuid:" + persistent_uuid + "::upnp:rootdevice\r\n" that´s what I did and what makes it working with my Echo Gen 2 ( = type 2 device).

As said - we might need code that "adapts" to the two types of devices out there right now to make it work for all at the same time.

Regards - MacSass

hinkey247 commented 6 years ago

Hi your right - I am a new comer to this system got a new alexa 2nd gen this Christmas and thought all the devices were the same ie languages / setup. I was under false information to watch youtube videos and hey presto it works, but it didn't. and trying to find answers why for 3/4 days was a nightmare only to stumble on this this forum to get the answers. after downloading the new .ino file it worked perfectly - this was on the understanding there was a difference between the dot and alexa 2nd gen plus firmware update. 

On Sunday, 31 December 2017, 12:49, MacSass <notifications@github.com> wrote:

Hello, let me try to get some structure to this, because I think there are some confusing things and we (including myself) have not been very exact in our communication so far.There are two "types" of Echo devices out there currently obviously - but they different types are NOT aligned to the different Echo "generations". So instead of speaking of "generation xy" let´s talk about "type 1" or "type 2".The "type 1 = old style" devices have been working in the past. Currently in the field they are the Echo Dot generation 1 Echo Dot generation 2 Echo generation 1The devices that came out end of this year are the "type 2" devices - namely Echo generation 2 Echo PlusFor Echo Show and Echo Spod I do not know what "type" they are, but I suspect they will be "type 2" as thy are very new or just releasing now. I´m not sure if Amazon will update the "type 1" devices to the new type by firmware in the future, so far my Echo Dot still works the "old style".What is the difference between "type 1" and "type 2"? "Type 1" devices during discovery look for a response with ""urn:Belkin:device:**"" "Type 2" devices during device discovery look for a response with "upnp:rootdevice"I´m currently looking into the fact if there is also a difference in what the devices send for a switch command - I think so.I have a slightly modified code running here now that works with my "type 2 Echo Plus" for discovery and switching with no problem, but I think it does not work for my "type 1 Echo Dot Gen2" anymore. So we might have to make the code to react to both "types" which it does not right now if I´m not mistaken.I´ll do some more testing as I have both "types" available and come back with final conclusion hoping that kakopappa will be able to fix it, so it works for all of us ...Regards - MacSass— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

sydknee commented 6 years ago

I'm having real problems with this and being new to all this too isn't helping.

I've got the Echo Plus (two dots on their way when they are back in stock)

I first tried someone else's adaptation of this to control 4 relays and couldn't find the devices, tried the source code from Kakopappa and still no joy, found this forum and made some changes to the source code and got it working (well couldn't fully test it as hadn't put anything on the connections). Deleted the items from Alexa and made the changes to the 4 relay version and nothing. Gave up at that point as had to go to work.

Luckily I had saved the changed versions.

Came back this morning and loaded up the amended source code and nothing.

Tried everything today, amending all the different versions of the code and I get various different outputs on the serial monitor. Sometimes nothing and sometimes loads of code.

It would be interesting to see if the real Belkin devices have the same issue but they are a bit overpriced to try.

hotelafrica commented 6 years ago

@MacSass Yes, i've tried that change previously and didn't work. Well, I did it again few minutes ago and here's the serial monitor result. it does get "::upnp:rootdevice\r\n" from Echo and response code is kicking off. I wasn't sure if it was the router that's blocking the multicast and tried to use different router, still no luck.

here's the serial monitor output...

⸮⸮-s⸮⸮ Connecting to WiFi Connecting ........ Connected to JJJJ_2.4GHz IP address: 192.168.1.89 Begin multicast .. Udp multicast server started at 239.255.255.250:1900 WebServer started on port: 80 WebServer started on port: 81 Adding switches upnp broadcast responder Adding switch : computer index : 0 Adding switch : kitchen lights index : 1 Got UDP Belkin Request..

Sending response to 192.168.1.85 Port : 50000 Response sent !

Sending response to 192.168.1.85 Port : 50000 Response sent ! Got UDP Belkin Request..

Sending response to 192.168.1.85 Port : 50000 Response sent !

Sending response to 192.168.1.85 Port : 50000 Response sent ! ########## Responding to setup.xml ... ########

Sending :<?xml version="1.0"?>urn:Belkin:device:controllee:1computerBelkin International Inc.Socket3.1415Belkin Plugin Socket 1.0

uuid:Socket-1_0-38323636-4558-4dda-9188-cda0e651b70f-80221517K01017690urn:Belkin:service:basicevent:1urn:Belkin:serviceId:basicevent1/upnp/control/basicevent1/upnp/event/basicevent1/eventservice.xml ########## Responding to setup.xml ... ######## Sending :urn:Belkin:device:controllee:1kitchen lightsBelkin International Inc.Socket3.1415Belkin Plugin Socket 1.0 uuid:Socket-1_0-38323636-4558-4dda-9188-cda0e651b70f-81221517K01017690urn:Belkin:service:basicevent:1urn:Belkin:serviceId:basicevent1/upnp/control/basicevent1/upnp/event/basicevent1/eventservice.xml ########## Responding to eventservice.xml ... ######## ########## Responding to eventservice.xml ... ######## Got UDP Belkin Request.. Sending response to 192.168.1.85 Port : 50000 Response sent ! Sending response to 192.168.1.85 Port : 50000 Response sent ! Got UDP Belkin Request.. Sending response to 192.168.1.85 Port : 50000 Response sent ! Sending response to 192.168.1.85 Port : 50000 Response sent ! ########## Responding to setup.xml ... ######## Sending :urn:Belkin:device:controllee:1computerBelkin International Inc.Socket3.1415Belkin Plugin Socket 1.0 uuid:Socket-1_0-38323636-4558-4dda-9188-cda0e651b70f-80221517K01017690urn:Belkin:service:basicevent:1urn:Belkin:serviceId:basicevent1/upnp/control/basicevent1/upnp/event/basicevent1/eventservice.xml ########## Responding to setup.xml ... ######## Sending :urn:Belkin:device:controllee:1kitchen lightsBelkin International Inc.Socket3.1415Belkin Plugin Socket 1.0 uuid:Socket-1_0-38323636-4558-4dda-9188-cda0e651b70f-81221517K01017690urn:Belkin:service:basicevent:1urn:Belkin:serviceId:basicevent1/upnp/control/basicevent1/upnp/event/basicevent1/eventservice.xml ########## Responding to /upnp/control/basicevent1 ... ########## request:"1.0" encoding="utf-8"?>1 Got binary state request Sending : 0 ########## Responding to /upnp/control/basicevent1 ... ########## request:"1.0" encoding="utf-8"?>1 Got binary state request Sending : 1 ########## Responding to /upnp/control/basicevent1 ... ########## request:"1.0" encoding="utf-8"?>1 Got binary state request Sending : 0 ########## Responding to /upnp/control/basicevent1 ... ########## request:"1.0" encoding="utf-8"?>1 Got binary state request Sending : 1
charliebrowndog commented 6 years ago

My Echo Gen 2 (late 2017) would not recognize my Mini D1 until I changed "urn:Belkin:device:**" to ---> "upnp:rootdevice" in the "fauxmoESP.h" file (line 37). Recompiled and it was recognized! Hope this helps someone else...

jerrishjacob commented 6 years ago

@tonywye , I used your link "Alexa-test_Echo_2_add_wifi_info.ino" and I have got the 2nd generation echo working with esp8266 nodemcu. Need some more help. 1) How do I control more than one relay on a single esp8266 nodemcu. 2) How do I introduce more than one esp8266 into the network. Thanks

hinkey247 commented 6 years ago

Hi just trying to sort this code out for myself to run 8 relays / going to use youtube 8 relay code with this one a bit of of a miss mash but if you bet me upload yours if not I will / going to mess around later today. Good luck. Martin Sent from Yahoo Mail on Android

On Mon, 1 Jan 2018 at 0:37, jerrishjacobnotifications@github.com wrote:
@tonywye , I used your link "Alexa-test_Echo_2_add_wifi_info.ino" and I have got the 2nd generation echo working with esp8266 nodemcu. Need some more help.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

hinkey247 commented 6 years ago

Ps at least we have the two systems talking to each other / that's a start. 😆

Sent from Yahoo Mail on Android

On Mon, 1 Jan 2018 at 1:12, MARTIN HINKSmartinhinks@btinternet.com wrote: Hi just trying to sort this code out for myself to run 8 relays / going to use youtube 8 relay code with this one a bit of of a miss mash but if you bet me upload yours if not I will / going to mess around later today. Good luck. Martin Sent from Yahoo Mail on Android

On Mon, 1 Jan 2018 at 0:37, jerrishjacobnotifications@github.com wrote:
@tonywye , I used your link "Alexa-test_Echo_2_add_wifi_info.ino" and I have got the 2nd generation echo working with esp8266 nodemcu. Need some more help.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.