Hello,
i'm trying to modify a library and i need to change only the link of image generated in a webpage code.
The problem is that the code is defined in a giant sequence of numbers and i believe that this sequence is the conversion of a vue code into this numbers(i think that this is the Raw).
Someone can help me with this question? I can give more details if you know about this.
(sorry for my english)
J-M-L
March 1, 2023, 2:01pm
2
that would certainly be needed. a link to the library would be a good start
caio-iot:
i'm trying to modify a library and i need to change only the link of image generated in a webpage code.
The problem is that the code is defined in a giant sequence of numbers and i believe that this sequence is the conversion of a vue code into this numbers(i think that this is the Raw).
Do you mean something like the file "webserial_webpage.h"? I'm going to guess that's Compressed (gzip) Format. See HERE .
ua6em
March 1, 2023, 3:30pm
6
AsyncWebServerResponse *response = request->beginResponse_P(200, "text/html", WEBSERIAL_HTML, WEBSERIAL_HTML_SIZE);
response->addHeader("Content-Encoding","gzip"); )))
that's exactly it.
From what I understand, the numerical codes stored in this file are the web page, however, in another format (gzip). the question is that I need to modify this code by another one that I modified. How do I get this?
I know this part of the library code. the part I'm interested in is in webserial_webpage.h.
caio-iot:
How do I get this?
I guess you would have to:
Decompress the gzip into HTML (the link I provided tells you how).
Make your changes to the HTML.
Recompress the HTML back into gzip (I don't know how to do this).
I understand this procedure, I will try this way.
But i don't know how recompress the HTML again.
sorry, but I didn't find this screen in the program.
That appears to generate a gzip file in binary format. OP needs ASCII-HEX.
ua6em
March 1, 2023, 6:27pm
15
First you need to compress, get GZIP, then convert byte by byte
GZIP file == 60kb )))
ua6em
March 2, 2023, 2:28pm
16
and with a carved "coffee" block
How i convert byte by byte?
I don't know how to do this.
ua6em
March 2, 2023, 5:00pm
18
first convert to gzip then convert to header
For the latter, there are many ways to automate,
bin2c utility for example
Ok, i undestand.
But this converter work for the case of Webserial code?
const uint32_t WEBSERIAL_HTML_SIZE = 57228;
const uint8_t WEBSERIAL_HTML[] PROGMEM = { the values here in numeric format without the '0x'};
ua6em
March 2, 2023, 5:35pm
20
You probably still need to read the basics of C ++, number representation formats in particular