Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alexa not discovering device #7

Open
parus21 opened this issue Nov 10, 2016 · 84 comments
Open

alexa not discovering device #7

parus21 opened this issue Nov 10, 2016 · 84 comments

Comments

@parus21
Copy link

parus21 commented Nov 10, 2016

thanks for making such a cool project searched all over for a way to control a relay through alexa. now if only i can get it to work. i run the code and open serial monitor. it says it connects to my wifi network and that http server started but when i try to discover new devices with alexa it doesnt show up? any help would be appreciated.

@kakopappa
Copy link
Owner

  1. Make sure ports or udp packets are not blocked from router.
  2. When you ask alexa to discover devices, do you see these printed in the serial window ? normally alexa does a udp broadcast when you request to discover new devices

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

or

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

in the serial monitor?

@kalirenegade
Copy link

I have also tried to set up this device and do not get a response all devices are on the same network UDP seems to be working on the network as I am getting a request showing up from the router on the serial port However nothing from Alexa i'm using Alexa on the Amazon fire tv using a ESP-01 if I navigate to the ESP's homepage Aka index.htnl I get hello world so I know it is connected

@joeman2116
Copy link

I am using the software on several nodemcu 8266 -12f modules and it works great.
Also reprogrammed the Sonoff modules with this code.
I use the arduino ide software to flash the new code. I choose the nodemcu.9v type

Changed the ssid and password and gave each one a new device name, reboot and
Told Alexa Echo dot to discover and all appeared.... wow! great stuff....

Thanks for Super Piece of Software!!
Joe

@parus21
Copy link
Author

parus21 commented Nov 17, 2016

just looking back at the boards i ordered and realized that i ordered the d1 mini pro which looks like a different board. could this be causing the issue?

@parus21
Copy link
Author

parus21 commented Nov 17, 2016

not seeing anything when i make a request from alexa in the serial monitor. just pauses at http server started.

@joeman2116
Copy link

I looked at the mini pro and it looks fine. It has more mem than most.
Should work ok.
I use frpm esp01 to 12f and nodemcu modules and all work ok.
Is your power source powerfull enough?
Joe

On Wed, Nov 16, 2016, 8:39 PM parus21 notifications@github.com wrote:

not seeing anything when i make a request from alexa in the serial
monitor. just pauses at http server started.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#7 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AWDpY0zFZ7jqwmu53iOuWceR7-U_I1iRks5q-6JRgaJpZM4KvPK8
.

@AndrewsHappy
Copy link

It is beautiful code, and I am glad that someone has got it to work, but afraid I am not one of them. I know it is getting onto the router, as i can see it, I can also ping it. Just Alexa will not discover it. Granted that I have a professional meru wifi system, which has lots of settings that might stop the UDP etc... but also tried it on my back up router that EE provides and still nothing... You can't get the WeMo sockets for love or money (and a lot of money at that) to see if your network is the problem of if there is a bit of code that just doesnt like me! So close yet so far!

@joeman2116
Copy link

joeman2116 commented Dec 18, 2016 via email

@AndrewsHappy
Copy link

I must confess that I am not as clever as I might think I am and quite new to it all. I am programming the Sonoff and only got as far as looking at the single device. I do not know how to use the Serial Monitor to get anything useful out of it, so I do not even know if Alex is doing anythin....HOLY SMOKE!! Press the button.... I didn't even realise I needed to push the button.... DHO!

OK, I now have a WeMo Switch showing up on my Alexa.... Joe, you are my hero!!! Thank you....

@joeman2116
Copy link

joeman2116 commented Dec 18, 2016 via email

@AndrewsHappy
Copy link

Slow down! So with the Sonoff can you get the relay and green LED to work together, at the moment, it seems to only be "Alexa turn the light on" to turn on the light, then "Alexa turn the light on" to turn it off!! I think I need to study this code more... but at least I can now go to bed with some sense of achievement

@joeman2116
Copy link

joeman2116 commented Dec 18, 2016 via email

@AndrewsHappy
Copy link

Yes, it isn't as easy as I thought

void turnOnRelay() {
digitalWrite(relayPin, HIGH); // turn on relay with voltage HIGH
digitalWrite(ledPin, HIGH); // turn on the green LED
}

giving the value of 13 for the relay and 12 for the relay, but all it seems to do is to turn on the relay and not the LED.

Oh, thanks again, got the serial monitor working.... having fun now,..... shame it is 1am

@joeman2116
Copy link

joeman2116 commented Dec 18, 2016 via email

@AndrewsHappy
Copy link

One step behind you!
Right, off to bed
Night

Andrew (Hampshire, England)

@AndrewsHappy
Copy link

AndrewsHappy commented Dec 19, 2016 via email

@joeman2116
Copy link

joeman2116 commented Dec 19, 2016 via email

@AndrewsHappy
Copy link

AndrewsHappy commented Dec 19, 2016 via email

@joeman2116
Copy link

joeman2116 commented Dec 19, 2016 via email

@AndrewsHappy
Copy link

AndrewsHappy commented Dec 20, 2016 via email

@joeman2116
Copy link

joeman2116 commented Dec 20, 2016 via email

@AndrewsHappy
Copy link

AndrewsHappy commented Dec 20, 2016 via email

@joeman2116
Copy link

joeman2116 commented Dec 21, 2016 via email

@AndrewsHappy
Copy link

AndrewsHappy commented Dec 21, 2016 via email

@solrac21
Copy link

Hello everyone, i am having some isssues...I can flash the Sonoff and i get this in the serial monitor:
.
Connected to HOME-1307-2.4
IP address: 10.0.0.229

Connecting to UDP
Connection successful
HTTP Server started ..

but no matter what i do, i cannot get alexa to see it. I also do not see the request from Alexa on the serial monitor. I have tried diffrent UDP ports but nothing....

@AndrewsHappy
Copy link

AndrewsHappy commented Dec 21, 2016 via email

@joeman2116
Copy link

joeman2116 commented Dec 21, 2016 via email

@AndrewsHappy
Copy link

AndrewsHappy commented Dec 21, 2016 via email

@solrac21
Copy link

No, i haven't tried the button. So do i hold the button down? press the button once and scan for devices?

@AndrewsHappy
Copy link

AndrewsHappy commented Dec 22, 2016 via email

@mortoney
Copy link

@jerrishjacob I still have this issue where alexa cannot discover my wemos d1-mini device. I also using 2nd generation Echo. Maybe that is the reason, it could expect a different response or something.

@kakopappa Yes, I have tried latest version with >= which improved things, Code now sends back a response to Alexa, but Alexa still does not recognise.

I have not tried a version of the code for multiple devices, I will try to do that later today.

@mortoney
Copy link

Just tested with multi device version of the code and getting same issue:

Got UDP Belkin Request..

Sending response to 192.168.0.1
Port : 29352
Response sent !

Sending response to 192.168.0.1
Port : 29352
Response sent !
Got UDP Belkin Request..

Sending response to 192.168.0.1
Port : 29352
Response sent !

But Alexa does not recognize device.

Is it because I don't have any legit smart device connected, as Sascha suggested HUE light?

@kakopappa
Copy link
Owner

kakopappa commented Dec 30, 2017 via email

@mortoney
Copy link

192.168.0.1 is router IP address

@mortoney
Copy link

Amazon ehco ip: 192.168.0.10

Interesting that single device code sent repond to ip: 192.168.0.10 and multi device code sent repond to ip: 192.168.0.1

in both way alexa can't find device

@jerrishjacob
Copy link

@kakopappa I tried with the updated code.
I am getting the following in the serial monitor: 192.168.1.107 is the IP of alexa.

Connecting to WiFi
Connecting ........
Connected to Jerrish
IP address: 192.168.1.133
Ask Alexa to discover devices

Connecting to UDP
Connection successful
HTTP Server started ..
192.168.1.107, port 50000
Responding to search request ...

Sending response to 192.168.1.107
Port : 50000
Response sent !
192.168.1.107, port 50000
Responding to search request ...

Sending response to 192.168.1.107
Port : 50000
Response sent !
192.168.1.107, port 50000
Responding to search request ...

Sending response to 192.168.1.107
Port : 50000
Response sent !
192.168.1.107, port 50000
Responding to search request ...

Sending response to 192.168.1.107
Port : 50000
Response sent !
192.168.1.107, port 50000
Responding to search request ...

Sending response to 192.168.1.107
Port : 50000
Response sent !
192.168.1.107, port 50000
Responding to search request ...

Sending response to 192.168.1.107
Port : 50000
Response sent !
192.168.1.107, port 50000
Responding to search request ...

Sending response to 192.168.1.107
Port : 50000
Response sent !
192.168.1.107, port 50000
Responding to search request ...

Sending response to 192.168.1.107
Port : 50000
Response sent !
192.168.1.107, port 50000
Responding to search request ...

Sending response to 192.168.1.107
Port : 50000
Response sent !
192.168.1.107, port 50000
Responding to search request ...

Sending response to 192.168.1.107
Port : 50000
Response sent !
192.168.1.1, port 1900
192.168.1.1, port 1900
192.168.1.1, port 1900
192.168.1.1, port 1900
192.168.1.1, port 1900
192.168.1.1, port 1900
192.168.1.1, port 1900
192.168.1.1, port 1900
192.168.1.1, port 1900
192.168.1.1, port 1900
192.168.1.1, port 1900
192.168.1.1, port 1900

@sunilda
Copy link

sunilda commented Dec 31, 2017

Hi

When I press the rest switch I get the below output on console:

⸮Hl⸮⸮⸮hl$⸮�y2h⸮⸮
Connecting to WiFi
Connecting .........
Connected to CiscoD
IP address: 192.168.1.41
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

When I ask alexa to search the device, I get the following lines on the console:

Got UDP Belkin Request..

Sending response to 192.168.1.6
Port : 50000
Response sent !

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

Sending response to 192.168.1.6
Port : 50000
Response sent !

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

Sending response to 192.168.1.6
Port : 50000
Response sent !

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

Sending response to 192.168.1.6
Port : 50000
Response sent !

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

Sending response to 192.168.1.6
Port : 50000
Response sent !

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

Sending response to 192.168.1.6
Port : 50000
Response sent !

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

Sending response to 192.168.1.6
Port : 50000
Response sent !

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

Sending response to 192.168.1.6
Port : 50000
Response sent !

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

Sending response to 192.168.1.6
Port : 50000
Response sent !

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

Sending response to 192.168.1.6
Port : 50000
Response sent !

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

Sending response to 192.168.1.1
Port : 53967
Response sent !

Sending response to 192.168.1.1
Port : 53967
Response sent !

My modem details: DSL-2750U Firmware Version:IN_1.02

Firewall is disabled on the modem, and Echo Plus, Lolin NodeMcu V3, my mobile with alexa app is on the same network.

I have two NodeMCU V3 module and I am getting the same result. Both devices are working as I have tried blink example on it.

I am power the device through laptop usb port. I have not connected any relay or circult to nodemcu to remove the doubt of low power.

I am using the exactly same device as shown in the below url:
https://www.amazon.in/Centiot-ESP8266-NodeMCU-Development-Board/dp/B01M98LHT4

Now, every time I ask alexa to discover, it fail to find to find nodemcu. I have also tried the same through alexa app on android (on galaxy C9 pro). But alexa fail to detect the device.

Am I missing any additional step required to let echo plus discover nodemcu?

@samazw
Copy link

samazw commented Dec 31, 2017 via email

@sunilda
Copy link

sunilda commented Dec 31, 2017

Hi Sascha,
You said "Use the App and do not ask Alexa. This does not work". So, I have two doubts.

There are lot of videos out there on youtube which shows that this works with alexa. Below is the URL of one such video. So how this is working of them.

https://www.youtube.com/watch?v=Be36aL6smig&lc=z22fzxx42mztut2yu04t1aokgdoikabhjuk2xefailkmbk0h00410.1514700472803318

When you say app do you mean alexa app or some other app?

@samazw
Copy link

samazw commented Dec 31, 2017 via email

@sunilda
Copy link

sunilda commented Jan 1, 2018

Hi Sascha,

Thanks for clarifying. With app also its not working, though I can see the request received from mobile app on console and response send:
Sending response to 192.168.1.6 <<~~~~~~~~My mobile IP
Port : 50000
Response sent ! <<~~~~~~~~~~~~

In Switch.cpp I printed value of response:

Serial.println("Response sent !");
Serial.println(response);

and I got the output given below which states that my app and nodemcu is communicating. Even when I ask alexa, I get the same response with the same IP 192.168.1.6. I am still trying to figure out what is missing in the code.

Sending response to 192.168.1.6
Port : 50000
Response sent !
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=86400
DATE: Sat, 26 Nov 2016 04:56:29 GMT
EXT:
LOCATION: http://192.168.1.41:101/setup.xml
OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
01-NLS: b9200ebb-736d-4b93-bf03-835149d13983
SERVER: Unspecified, UPnP/1.0, Unspecified
ST: urn:Belkin:device:**
USN: uuid:Socket-1_0-38323636-4558-4dda-9188-cda0e670fa2e-101::urn:Belkin:device:**
X-User-Agent: redsonic

@sunilda
Copy link

sunilda commented Jan 1, 2018

These codes enables esp8266 to simulate a Belkin Wemo switch. But somehow it is not working.

The code reaches void Switch::respondToSearch(IPAddress& senderIP, unsigned int senderPort), but alexa doesn't respond to the response sent by nodemcu, so I believe Alexa is expecting a different response.

Anyone who have something more to say/add?

@sunilda
Copy link

sunilda commented Jan 1, 2018

there is no request generated from alexa for

/setup.xml
/upnp/control/basicevent1
/eventservice.xml

:(

@sunilda
Copy link

sunilda commented Jan 1, 2018

Hi All,
At this point I can confirm that the problem I am facing is with Echo plus, with Echo Dot, it is working. Can anyone suggest what can be done for Echo Plus?

@JanB97
Copy link

JanB97 commented Jan 5, 2018

Hi sunilda,
change the string response to:

String response =
"HTTP/1.1 200 OK\r\n"
"CACHE-CONTROL: max-age=86400\r\n"
"DATE: Fri, 15 Apr 2016 04:56:29 GMT\r\n"
"EXT:\r\n"
"LOCATION: http://" + String(s) + ":80/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: ssdp:all\r\n"
"USN: uuid:" + persistent_uuid + "::upnp:rootdevice\r\n"
"X-User-Agent: redsonic\r\n\r\n

this is working on my Echo Plus.

@kakopappa
Copy link
Owner

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_sinric_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
kakopappa

@samazw
Copy link

samazw commented Jan 5, 2018 via email

@SupraJames
Copy link

It would be a great shame if we needed to start relying on an external web site for things like this. Won’t it introduce extra latency, too?

@samazw
Copy link

samazw commented Jan 6, 2018 via email

@sunilda
Copy link

sunilda commented Jan 6, 2018

@JanB97 There was a \ and ; missing in the code you gave and I applied, but it didn't worked.

@sunilda
Copy link

sunilda commented Jan 6, 2018

I believe Sascha can help creating a standalone version, I believe then SupraJames will have no security issue.

@Ameengray
Copy link

@kakopappa dose the website communication with the device work on MQTT protocol ? if yes what broker are u using ?

I am working on a similar website, using the alexa skill dose make it easy.

what about the guys who dont have alexa and would like to emulate the device ?

@kakopappa
Copy link
Owner

kakopappa commented Jan 6, 2018 via email

@samazw
Copy link

samazw commented Jan 6, 2018 via email

@JanB97
Copy link

JanB97 commented Jan 6, 2018

@sunilda I am sorry, I did not copy the last two characters.

This is the full response string I'm using, I did not change anything else. (this is a direct copy of my working sketch so it should be right).

String response =
"HTTP/1.1 200 OK\r\n"
"CACHE-CONTROL: max-age=86400\r\n"
"DATE: Fri, 15 Apr 2016 04:56:29 GMT\r\n"
"EXT:\r\n"
"LOCATION: http://" + String(s) + ":80/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: ssdp:all\r\n"
"USN: uuid:" + persistent_uuid + "::upnp:rootdevice\r\n"
"X-User-Agent: redsonic\r\n\r\n";

@sunilda
Copy link

sunilda commented Jan 6, 2018

@JanB97 Not sure how the above said code even got compiled as it missing the very first \ after OTP:

"OPT: "http://schemas.upnp.org/upnp/1/0/\"; ns=01\r\n"

anyways I added the \ and the code compiled, but still alexa (Echo Plus) fail to detect devices.

@tinh8080
Copy link

thank for your project and now I would like to know how can I you mqtt to communicate with alexa..I use adafruit io mqtt connect esp8266
Please help me

@samazw
Copy link

samazw commented Feb 25, 2018 via email

@thesofial
Copy link

Sorry but now I can't access the link (the new code) you provide, can you sent it again. Thank you so much!
Here is link:
https://github.com/kakopappa/sinric/blob/master/arduino_sinric_example.ino

@kakopappa
Copy link
Owner

kakopappa commented Oct 3, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests