I've been trying to find a sufficient way to store, webfiles on the ESP both for the ESP32 and ESP8266. I've tried a few different things so fare: Storing the files in SPIFFS, but was to slow to retrieve the data, and then timed out... Typing the HTML in a simple char array in progmem, but was too pain full process to keep updating it, for every single change in webfiles...
I then came by spacehuhn's esp8266_deauther https://github.com/spacehuhn/esp8266_de ... web_server
where he had clever way of doing it.
By running a .sh file, which took every single file and minified it, then converted it to a huge const char array with the hex values for every single file.
I tried using his version of it, with my own HTML, but without luck... So I instead made my own version written in Python, which did the same thing Github ESP-HTML-Compressor.
It works perfect for HTML files, but not quite with CSS and Javascript files...
After being compressed by the python script, and uploaded on the ESP32 to test, it delivers all the files as expected, but not in the correct format.
What could be the cause of this?
Btw I've a put in an example in my Github project, which could reproduce the problem.
Compressing Large HTML,CSS,JS files in ESP Progmem
-
- Posts: 21
- Joined: Fri Jan 25, 2019 3:36 pm
Re: Compressing Large HTML,CSS,JS files in ESP Progmem
Hi,
Possibly one of the minifiers is removing something that is needed. Did you try using the web versions to see if something was stripped from the JS file. Sometimes comments in the code can cause a problem.
I want to go the other way... I want to get the original HTML out of this file:
https://github.com/espressif/arduino-es ... ra_index.h
I imagine it's been gzipped and then turned into a const char array. Any ideas? I've tried various recipes with this: https://gchq.github.io/CyberChef/
Possibly one of the minifiers is removing something that is needed. Did you try using the web versions to see if something was stripped from the JS file. Sometimes comments in the code can cause a problem.
I want to go the other way... I want to get the original HTML out of this file:
https://github.com/espressif/arduino-es ... ra_index.h
I imagine it's been gzipped and then turned into a const char array. Any ideas? I've tried various recipes with this: https://gchq.github.io/CyberChef/
Re: Compressing Large HTML,CSS,JS files in ESP Progmem
Run the sketch, connect to server, load page, save it.xgarbxgarb wrote: ↑Fri Jan 25, 2019 3:50 pmI want to go the other way... I want to get the original HTML out of this file:
https://github.com/espressif/arduino-es ... ra_index.h
-
- Posts: 21
- Joined: Fri Jan 25, 2019 3:36 pm
Re: Compressing Large HTML,CSS,JS files in ESP Progmem
In the end I used the CyberChef website to convert the HTML to the format I needed. I put it on my blog here: https://robotzero.one/esp32-cam-custom-html/
Who is online
Users browsing this forum: No registered users and 45 guests