by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Clemens Kirchgatterer
@everslick
i run out of heap to prepare the whole page in rame before sending it
so i need to generate one chank, send it, generate the next aso
Me No Dev
@me-no-dev
do you know the size of the resulting page though?
Clemens Kirchgatterer
@everslick
not exactly
but i could just send a little bit more
Ivan Grokhotkov
@igrr
hmm, sounds like you might really need chunked encoding
Clemens Kirchgatterer
@everslick
to fill up the missing bytes
Clemens Kirchgatterer
@everslick
or does anybody have a good idea how to send large dynamic html code (other then the async server, which i cannot switch to in the short term)/
maybe use websocket to set innerHTML on a div
Ivan Grokhotkov
@igrr
@me-no-dev is going to implement chunked encoding in sync webserver. i think this will take him like 15 minutes.
Me No Dev
@me-no-dev
what are your issues with switching to async?
I so hate this "Merge remote tracking branch..." crap in my commits
how to get rid of it?
tried rebase and whatnot....
surely it's a one liner in terminal
Clemens Kirchgatterer
@everslick
some of my code is not 'async safe' yet
and i have no time to sort it out cleanly ATM
i have to say, you guys are awesome! :-D
Me No Dev
@me-no-dev
ok now let's see if it works :D
Clemens Kirchgatterer
@everslick
tell, if i can test it
Me No Dev
@me-no-dev
works, but it has delay at the end that should not be there
Me No Dev
@me-no-dev
yup working great :) sendContent and sendContent_P
  server.on("/chunked", HTTP_GET, [](){
    server.send(200, "text/html", String());
    server.sendContent("<!DOCTYPE html><html><head><title>Chunked Test</title></head><body>");
    server.sendContent("<p>Chunk 1</p>");
    server.sendContent("<p>Chunk 2</p>");
    server.sendContent("<p>Chunk 3</p>");
    server.sendContent("<p>Chunk 4</p>");
    server.sendContent("<p>Chunk 5</p>");
    server.sendContent("<p>Chunk 6</p>");
    server.sendContent("</html>");
    server.sendContent("");//end of chunked
  });
works on HTTP/1.1 clients
Me No Dev
@me-no-dev
@everslick if you want to test it: esp8266/Arduino#2199
no need to set contentLength to UNKNOWN anymore if you send empty string in send()
Clemens Kirchgatterer
@everslick
looks great. i will test it tomorrow. thank you very much for your support!!!
Me No Dev
@me-no-dev

no need to set contentLength to UNKNOWN anymore if you send empty string in send()

that is no longer true

Clemens Kirchgatterer
@everslick
so I have to set it to UNKNOWN and send an "" (empty string) as the last chunk?
Me No Dev
@me-no-dev
yes
the empty string means the end of the page
else it will wait 2 seconds as usual
see the example in the PR
Clemens Kirchgatterer
@everslick
great. thank you very much
Me No Dev
@me-no-dev
thanbks for asking for it :D we should have added this long time ago
Mehrdad K
@mkeyno
hi @igrr are you there
is anyone hear
I really appreciated if any one could help me about the casting issue
virtual size_t fs::File::readBytes(char*, size_t) define in FS class of
I have problem to use readBytes for reading the byte type
f.readBytes( ((byte*)leds) + i, 144);
Mehrdad K
@mkeyno
where should I recasting the variable
Ivan Grokhotkov
@igrr
how is leds variable defined?
Mehrdad K
@mkeyno
this is object form fastLED lib CRGB leds[144];
consist of 3 byte R,G,B
Ivan Grokhotkov
@igrr
what is i?
Mehrdad K
@mkeyno
the location
actually this is the code line i += FILe.readBytes( ((byte*)leds) + i, (NUM_LEDS*3)-i);
it supposed to read one 144*3 byte of data from file and fed it to the LED array to display
the compiler says , I should casted to char