These are chat archives for esp8266/Arduino

21st
Sep 2017
Me No Dev
@me-no-dev
Sep 21 2017 03:32
you refresh /test.html but your browser also requests the little image that can show up in the title bar and since you do not request->send(response); you leak
dragon-engineer
@dragon-engineer
Sep 21 2017 04:05
yes the favicon!! I forgot it! good point
Me No Dev
@me-no-dev
Sep 21 2017 04:07
in any way and in any handler you should always respond to each request in some way
dragon-engineer
@dragon-engineer
Sep 21 2017 04:09
yes definitely, that NotFound handler was your suggestion btw :smile: I asked you how to serve a SPIFFS static file in a custom handler and you sent me this, it worked so I didn't try it for stability/memory leaks
Me No Dev
@me-no-dev
Sep 21 2017 04:09
never my idea not to actually request->send(response) ;)
dragon-engineer
@dragon-engineer
Sep 21 2017 04:10
that's not it
Me No Dev
@me-no-dev
Sep 21 2017 04:10
what is not it?
dragon-engineer
@dragon-engineer
Sep 21 2017 04:10
ah sorry you are right, it's the ending of AsyncWebServerResponse *response = request->beginResponse(SPIFFS, "/404.html");
so what's better way? I asked here and got this solution suggested...
Me No Dev
@me-no-dev
Sep 21 2017 04:11
server.onNotFound([](AsyncWebRequest * request){
  AsyncWebServerResponse *response = request->beginResponse(SPIFFS, "/404.html");
  response->setCode(404);
  request->send(response); //<<<very important line of code ;)
}
oops
dragon-engineer
@dragon-engineer
Sep 21 2017 04:15
It's there.. I wrote it for the first time and then just omitted it
the problematic handler looks exactly like yours :smile:
Me No Dev
@me-no-dev
Sep 21 2017 04:16
then it should not leak… I do not get it...
dragon-engineer
@dragon-engineer
Sep 21 2017 04:16
yes, that's why I didn't test it earlier, nothing suspicious around
when I use request->send(404, "text/html", "404 Not Found"); it's all good
Me No Dev
@me-no-dev
Sep 21 2017 04:18
what id you just request->send(SPIFFS, "/404.html”);
dragon-engineer
@dragon-engineer
Sep 21 2017 04:19
unfortunately I didn't take my ESP module to work again :clap: so I can either send you a zipped solution with html or I'll do it myself in the evening
Me No Dev
@me-no-dev
Sep 21 2017 04:19
you do have “/404.html”in the file system right?
dragon-engineer
@dragon-engineer
Sep 21 2017 04:20
yes :smile:
Me No Dev
@me-no-dev
Sep 21 2017 04:20
please do try tonight
dragon-engineer
@dragon-engineer
Sep 21 2017 04:20
it serves the file but leaks
ok I will do the test
Me No Dev
@me-no-dev
Sep 21 2017 04:21
how big is that file?
dragon-engineer
@dragon-engineer
Sep 21 2017 04:21
like 3kB
Me No Dev
@me-no-dev
Sep 21 2017 04:21
hmmm then it’s not the SPIFFS bug we have been having...
dragon-engineer
@dragon-engineer
Sep 21 2017 04:21
when serving large files?
Me No Dev
@me-no-dev
Sep 21 2017 04:21
yes
dragon-engineer
@dragon-engineer
Sep 21 2017 04:22
yes I wouldn't expect/torture the ESP with megabytes of files
Me No Dev
@me-no-dev
Sep 21 2017 04:22
30K is enough to trigger it :)
dragon-engineer
@dragon-engineer
Sep 21 2017 04:23
oh :smile: a different story then
however, I used to been using gzip compression in my project, and when I just updated SDK to the latest, it's all buggy
*have been, damn
I used this scheme: in SPIFFS just GZipped files, delete normal .css/.js . in the SPIFFS static file handlers was normal .js and path to SPIFFS file .js
this worked like charm until I updated
now it sends garbage (plain gzipped text, without decompressing in the browser)
Me No Dev
@me-no-dev
Sep 21 2017 04:27
it still might be connected to the same issue. Does the file editor open fine?
if gzip has errors it would not be recognized and decompressed so it will spit crap
dragon-engineer
@dragon-engineer
Sep 21 2017 04:27
I haven't try the editor actually..but will do tonight
Me No Dev
@me-no-dev
Sep 21 2017 04:27
editor runs from flash and is gzipped
not SPIFFS ;)
dragon-engineer
@dragon-engineer
Sep 21 2017 04:30
I thought the memory might have been corrupted somehow so I even tried another NodeMcu module but with the same result. Then I changed the SPIFFS static handler so that it points to the file .js.gz in the filesystem, then it works a little better, no garbage, but it's a 48kB file and two characters in the javascript are wrong.. instead of quotes there is | character, therefor the script won't work.
I triple checked and reuploaded to the flash but still same, cleaned cache but still sends wrong characters (just the same ones)
Me No Dev
@me-no-dev
Sep 21 2017 05:59
@matasondrak fixes for SPIFFS are coming ;) hang tight :)
dragon-engineer
@dragon-engineer
Sep 21 2017 06:00
great to hear it because it's actually worse than older releases which worked fine :smile: looking forward to it
Me No Dev
@me-no-dev
Sep 21 2017 07:08
it’s a brand new bug :D anjoy :D
dragon-engineer
@dragon-engineer
Sep 21 2017 07:10
so (no critically important) update created much worse bugs ? :smile: windows users like me know that very well
Me No Dev
@me-no-dev
Sep 21 2017 07:11
:D:D:D:D exactly
dragon-engineer
@dragon-engineer
Sep 21 2017 07:12
alright, I'll be available for tests when you release some update, I have both 32Mbit and custom resolderes 64Mbit flash variants
when will we be able to use 64Mbit btw?
Me No Dev
@me-no-dev
Sep 21 2017 07:13
@matasondrak PR is esp8266/Arduino#3623
oh.. I got some 16MB wemoses as well to test this :) I vote for extending the day to 36 hours instead of 24
24 are way not enough...
dragon-engineer
@dragon-engineer
Sep 21 2017 07:14
indeed
all in all, the bug is both in mkspiffs and in sdk?
Me No Dev
@me-no-dev
Sep 21 2017 07:30
yes. update was synced across both (well add ESP32 to that too)
dragon-engineer
@dragon-engineer
Sep 21 2017 08:05
and the fix is already in release ? I read that you were about to do it 'tomorrow', and it was 2 days ago :smile:
Me No Dev
@me-no-dev
Sep 21 2017 08:06
I have actually done it in IDF (work repository and not github) and it’s on it’s way to be merged in IDF any moment/day now. The same is true for ESP8266 and mkspiffs (though the PR is not mine)
dragon-engineer
@dragon-engineer
Sep 21 2017 08:07
ok thx for info
Me No Dev
@me-no-dev
Sep 21 2017 08:07
so I kept my word :D
Bryce Schober
@bryceschober
Sep 21 2017 18:39
@me-no-dev : Do you have any comment on the UDP broadcast being limited to 25ms packet rate vs. UDP unicast?