Giter VIP home page Giter VIP logo

Comments (119)

MacSass avatar MacSass commented on August 9, 2024 2

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 ...

from arduino-esp8266-alexa-multiple-wemo-switch.

MacSass avatar MacSass commented on August 9, 2024 2

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

from arduino-esp8266-alexa-multiple-wemo-switch.

MacSass avatar MacSass commented on August 9, 2024 2

Happy new year everybody, new year - new testing :-)
and I can confirm that I have working code for all types of devices!

I have done some extensive testing today with 3 different Echo devices:
Echo Dot Gen 2 (FW 597464620) - Type 1
Echo Generation 2 (FW 595530420)- Type 2
Echo Plus - Type 2
Please read my post above on "type 1" vs. "type 2" devices.

Please also take note that I´m only referring to the code listed here in the MASTER branch from "kakopappa" - not any other code that was referenced before (e.g. those that have files like "fauxwemos", etc.).
I´m referring to https://github.com/kakopappa/arduino-esp8266-alexa-multiple-wemo-switch only!

The code as it is right now is working fine for type 1 devices with no modification. Discovery of devices as well as switching works fine!
For type 2 the code currently does NOT work, it does not show any devices after discovery. Symptom is that in serial monitor you only get:

Sending response to 192.168.1.28
Port : 50000
Response sent !

while for type 1 devices you additonally see this during discovery:

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

The reason is that type 2 devices look for a response of _urn:Belkin:device:_** and if that does not happen they do not query for the services ... thus ESP never responds.

I can make the code work with type 1 and type 2 devices by making the following change that I already mentioned in a previous post. Change one line close to the bottom of switch.cpp from:
"USN: uuid:" + persistent_uuid + "::urn:Belkin:device:**\r\n"
to be:
"USN: uuid:" + persistent_uuid + "::upnp:rootdevice\r\n"

After this your code should work with all types of Echo devices and discovery as well as switching should work fine. This is working in my home right now. I have ran several discoveries with only type 1 or only type 2 devices on the network with consistent results.

As I am not experienced in GIT usage I´m not sure how to propose that change for testing to Kakopappa, thus I will contact him directly to see what he thinks. Maybe he can open a temporary branch that you guys can test to confirm my finding.

Regards - MacSass

PS: As Amazon Echo does use UPNP discovery with UDP broadcasts obviously you need to have UPNP enabled in your router and not eventually blocked by it!

from arduino-esp8266-alexa-multiple-wemo-switch.

kakopappa avatar kakopappa commented on August 9, 2024 1

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

from arduino-esp8266-alexa-multiple-wemo-switch.

ma7gdp avatar ma7gdp commented on August 9, 2024 1

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.

from arduino-esp8266-alexa-multiple-wemo-switch.

tonywye avatar tonywye commented on August 9, 2024 1

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

from arduino-esp8266-alexa-multiple-wemo-switch.

MacSass avatar MacSass commented on August 9, 2024 1

@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

from arduino-esp8266-alexa-multiple-wemo-switch.

kakopappa avatar kakopappa commented on August 9, 2024 1

Hello guys.

Past few weeks I have been working on a smart home skill and a website which allows you add development boards such as WEMOS D1 to Alexa eco system without emulating as a belkin switch. Mainly, because some people have issues in the UDP broadcast and different Alexa devices such as ECO, DOT has different XML formats and this is logic is quite difficult to code. So, I belive moving forward using the smart home skill is the right thing to do;

So, I would like to invite everyone to give it a try.

  1. Goto sinric.com

  2. Create an account

  3. Use the API key displayed on the home screen to connect your WEMOS D1 to sinric. Here is the code . Just replace the API KEY
    https://github.com/kakopappa/sinric/blob/master/arduino_examples/switch_example.ino

  4. Install smart home skill from
    https://www.amazon.com/dp/B078RGYWQQ/ref=syps?s=digital-skills&ie=UTF8&qid=1515150398&sr=1-18&refinements=p_n_date%3A14284925011

4.1 Link, eneter you login details to sinric.com

  1. Discover.

  2. Rate the Skill so other people can easily find it!

You can turn on/off same like emulating a belkin device.

No need to say like Alexa ask sinric to turn on bedroom lights. Simple as a Alexa turn on bedroom lights.

If you have any issue or comments report it here;
https://github.com/kakopappa/sinric

Thanks

from arduino-esp8266-alexa-multiple-wemo-switch.

MacSass avatar MacSass commented on August 9, 2024 1

@kakopappa
Hey, any news yet from the skill for other countries? I received an invitation to beta-test but when trying to load it tells me it is not availble in Germany still. Any update? I´d love to test it?
Any feedback from others yet?
Regards - MacSass

from arduino-esp8266-alexa-multiple-wemo-switch.

dougstrickland avatar dougstrickland commented on August 9, 2024

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

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

from arduino-esp8266-alexa-multiple-wemo-switch.

sciencegirl100 avatar sciencegirl100 commented on August 9, 2024

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

from arduino-esp8266-alexa-multiple-wemo-switch.

Braandn avatar Braandn commented on August 9, 2024

Same problem

from arduino-esp8266-alexa-multiple-wemo-switch.

MacSass avatar MacSass commented on August 9, 2024

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 ...

from arduino-esp8266-alexa-multiple-wemo-switch.

sciencegirl100 avatar sciencegirl100 commented on August 9, 2024

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

from arduino-esp8266-alexa-multiple-wemo-switch.

arnowillig avatar arnowillig commented on August 9, 2024

@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

from arduino-esp8266-alexa-multiple-wemo-switch.

ma7gdp avatar ma7gdp commented on August 9, 2024

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 :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

from arduino-esp8266-alexa-multiple-wemo-switch.

RootCNC avatar RootCNC commented on August 9, 2024

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!

from arduino-esp8266-alexa-multiple-wemo-switch.

kakopappa avatar kakopappa commented on August 9, 2024

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

from arduino-esp8266-alexa-multiple-wemo-switch.

tommyfranke avatar tommyfranke commented on August 9, 2024

@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?

from arduino-esp8266-alexa-multiple-wemo-switch.

ZoMiGo avatar ZoMiGo commented on August 9, 2024

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

from arduino-esp8266-alexa-multiple-wemo-switch.

arnowillig avatar arnowillig commented on August 9, 2024

from arduino-esp8266-alexa-multiple-wemo-switch.

RootCNC avatar RootCNC commented on August 9, 2024

@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.

from arduino-esp8266-alexa-multiple-wemo-switch.

sciencegirl100 avatar sciencegirl100 commented on August 9, 2024

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

from arduino-esp8266-alexa-multiple-wemo-switch.

MacSass avatar MacSass commented on August 9, 2024

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 ...

from arduino-esp8266-alexa-multiple-wemo-switch.

MacSass avatar MacSass commented on August 9, 2024

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

from arduino-esp8266-alexa-multiple-wemo-switch.

sciencegirl100 avatar sciencegirl100 commented on August 9, 2024

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.

from arduino-esp8266-alexa-multiple-wemo-switch.

ma7gdp avatar ma7gdp commented on August 9, 2024

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.

from arduino-esp8266-alexa-multiple-wemo-switch.

MacSass avatar MacSass commented on August 9, 2024

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 ...

from arduino-esp8266-alexa-multiple-wemo-switch.

MacSass avatar MacSass commented on August 9, 2024

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.

from arduino-esp8266-alexa-multiple-wemo-switch.

ma7gdp avatar ma7gdp commented on August 9, 2024

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 :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

from arduino-esp8266-alexa-multiple-wemo-switch.

MacSass avatar MacSass commented on August 9, 2024

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 ...

from arduino-esp8266-alexa-multiple-wemo-switch.

ma7gdp avatar ma7gdp commented on August 9, 2024

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.

from arduino-esp8266-alexa-multiple-wemo-switch.

jerrishjacob avatar jerrishjacob commented on August 9, 2024

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

from arduino-esp8266-alexa-multiple-wemo-switch.

ioanvapi avatar ioanvapi commented on August 9, 2024

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.

from arduino-esp8266-alexa-multiple-wemo-switch.

hinkey247 avatar hinkey247 commented on August 9, 2024

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 :)

from arduino-esp8266-alexa-multiple-wemo-switch.

tonywye avatar tonywye commented on August 9, 2024

@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

from arduino-esp8266-alexa-multiple-wemo-switch.

hinkey247 avatar hinkey247 commented on August 9, 2024

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

from arduino-esp8266-alexa-multiple-wemo-switch.

hinkey247 avatar hinkey247 commented on August 9, 2024

ps could you send this file as .ino thanks

from arduino-esp8266-alexa-multiple-wemo-switch.

hinkey247 avatar hinkey247 commented on August 9, 2024

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

from arduino-esp8266-alexa-multiple-wemo-switch.

hotelafrica avatar hotelafrica commented on August 9, 2024

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 :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"?><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">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"?><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">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 !

from arduino-esp8266-alexa-multiple-wemo-switch.

hinkey247 avatar hinkey247 commented on August 9, 2024

from arduino-esp8266-alexa-multiple-wemo-switch.

jerrishjacob avatar jerrishjacob commented on August 9, 2024

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

from arduino-esp8266-alexa-multiple-wemo-switch.

hkauroberoi avatar hkauroberoi commented on August 9, 2024

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??

from arduino-esp8266-alexa-multiple-wemo-switch.

hinkey247 avatar hinkey247 commented on August 9, 2024

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.

from arduino-esp8266-alexa-multiple-wemo-switch.

hkauroberoi avatar hkauroberoi commented on August 9, 2024

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.

from arduino-esp8266-alexa-multiple-wemo-switch.

MacSass avatar MacSass commented on August 9, 2024

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

from arduino-esp8266-alexa-multiple-wemo-switch.

hinkey247 avatar hinkey247 commented on August 9, 2024

from arduino-esp8266-alexa-multiple-wemo-switch.

sydknee avatar sydknee commented on August 9, 2024

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.

from arduino-esp8266-alexa-multiple-wemo-switch.

hotelafrica avatar hotelafrica commented on August 9, 2024

@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 :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"?><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">1</u:GetBinaryState></s:Body></s:Envelope>
Got binary state request
Sending :<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body>
<u:GetBinaryStateResponse xmlns:u="urn:Belkin:service:basicevent:1">
0
</u:GetBinaryStateResponse>
</s:Body> </s:Envelope>

########## Responding to /upnp/control/basicevent1 ... ##########
request:"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">1</u:GetBinaryState></s:Body></s:Envelope>
Got binary state request
Sending :<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body>
<u:GetBinaryStateResponse xmlns:u="urn:Belkin:service:basicevent:1">
1
</u:GetBinaryStateResponse>
</s:Body> </s:Envelope>

########## Responding to /upnp/control/basicevent1 ... ##########
request:"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">1</u:GetBinaryState></s:Body></s:Envelope>
Got binary state request
Sending :<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body>
<u:GetBinaryStateResponse xmlns:u="urn:Belkin:service:basicevent:1">
0
</u:GetBinaryStateResponse>
</s:Body> </s:Envelope>

########## Responding to /upnp/control/basicevent1 ... ##########
request:"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">1</u:GetBinaryState></s:Body></s:Envelope>
Got binary state request
Sending :<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body>
<u:GetBinaryStateResponse xmlns:u="urn:Belkin:service:basicevent:1">
1
</u:GetBinaryStateResponse>
</s:Body> </s:Envelope>

from arduino-esp8266-alexa-multiple-wemo-switch.

charliebrowndog avatar charliebrowndog commented on August 9, 2024

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...

from arduino-esp8266-alexa-multiple-wemo-switch.

jerrishjacob avatar jerrishjacob commented on August 9, 2024

@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

from arduino-esp8266-alexa-multiple-wemo-switch.

hinkey247 avatar hinkey247 commented on August 9, 2024

from arduino-esp8266-alexa-multiple-wemo-switch.

hinkey247 avatar hinkey247 commented on August 9, 2024

from arduino-esp8266-alexa-multiple-wemo-switch.

hkauroberoi avatar hkauroberoi commented on August 9, 2024

If this helps someone.... The alexa dot firmware is : 597464620

I got it working.... First tried with making changes to switch.cpp (belkin to root) but in vain. Virtually tried everything/every code but there was no activity in the serial console. Then checked the settings in router and found out that UPNP was unchecked. Enable the UPNP in router settings and used previous code (fauxmo) - all 7 devices successfully detected.

`*WM: AutoConnect
*WM: Connecting as wifi client...
*WM: Using last saved values, should be faster
WM: Connection result:
WM: 3
WM: IP Address:
WM: 192.168.0.100
{"device_id":"2C:3A:E8:35:D0:E7","device_name":"Device1"}Attempting MQTT connection...connected
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=86400
DATE: Mon, 22 Jun 2015 17:24:01 GMT
EXT:
LOCATION: http://192.168.0.100:52003/setup.xml
OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
01-NLS: 44455635D0E703
SERVER: Unspecified, UPnP/1.0, Unspecified
X-User-Agent: redsonic
ST: urn:Belkin:device:

USN: uuid:Socket-1_0-44455635D0E703::urn:Belkin:device:

HTTP/1.1 200 OK
CACHE-CONTROL: max-age=86400
DATE: Mon, 22 Jun 2015 17:24:01 GMT
EXT:
LOCATION: http://192.168.0.100:52003/setup.xml
OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
01-NLS: 44455635D0E703
SERVER: Unspecified, UPnP/1.0, Unspecified
X-User-Agent: redsonic
ST: urn:Belkin:device:**
USN: uuid:Socket-1_0-44455635D0E703::urn:Belkin:device:**

HTTP/1.1 200 OK
CACHE-CONTROL: max-age=86400
DATE: Mon, 22 Jun 2015 17:24:01 GMT
EXT:
LOCATION: http://192.168.0.100:52004/setup.xml
OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
01-NLS: 44455635D0E704
SERVER: Unspecified, UPnP/1.0, Unspecified
X-User-Agent: redsonic
ST: urn:Belkin:device:**
USN: uuid:Socket-1_0-44455635D0E704::urn:Belkin:device:**

HTTP/1.1 200 OK
CACHE-CONTROL: max-age=86400
DATE: Mon, 22 Jun 2015 17:24:01 GMT
EXT:
LOCATION: http://192.168.0.100:52005/setup.xml
OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
01-NLS: 44455635D0E705
SERVER: Unspecified, UPnP/1.0, Unspecified
X-User-Agent: redsonic
ST: urn:Belkin:device:**
USN: uuid:Socket-1_0-44455635D0E705::urn:Belkin:device:**

`

from arduino-esp8266-alexa-multiple-wemo-switch.

hinkey247 avatar hinkey247 commented on August 9, 2024

from arduino-esp8266-alexa-multiple-wemo-switch.

hotelafrica avatar hotelafrica commented on August 9, 2024

it looks like i am hitting the dead end...
I did everything above and no luck. Alexa just can't find the esp8266.
Not sure if this is because i'm using ESP8266 NodeMCU, not wemo-mini. Or because of some kind of network setting or hardware. (TP-link smart outlet works fine through Echo)
screen_20180101_144804

I am waiting for a raspberry pi to be delivered and see if I can utilize my esp8266 via mqtt...

here's my serial output, (Echo is 192.168.1.85)

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 : office lights index : 0
Adding switch : kitchen lights index : 1
Got UDP Belkin Request..

Sending response to 192.168.1.55
Port : 61196
Response sent !

Sending response to 192.168.1.55
Port : 61196
Response sent !
Got UDP Belkin Request..

Sending response to 192.168.1.55
Port : 61196
Response sent !

Sending response to 192.168.1.55
Port : 61196
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 !
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: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 setup.xml ... ########

Sending :urn:Belkin:device:controllee:1office lightsBelkin 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 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: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 setup.xml ... ########

Sending :urn:Belkin:device:controllee:1office lightsBelkin 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 /upnp/control/basicevent1 ... ##########
request:"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">1</u:GetBinaryState></s:Body></s:Envelope>
Got binary state request
Sending :<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body>
<u:GetBinaryStateResponse xmlns:u="urn:Belkin:service:basicevent:1">
1
</u:GetBinaryStateResponse>
</s:Body> </s:Envelope>

Got UDP Belkin Request..

Sending response to 192.168.1.55
Port : 4988
Response sent !

Sending response to 192.168.1.55
Port : 4988
Response sent !
Got UDP Belkin Request..

Sending response to 192.168.1.55
Port : 4988
Response sent !

Sending response to 192.168.1.55
Port : 4988
Response sent !
########## Responding to /upnp/control/basicevent1 ... ##########
request:"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">1</u:GetBinaryState></s:Body></s:Envelope>
Got binary state request
Sending :<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body>
<u:GetBinaryStateResponse xmlns:u="urn:Belkin:service:basicevent:1">
0
</u:GetBinaryStateResponse>
</s:Body> </s:Envelope>

########## Responding to /upnp/control/basicevent1 ... ##########
request:"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">1</u:GetBinaryState></s:Body></s:Envelope>
Got binary state request
Sending :<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body>
<u:GetBinaryStateResponse xmlns:u="urn:Belkin:service:basicevent:1">
0
</u:GetBinaryStateResponse>
</s:Body> </s:Envelope>

########## Responding to /upnp/control/basicevent1 ... ##########
request:"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">1</u:GetBinaryState></s:Body></s:Envelope>
Got binary state request
Sending :<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body>
<u:GetBinaryStateResponse xmlns:u="urn:Belkin:service:basicevent:1">
1
</u:GetBinaryStateResponse>
</s:Body> </s:Envelope>

Got UDP Belkin Request..

Sending response to 192.168.1.55
Port : 52823
Response sent !

Sending response to 192.168.1.55
Port : 52823
Response sent !
########## Responding to setup.xml ... ########

Sending :urn:Belkin:device:controllee:1office lightsBelkin 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

from arduino-esp8266-alexa-multiple-wemo-switch.

jcarley avatar jcarley commented on August 9, 2024

@hotelafrica from looking at your code, I think your response message is wrong. I got this working with my Echo Plus (firmware 595530520) Here's what I have in Switch.cpp, method Switch::respondToSearch. Pay close attention to the third to last line and the second to last line. Both contain the string "upnp:rootdevice". That is literally all the changes I made. I upload my sketch to a Node MCU, and it worked. Echo found the devices no problem.

String response = 
       "HTTP/1.1 200 OK\r\n"
       "CACHE-CONTROL: max-age=86400\r\n"
       "DATE: Sat, 26 Nov 2016 04:56:29 GMT\r\n"
       "EXT:\r\n"
       "LOCATION: http://" + String(s) + ":" + String(localPort) + "/setup.xml\r\n"
       "OPT: \"http://schemas.upnp.org/upnp/1/0/\"; ns=01\r\n"
       "01-NLS: b9200ebb-736d-4b93-bf03-835149d13983\r\n"
       "SERVER: Unspecified, UPnP/1.0, Unspecified\r\n"
       "ST: upnp:rootdevice:**\r\n"
       "USN: uuid:" + persistent_uuid + "::upnp:rootdevice:**\r\n"
       "X-User-Agent: redsonic\r\n\r\n";

from arduino-esp8266-alexa-multiple-wemo-switch.

MacSass avatar MacSass commented on August 9, 2024

@hotelafrica:
find attached my serial output.
I notice that in your output the XML tags are missing, but I guess those have been lost posting to github?
But your screenshot shows a lot of "#" instead of "" - if you really have the code as seen in your screenshot than that would explain why it would not work.

See screenshot how it should look and how it works for me.

switch cpp working with type 2 echo devices
Also I hope my attached log helps - it was done with an ESP-12 development board (it really should work regardless of what ESP8266 board you use, I use several different ones).

Also, instead of pasting long logs into this thread better attach a .txt file with it - it keeps the thread less cluttered and makes sure nothing gets stripped. If you can attach our log as a file I can compare the files to see if there is any difference.

Regards - MacSass
ESP serial log.txt

@jcarley:
I have only replaced the second to last line with "rootdevice..." the third to last I left as it was - and it is working fine for me, I think it is sufficient to change the USN.

from arduino-esp8266-alexa-multiple-wemo-switch.

hotelafrica avatar hotelafrica commented on August 9, 2024

@jcarley
I applied your change and tried again. No detection happening still.

@MacSass
the symbol you are refering as '#' is actually different form of backslash
(it actually looks like W with strike through)
It's because I've installed Korean input language in my windows 10 and language setting for 'Non-unicode programs' is also set as Korean.

But since you mentioned about it, i am going to remove all those settings and maybe reinstall the arduino ide THEN try the code again. (Maybe Echo doesn't understand response because it's encoded differently?)

if it works that way, then i'll have to figure out different way to make it work with Korean set up in my computer (It's kind of must have for my daily use).

Let me play with it little more, I'll let you know!

from arduino-esp8266-alexa-multiple-wemo-switch.

hotelafrica avatar hotelafrica commented on August 9, 2024

screen_20180101_195345

Removed Korean from windows (but didn't reinstall the arduino yet) and tried again.

well... not working... :(

let me reinstall the program and see what happens...

here's a log file after flashing the esp.

espLog_0101.txt

Again, thank you guys for look at my problem, hopefully I can sort this out somehow!

cheers.

from arduino-esp8266-alexa-multiple-wemo-switch.

jcarley avatar jcarley commented on August 9, 2024

@hotelafrica Shot in the dark here. See attached screen shot.

echo2_-_switch_cpp___arduino_1_8_2

from arduino-esp8266-alexa-multiple-wemo-switch.

hotelafrica avatar hotelafrica commented on August 9, 2024

@jcarley
I did, no discovery.
My next step is to try again with different router.
I kind of already tried it by using a hotspot from my iphone but let me do it again with actual router.

from arduino-esp8266-alexa-multiple-wemo-switch.

MacSass avatar MacSass commented on August 9, 2024

Hey @hotelafrica,
to be honest I do not understand why your Alexa does not find your ESP devices ...
I did compare your log to mine and obviously the UDP broadcast from Alexa is well received by the ESP, otherwise there would be no output.
Also Alexa get´s the response from ESP as Alexa then requests the setup.xml which then "defines" the device services - so I clearly would expect that Alexa then lists the devices if the response provided to setup.xml is OK, which seems to be the case.

I don´t really think its your router - as the UDP requests come through.

I´m sorry - I´m out of ideas - the only thing that might help is to add more debug information.
I would propose to add two statements to the switch.cpp before the two lines at the end so that it looks like this at the end:

    Serial.print("Sending :");
    Serial.println(response);
   Serial.println("Response sent !");
}

The two added lines would output to serial monitor the response that get´s send - but I´m fairly confident that this will be looking ok as well ... so it might not actually really help.

Also - try to call up the following URLs in a browser to see if your ESP gives you a good response:

http://IP_of_your-ESP/setup.xml it should return:

setup xml

Also check that http://IP_of_your-ESP/eventservice.xml returns valid XML.

I´m sorry - but I´m a bit out of ideas otherwise - it seems to be working for several others like it is for me ...

Regards - MacSass

from arduino-esp8266-alexa-multiple-wemo-switch.

ZoMiGo avatar ZoMiGo commented on August 9, 2024

from arduino-esp8266-alexa-multiple-wemo-switch.

sunilda avatar sunilda commented on August 9, 2024

There are certain places other then "response" section where Belkin is mentioned, do we need to modify them as well?

from arduino-esp8266-alexa-multiple-wemo-switch.

MacSass avatar MacSass commented on August 9, 2024

@sunilda :
I don´t think so - at least discovery should work with the change I have proposed. It does for me and for some others as well. No clue why it does not work for some others though ... sorry

from arduino-esp8266-alexa-multiple-wemo-switch.

sunilda avatar sunilda commented on August 9, 2024

@kakopappa
will this work without internet after it is configured?

from arduino-esp8266-alexa-multiple-wemo-switch.

kakopappa avatar kakopappa commented on August 9, 2024

from arduino-esp8266-alexa-multiple-wemo-switch.

hkauroberoi avatar hkauroberoi commented on August 9, 2024

Dot's firmware is updated again and the discovery is failing again. The previous version was 597464620.

However all my exisitng modules have also stopped responding to commands and alexa says "device not responding". Will check and update again.

from arduino-esp8266-alexa-multiple-wemo-switch.

hkauroberoi avatar hkauroberoi commented on August 9, 2024

Spent half of Saturday troubleshooting and found nothing unusual. Took out all ESP modules from the wall boxes to debug and reflash. As per amazon website I have 2nd Gen Dot with Latest Software Version: 597465220 > https://www.amazon.com/gp/aw/help/id=201602210

The broadcasting wasn't working and serial monitor stayed blank - the moment I ran wireshark I could see that packets were being sent in serial console !!!!!! Dunno what happened :) when ever thrs an update, the detection goes berserk and that's the reason I have now integrated OTA and push updated code from my server :)

Used every code/library - the detection is working fine now without modifying. Alexa is testing patience as practically I did nothing except wasting my time :(

Can someone please let me know if they faced/are facing the blank serial console (no UDP packets) ????

from arduino-esp8266-alexa-multiple-wemo-switch.

hkauroberoi avatar hkauroberoi commented on August 9, 2024

@kakopappa God.... I'm sorry as I missed you last post about skill... Let me try it out right away.

from arduino-esp8266-alexa-multiple-wemo-switch.

espfan avatar espfan commented on August 9, 2024

Im having issues getting alexa to discover my esp8266-01. Ive read all the posts and tried eveything mentioned but no success.

I have and Echoplus on FW595530520
The code I am currently using is the one from @kakopappa (https://github.com/kakopappa/arduino-esp8266-alexa-multiple-wemo-switch)
Ive made the chance to switch.cpp detailed by @MacSass and added the extra code to help debug

When asking Alexa to discover devices the serial monitor goes crazy! (ill attach the txt file) but she tells me no devices were found.
espserial.txt

I presume this is the same issue most are having but any help would be appreciated.

@kakopappa This skill doesnt appear to be available in the UK but i think this is the way to go!

Edit - http://192.168.1.105/setup.xml gives: - just noticed model number :)
xmlsetup.txt

http://192.168.1.105/eventservice.xml gives:
eventsevice.txt

This is my first Arduino/esp project so I have no idea if this is good or not.

from arduino-esp8266-alexa-multiple-wemo-switch.

hkauroberoi avatar hkauroberoi commented on August 9, 2024

@kakopappa the skill is not available in india. So i quickly coded a skill and confirm that all works well now !!!

from arduino-esp8266-alexa-multiple-wemo-switch.

kakopappa avatar kakopappa commented on August 9, 2024

@hkauroberoi can you help me with the translations, please?
kakopappa/sinric#3

from arduino-esp8266-alexa-multiple-wemo-switch.

TetsudouSenpai avatar TetsudouSenpai commented on August 9, 2024

@hkauroberoi (Can someone please let me know if they faced/are facing the blank serial console (no UDP packets) ????)

I'm running the multiple switches code on NodeMCU 1.0, and using a 2nd generation Echo Dot, FW version 597465220. After the latest updates, ESP Wemo devices stopped responding. I have tried all the above solutions with no success. I've now updated the libraries to the latest version (https://github.com/kakopappa/arduino-esp8266-alexa-multiple-wemo-switch) but I get no UDP packets.

I've tried wireshark too: Alexa is sending a message that contains urn:Belkin:device:**.

The serial output from the NodeMCU only contains the wifi and switch setup lines:

Connecting to WiFi
Connecting ......
Connected to TRAP XATA Slow
IP address: 192.168.1.11
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 : test light index : 0
Adding switch : stair light index : 1

However there are no UDP responses.

Have you got any ideas on how to fix this?

from arduino-esp8266-alexa-multiple-wemo-switch.

hkauroberoi avatar hkauroberoi commented on August 9, 2024

@TetsudouSenpai I faced this problem twice. First, the upnp was turned off in the wifi router settings (this is what fixed the issue) and very recently the serial console remained blank until I ran wireshark. So far no concrete explanation !!

from arduino-esp8266-alexa-multiple-wemo-switch.

hkpanchani avatar hkpanchani commented on August 9, 2024

I recently purchased echo 2nd generation with firmware version (595530420). And I tried all of the above solution , unfortunately none of them worked.ESP does responds to request but no device is added.
screenshot 3

from arduino-esp8266-alexa-multiple-wemo-switch.

kakopappa avatar kakopappa commented on August 9, 2024

from arduino-esp8266-alexa-multiple-wemo-switch.

hkpanchani avatar hkpanchani commented on August 9, 2024

@kakopappa
Thank you for the response.

I have already gone through Sinric.com but due to restriction Sinric skill is not available in my region(India).
capture

from arduino-esp8266-alexa-multiple-wemo-switch.

kakopappa avatar kakopappa commented on August 9, 2024

from arduino-esp8266-alexa-multiple-wemo-switch.

TetsudouSenpai avatar TetsudouSenpai commented on August 9, 2024

@kakopappa Do you by any chance have a way of checking which countries the skill is available in? Because in the UK it's not available either...

Also this link results in a 404: https://github.com/kakopappa/sinric/blob/master/arduino_sinric_example.ino

A very nice idea though, thank you very much for developing this!

from arduino-esp8266-alexa-multiple-wemo-switch.

kakopappa avatar kakopappa commented on August 9, 2024

@TetsudouSenpai sorry example at
https://github.com/kakopappa/sinric/blob/master/arduino_examples/switch_example.ino

there was a problem with the last submission. I am working it.

from arduino-esp8266-alexa-multiple-wemo-switch.

TetsudouSenpai avatar TetsudouSenpai commented on August 9, 2024

@kakopappa Ok, thank you very much!

Does this code support running multiple switches from one ESP8266? Do I just create more webSocketClient objects?

from arduino-esp8266-alexa-multiple-wemo-switch.

kakopappa avatar kakopappa commented on August 9, 2024

from arduino-esp8266-alexa-multiple-wemo-switch.

MacSass avatar MacSass commented on August 9, 2024

Hi @TetsudouSenpai and @hkpanchani ,
in deed my Echo Dot also has received updated firmware (at 597 465 220 now) but the script still continues to work (and find new devices!) fine with the single change that I have mentioned above:
Change one line close to the bottom of switch.cpp from:
"USN: uuid:" + persistent_uuid + "::urn:Belkin:device:**\r\n"
to be:
"USN: uuid:" + persistent_uuid + "::upnp:rootdevice\r\n"

I do see the responses flying out in the serial monitor as like this:
Sending response to 192.168.1.24
Port : 50000
Response sent !
########## Responding to setup.xml ... #######
......

I honestly have no clue why it is not working for you - the most likely reason I can imagine would be that the UDP broadcast packages do not reach your ESP for some reason - might makes sense to trace that if possible.

Of course the better way to go might be to use the upcoming skill of Kakopappa anyhow - but I´m still waiting for it to appear on the German alaxa skill store ... hope Amazon get´s that approved soon.

Regards - MacSass

PS: Of course it would be great if the skill and sinric code would become open source as well - but I could also fully understand if Kakopappa wants to keep that closed as it seem to have been an awful lot of work ...

from arduino-esp8266-alexa-multiple-wemo-switch.

MacSass avatar MacSass commented on August 9, 2024

@kakoppa:
No feedback from Amazon yet on availability in other countries?
You have any experience how long it usually takes for them to release a skill?
Anything more we can do from our side to help?

Regards- MacSass

from arduino-esp8266-alexa-multiple-wemo-switch.

kakopappa avatar kakopappa commented on August 9, 2024

from arduino-esp8266-alexa-multiple-wemo-switch.

MacSass avatar MacSass commented on August 9, 2024

Hi,
while we are waiting for the skill being releasd to other countries, everybody that has problems with getting the devices discovered might want to take a look at
https://github.com/Aircoookie/Espalexa
This emulates a hue device and worked perfectly for me right away and has the advantage of "dimmer" functionality. It only supports one device though currently - but I guess that could be changed.
If this also does not help you to get devices discovered then I would guess you have a problem with UPNP broadcasts getting blocked and you should look on your router side ...

Codewise the kakopappa smarthome skill obviously will be much less complex and might the the best choice for future (if dimming gets added hopefully).

Regards - MacSass

from arduino-esp8266-alexa-multiple-wemo-switch.

TetsudouSenpai avatar TetsudouSenpai commented on August 9, 2024

@MacSass
Thank you very much for your recommendation! Unfortunately, it still didn't work... I have checked UPnP settings - both UPnP and UPnP NAT-T are enabled.

I have run Wireshark to see whether any packets were coming through. I can see four packets coming through from 192.168.1.7 (Alexa's IP address) to 239.255.255.250 every time I run discovery, two pairs of identical packets. There are no replies to them. The pairs' only difference from each other is the ST field: the first pair has ST: urn:schemas-upnp-org:device:basic:1 and the second has ST: urn:Belkin:device:**.

Do you by any chance know if this shows whether my UPnP is blocked or not? Or if not, how could I check it? Because honestly I'm not very proficient in this area (I'm more on the hardware side).

Thank you very much in advance!

from arduino-esp8266-alexa-multiple-wemo-switch.

MacSass avatar MacSass commented on August 9, 2024

Hi @TetsudouSenpai,
sounds like the broadcast is not going to the ESP for it to respond ... the broadcast being sent to the broadcast address should go to all devices - but you could only check if it arrives at the ESP if you would put a network tracer (switch) between the ESP and the router.
Having turned on UPNP does not necessarily mean that SSDP broadcasts are forwarded ... check if you have any SSDP options in your router (that is the protocol for service discovery).

I will run a trace tomorrow here to see if I am seeing the same requests - but as said I would guess that your router does not forward the requests to the ESP - for whatever reason.
What router model is that? Maybe others that have the same problem have the same router brand?
I´m running AVM Fritzbox (which is popular in Germany) and do not see this issue.

Regards - MacSass

from arduino-esp8266-alexa-multiple-wemo-switch.

hkpanchani avatar hkpanchani commented on August 9, 2024

Not yet in india.

from arduino-esp8266-alexa-multiple-wemo-switch.

hkpanchani avatar hkpanchani commented on August 9, 2024

Finally Sinric is available in india

from arduino-esp8266-alexa-multiple-wemo-switch.

AvisIoT avatar AvisIoT commented on August 9, 2024

It is working in India, I was able to enable the Sinric and its responding. Just used the sample code only. Can't do more unless able to see the device ID on sinric site. Also can't control through app (already saw an issue logged about this).
Anyway, thanks a lot for making this easy for hobbyist like me. Will stay tuned.

from arduino-esp8266-alexa-multiple-wemo-switch.

TetsudouSenpai avatar TetsudouSenpai commented on August 9, 2024

@AvisIoT
You can actually determine the deviceID through adjusting the sinric code slightly. Just add a line Serial.println (deviceId) after the String deviceId = json ["deviceId"] line in the code. That would output the incoming ID into the serial monitor, from where you can copy and paste it into the code.

from arduino-esp8266-alexa-multiple-wemo-switch.

kakopappa avatar kakopappa commented on August 9, 2024

@AvisIoT @TetsudouSenpai

I have updated the website to show the device id now.

from arduino-esp8266-alexa-multiple-wemo-switch.

MacSass avatar MacSass commented on August 9, 2024

Hi @AvisIoT ,
I already spoke to Kakopappa about adding device ID to sinric.com. I guess he will do that soon, also some more enhancements are planned.
Until then you can also use the attached code to:

  • Control more than one device
  • Get deviceID for devices
    If the attached code (rename to .ino) receives a request for an unknown device it will put out the deviceID in the serial console.

What you need to do:
Add your api an wifi credentials to the attached code. Create device on sinric and have it discovered by alexa. Issue command through alexa and you will see the deviceID in the serial console.

You can then replace the existing dummy device IDs in the code with your correct ones ...

As said Kokopappa will make more enhancements soon to make it easier - I guess.

Regards - MacSass

switch_multi_sinric.txt

from arduino-esp8266-alexa-multiple-wemo-switch.

MacSass avatar MacSass commented on August 9, 2024

Uhhhh - He has been faster than me :-)

  • still my code might be useful for some that want to control multiple devices ...

from arduino-esp8266-alexa-multiple-wemo-switch.

AvisIoT avatar AvisIoT commented on August 9, 2024

Thank you @kakopappa and @MacSass . I will test/experiment more next weekend. Have ordered few relay modules, once they arrive will put this to real life use... the multi-device code will be really useful in that case. @kakopappa also looking forward to update on issue #10 (kakopappa/sinric#10)

from arduino-esp8266-alexa-multiple-wemo-switch.

RanTalbott avatar RanTalbott commented on August 9, 2024

To add some useful, but also some confusing, information.

I had some trouble getting Alexa to discover one of my experiments until I made the change that MacSass suggested. Thank you for that.

But...

  1. It also discovered one that didn't have the change.

  2. The Dot told me that it hadn't discovered anything. The Android app revealed that it had.

  3. The new experiment has 7 switches. Only the last 3 were discovered. I tweaked the debug code a little bit, and confirmed that initial responses for all 7 were sent. But the Dot is only asking for setup.xml for those last three. I'll post more about this after I do some more investigating.

from arduino-esp8266-alexa-multiple-wemo-switch.

charles avatar charles commented on August 9, 2024

My echo dot stop find my devices after updated my apple time capsule from version 7.7.8 to 7.7.9. After that I try every possible solution here with no success. My solution was a downgrade to 7.7.8.

I hope that helps someone.

from arduino-esp8266-alexa-multiple-wemo-switch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.