marcoschwartz / aREST_UI

Embedded UI for the aREST framework
72 stars 34 forks source link

Webpage won't load if one more rest.button() is added to example code #29

Open MagnusThome opened 6 years ago

MagnusThome commented 6 years ago

If I run the example code exactly as is (only pwd and ssid changed) on an ESP8266-01 everything works great.

But if I add one more button like in the code below the webbrowser never gets any web page back. I can still do REST calls ("blindly") to turn pins on and off but the webbrowser does not get any html web page data back what so ever.

  // Set the title
  rest.title("aREST UI Demo");

  // Create button to control pin 5
  rest.button(5);
  rest.button(2);                                     // ADDING THIS WILL MAKE WEB PAGE LOAD FAIL

  // Init variables and expose them to REST API
  temperature = 22;
  humidity = 39.1;
  rest.variable("temperature", &temperature);
  rest.variable("humidity", &humidity);

  // Labels
  rest.label("temperature");
  rest.label("humidity");

Interestingly though is that if I do have two buttons but comment out all labels everything works again, except the labels of course.

MagnusThome commented 6 years ago

Some more findings.

With any rest.label() included in the code the max number of rest.button() is one. With no rest.label() included the max number of rest.button() is two

These being the only changes to the demo code apart from ssid and passwd.

Running on an ESP8266-01

marcoschwartz commented 6 years ago

Sorry about the bug, we'll check that and release a fix!