countxerox wrote:Hi, I found out the " characters were the problem, so I can easily escape them like \".
but is there a better way to store a static page on the esp32? As I develop the page further, it's getting boring adding \'s again and again.
Thanks
Rob
hi
there are more ways for this..
one here:
try this:
example your file is named fine.txt
put this file in the folder of your project
example
\main\fine.txt
in your code write:
Code: Select all
extern const uint8_t my_extern_file[] asm("_binary_fine_txt_start");
then you can use it like you want to do:
Code: Select all
..
printf("%s", my_extern_file);
..
printf((char *)my_extern_file);
..
similar to this
you can create a html file like it is ( fine.html )
Code: Select all
extern const uint8_t my_extern_file[] asm("_binary_fine_html_start");
same procedure
Code: Select all
..
printf("%s", my_extern_file);
..
printf((char *)my_extern_file);
..
// and so on
// socket_send((char *)my_extern_file,......
if you compile your project
the file gets symbol and is fixed in the flash on write the bin to esp32
let me know how you get on in this
hope this helps
best wishes
rudi
edit:
Example: fine.tx
░♥░(¯`:´¯)░
░.(¯ `·.\|/.·´¯)
░(`♥·.(۞).·´¯)░(¯`:´¯)
░ (_.·´/|\`·._)(¯ `·.\|/.·´¯)
░ ░ (_.:._)…(¯ `·.(۞).·´¯)
░♥░ (¯`:´¯)░(_.·´/|\`·._)
♥░.(¯ `·.\|/.·´¯) ::(_.:._)
░ (¯ `·.(۞).·´¯)
░ ░(_.·´/|\`·._)
░♥♥». (_.:._)░
Example: SSL Zertifikate
OpenSSL Server Example