logo elektroda
logo elektroda
X
logo elektroda

How to respond to a GET /favicon.ico request on the ESP8266 in AT Command mode?

JarekC 1452 4
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 16978412
    JarekC
    Level 32  
    ESP8266 operating in AT Command mode connected to the uP via the UART port and configured as a WEB Server,

    If requested:
    Code: HTML, XML
    Log in, to see the code
    .
    please refer to my simple html page.

    On the other hand, how to respond to a request:
    Code: HTML, XML
    Log in, to see the code
    .
    assuming I have defined an icon in ico or png format.

    I have solved the situation for now by adding the following to the page header
    Code: HTML, XML
    Log in, to see the code
    .
    where xxx...xxx is the icon definition encoded in base64.

    In this case, the request to upload the icon (for the main page) does not come, but if I switch in the browser to one of the subpages it receives the request again.

    Theoretically I could add definitions in each subpage header but I have limited space in the uP and would prefer to just answer the GET correctly.

    Greetings
    JarekC

    PS.
    This is my first start with HTML and ESP8266
  • ADVERTISEMENT
  • #2 16983703
    zster

    Level 28  
    Take advantage of the ESP8266 file system ( SPIFFS ) and put your icon there and 'serve' it on demand exactly the same way you serve 'pages'.
  • ADVERTISEMENT
  • Helpful post
    #3 16983748
    krzbor
    Level 27  
    Try something like this
    Code: HTML, XML
    Log in, to see the code
    .
    Of course, instead of "...binary icon content..." you insert the content of the icon, and set "Content-Length" to exactly its length (instead of the example 9999). After "keep-alive" there is a free line.
  • ADVERTISEMENT
  • #4 16984589
    JarekC
    Level 32  
    Thank you for your help.

    One more question.
    The parameters I get from the forms on the site come encoded in 'url decoding':
    Code: HTML, XML
    Log in, to see the code
    .

    Is it possible to change this so that they come in standard form, without url encoding.

    Greetings
    JarekC
  • #5 16984605
    Anonymous
    Anonymous  
ADVERTISEMENT