marcoschwartz / aREST_UI

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

Bug: Cannot add more than 3 buttons #25

Closed luetzel closed 7 years ago

luetzel commented 7 years ago

Howdy, I try to controls a relay on a Wemos D1 mini. I was able to add buttons (on/off) to toggle three relay channels.

 // Create UI
  rest.title("WeMos D1 Relay Control");
  rest.button(1); // GPIO1 on ESP8266 is D1
  rest.button(2); // GPIO2 on ESP8266 is D2
  rest.button(5); // GPIO3 on ESP8266 is D5
  //rest.button(6); // GPIO4 on ESP8266 is D6

However, adding a forth button does not work. The fourth row of buttons is displayed on screen, but below, some text appears:

').click(function() {$.g¸˙

I pulled the latest aREST/aREST_UI and esp8266com for Wemos D1 mini.

Can you give me a hint what might be wrong?

Cheers, /luetzel

marcoschwartz commented 7 years ago

Hi, seems like a memory issue at first glance, the library is quite memory-hungry. Do you have any warnings from the Arduino IDE?

luetzel commented 7 years ago

Hi Marco, no warnings at all.

Sketch uses 259989 Sketch uses 259989 bytes (24%) of program storage space. Maximum is 1044464 bytes.bytes (24%) of program storage space. Maximum is 1044464 bytes.
Global variables use 38276 bytes (46%) of dynamic memory, leaving 43644 bytes for local variables. Maximum is 81920 bytes.

There seems to be enough free mem.

luetzel commented 7 years ago

Was able to fix it for the Wemos D1 mini (https://www.wemos.cc/) by increasing

#define OUTPUT_BUFFER_SIZE 2000

in aREST.h to 3000. Now it works fine.

Cheers, /luetzel