Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By Th3On3Fr33man
#48862
anotherjoe wrote:I use a flavour of the FSBrowser code sample embedded within my project code and I have to say that what you've described sounds familiar. For the most part it does work fine for me but on occasion I do see an issue where a html file is uploaded, is stored in SPIFFS and it somehow gets corrupted in the process. The problem manifests itself in the way you describe where when that file is later served by the webserver and it looks like it contains garbled / missing / corrupted content resulting in broken render and broken JS in the browser.

When it happens, I immediately attempt to upload the file again via the FSBrowser and more often than not it sorts itself out on the second attempt. For some reason sometimes it takes 3 or 4 goes to get the file stored successfully. On just a couple of occasions over a 6 month period, SPIFFS flash has appeared to get completely corrupted and I've had to perform a SPIFFS format and re-upload the files over serial to straighten things out.

I've not got to the bottom of why this happens and my project code and device is generally well behaved and rock solid stable at runtime with plenty of free heap memory available. So this problem is more an annoyance than a showstopper here.


I'm not sure how applicable this is though because like I said I've checked the code once it's on the server (through the /edit page) and it looks fine?
User avatar
By Th3On3Fr33man
#48863
Me-no-dev wrote:I used to get those problems as well, but have not really had them in a while. Even uploading has not been braking the files recently (Using Async). As for the name to access the ESP, that is controlled by MDNS
Code: Select allMDNS.begin("myesp");//respond to myesp.local
MDNS.addService("http","tcp",80);//add the web server as advertised service


I mean it really needs to be able to work without those problems happening ever...

I tried a few things, I minimized my code by zipping them into gzip files with 7-zip, I removed jQuery and adjusted my code so that it wasn't necessary anymore and that seemed to fix the issues that were occurring before...

I tried your MDNS commands and I can't seem to get that to work though.

Code: Select all#include <ESP8266mDNS.h>
const char* host = "esp8266fs";
MDNSResponder mdns;
MDNS.begin(host);
MDNS.addService("http","tcp",80);//add the web server as advertised service


What's even weirder is...the hostname link worked only on my computer (and no one else's on the network) when I had the esp powered by the PC (with an FTDI header cable), but then when I switch to an external power supply it doesn't work on mine anymore (and still doesn't work on anyone else's).
User avatar
By Th3On3Fr33man
#48880
Me-no-dev wrote:
Code: Select allMDNSResponder mdns;

is not required anymore ;) MDNS is the global service (like SPI or Serial)


Ok I took that line out but I still can barely get the host to work on my computer, and it definitely never works on anyone else's.