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

Using only one WebServer #27

Open
hundsmiachn opened this issue Dec 5, 2017 · 0 comments
Open

Using only one WebServer #27

hundsmiachn opened this issue Dec 5, 2017 · 0 comments

Comments

@hundsmiachn
Copy link

Hi

First of all thanks for your effort to integrate our beloved ESP8266 "into Alexa framework"!
I integrated your code into my current project. Unfortunately I ran out of heap using your files.
As I dont have an Echo yet I cannot try it for myself but I have a suggestion:
My Project already uses a WebServer, so I dont think that It is necessary to start some more for every device. Wouldn't it be easier to respond to the UDP Broadcast (respondToSearch) with a different URL depending on the number of the device: for example:

"LOCATION: http://" + String(s) + ":" + String(localPort) + "/setup1.xml\r\n"
"LOCATION: http://" + String(s) + ":" + String(localPort) + "/setup2.xml\r\n"
...

And for the callback registration:

server->on("/setup1.xml", [&]() {
    handleSetupXml1();
  });
server->on("/setup2.xml", [&]() {
    handleSetupXml2();
  });
...

And for the events:

"<controlURL>/upnp/control/basicevent1</controlURL>"
"<controlURL>/upnp/control/basicevent2</controlURL>"
...

 server->on("/upnp/control/basicevent1", [&]() {
    handleUpnpControl1();
  });
 server->on("/upnp/control/basicevent2", [&]() {
    handleUpnpControl2();
  });

With some little adaptions for handling the number of course, but you get the idea.

Would this work or does the Belkin skill only accept setup.xml, /upnp/control/basicevent1 and nothing else ??

regards
Erich

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

1 participant