Convert file to Raw code for use with arduino IDE

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)

that would certainly be needed. a link to the library would be a good start

apparently it's SVG

The library is WebSerial.

link: GitHub - ayushsharma82/WebSerial: Remote Serial monitor for ESP8266 & ESP32

Do you mean something like the file "webserial_webpage.h"? I'm going to guess that's Compressed (gzip) Format. See HERE.

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.

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).

7-ZIP THIS
7-zip

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.

7-zip-1

That appears to generate a gzip file in binary format. OP needs ASCII-HEX.

First you need to compress, get GZIP, then convert byte by byte
GZIP file == 60kb )))

and with a carved "coffee" block

How i convert byte by byte?

I don't know how to do this.

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'};

You probably still need to read the basics of C ++, number representation formats in particular