Adding more than 10 devices

Issue #76 new
Mario Machinè created an issue

Hi, I have a problem adding more than 10 devices. I would like to add up to 50 devices. After a lot of debug I have noticed that the JSON answer message is truncated after 2920 bytes (header + body). I have tried to modify the lwip configuration file in order to enlarge the tx buffer but without results. I have tried also to enable the "IP_FRAG" but the problem is the same. I don't know if the message body is truncated before that is tranfered to wifi library or is truncated by wifi and ESP8266 libraries.

fauxmoesp: 3.1.0 Arduino IDE 1.8.8 ESP8622 Core 2.5.0-beta2 LWIP: v1.4 Higher Bandwidth

Do you have any advice for this issue ?

Many thanks in advance. Best Regards.

Mario.

Comments (3)

  1. Maxim Prokhorov

    I think the problem is with how fauxmoESP controls sending the data: https://bitbucket.org/xoseperez/fauxmoesp/src/f60c46d80f9b8a400319ab8af9af2957eeb276aa/src/fauxmoESP.cpp#lines-335

    Because JSON response does not fully fit into the network buffer of 2920 bytes, that callback (and probably onPoll too) should be utilized to supply another chunk of data. Espalexa, for example, avoids this issue by using ESPAsyncWebServer that implements AsyncClient handlers for onPoll (periodically, while client is connected) / onAck (when client received previous data chunk). After every write it checks the return value of write, so it knows how much data was really sent.

    See web responses implementation and _fillBuffer funcs in ESPAsyncWebServer core.

  2. Log in to comment