Skip to content

Using only one webserver #13

@hundsmiachn

Description

@hundsmiachn

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions