[GH-ISSUE #842] Adding logo to the WifiManager config portal page... #708

Open
opened 2026-02-28 01:26:41 +03:00 by kerem · 15 comments
Owner

Originally created by @e-music on GitHub (Mar 5, 2019).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/842

Hi,

I want to add a banner logo on top of the config portal of WifiManager. I know how to upload the files to SPIFFS and where to insert HTML tags in the code, however, the image doesn't show up in browser.

I've seen certain examples doing it by serving HTML requests within the code, but not sure how to do the same with WifiManager.

Originally created by @e-music on GitHub (Mar 5, 2019). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/842 Hi, I want to add a banner logo on top of the config portal of WifiManager. I know how to upload the files to SPIFFS and where to insert HTML tags in the code, however, the image doesn't show up in browser. I've seen certain examples doing it by serving HTML requests within the code, but not sure how to do the same with WifiManager.
Author
Owner

@e-music commented on GitHub (Mar 7, 2019):

I guess in order for this to work out, the file and the HTML page that serves that file both have to be on SPIFFS. The problem is the way WiFiManager handles the HTML and HTTP requests. Not so sure as I'm not a web programmer, but there must be a work around to do it.

Any advice?

<!-- gh-comment-id:470328691 --> @e-music commented on GitHub (Mar 7, 2019): I guess in order for this to work out, the file and the HTML page that serves that file both have to be on SPIFFS. The problem is the way WiFiManager handles the HTML and HTTP requests. Not so sure as I'm not a web programmer, but there must be a work around to do it. Any advice?
Author
Owner

@tablatronix commented on GitHub (Mar 7, 2019):

You need an end point that serves the image

<!-- gh-comment-id:470339950 --> @tablatronix commented on GitHub (Mar 7, 2019): You need an end point that serves the image
Author
Owner

@e-music commented on GitHub (Mar 7, 2019):

Thank you. It would be nice if you can elaborate a little bit about it. I’m coming from pure embedded C background and not well founded in IOT and web programming.

<!-- gh-comment-id:470381406 --> @e-music commented on GitHub (Mar 7, 2019): Thank you. It would be nice if you can elaborate a little bit about it. I’m coming from pure embedded C background and not well founded in IOT and web programming.
Author
Owner

@tablatronix commented on GitHub (Mar 7, 2019):

I would give you examples but you didnt fill out the form, you will want to use development branch so you can add event listeners to the webserver, you cannot on stable without modifying the lib code, which is a little easier.

Also you should start with implementing it before trying to integrate into wm

https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino

<!-- gh-comment-id:470393921 --> @tablatronix commented on GitHub (Mar 7, 2019): I would give you examples but you didnt fill out the form, you will want to use development branch so you can add event listeners to the webserver, you cannot on stable without modifying the lib code, which is a little easier. Also you should start with implementing it before trying to integrate into wm https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WebServer/examples/FSBrowser/FSBrowser.ino
Author
Owner

@e-music commented on GitHub (Mar 7, 2019):

Thank you. Examples would help a lot. But, what “form” are you talking about, I didn’t get it.

<!-- gh-comment-id:470394555 --> @e-music commented on GitHub (Mar 7, 2019): Thank you. Examples would help a lot. But, what “form” are you talking about, I didn’t get it.
Author
Owner

@tablatronix commented on GitHub (Mar 7, 2019):

When you opened the issue there was not a form in the field that you removed?

<!-- gh-comment-id:470599570 --> @tablatronix commented on GitHub (Mar 7, 2019): When you opened the issue there was not a form in the field that you removed?
Author
Owner

@tablatronix commented on GitHub (Mar 7, 2019):

There is an example on route handling in this example in development

https://github.com/tzapu/WiFiManager/blob/development/examples/DEV/OnDemandConfigPortal/OnDemandConfigPortal.ino

<!-- gh-comment-id:470599969 --> @tablatronix commented on GitHub (Mar 7, 2019): There is an example on route handling in this example in development https://github.com/tzapu/WiFiManager/blob/development/examples/DEV/OnDemandConfigPortal/OnDemandConfigPortal.ino
Author
Owner

@e-music commented on GitHub (Mar 7, 2019):

Yes, I get it. I will use it for new issues if that helps.
Thank you for the examples.

<!-- gh-comment-id:470714220 --> @e-music commented on GitHub (Mar 7, 2019): Yes, I get it. I will use it for new issues if that helps. Thank you for the examples.
Author
Owner

@e-music commented on GitHub (Mar 8, 2019):

This sketch "OnDemandConfigPortal.ino" didn't compile. It has tons of issues!

<!-- gh-comment-id:470806867 --> @e-music commented on GitHub (Mar 8, 2019): This sketch "OnDemandConfigPortal.ino" didn't compile. It has tons of issues!
Author
Owner

@e-music commented on GitHub (Mar 8, 2019):

I've been trying for the past 8 hours but couldn't figure it out. I know that I have to understand how HTTP server works, but for the time being, it would be very helpful if you can provide an example for WM with logo on the config portal page (Captive portal).

<!-- gh-comment-id:470839460 --> @e-music commented on GitHub (Mar 8, 2019): I've been trying for the past 8 hours but couldn't figure it out. I know that I have to understand how HTTP server works, but for the time being, it would be very helpful if you can provide an example for WM with logo on the config portal page (Captive portal).
Author
Owner

@e-music commented on GitHub (Mar 8, 2019):

By the way, what makes things more complicated for me is the way the HTML is served. Why not make the HTML pages in SPIFFS instead of using PROGMEM so one can easily customize the page by applying CSS stylesheets and adding customs images.

<!-- gh-comment-id:470840146 --> @e-music commented on GitHub (Mar 8, 2019): By the way, what makes things more complicated for me is the way the HTML is served. Why not make the HTML pages in SPIFFS instead of using PROGMEM so one can easily customize the page by applying CSS stylesheets and adding customs images.
Author
Owner

@tablatronix commented on GitHub (Mar 8, 2019):

because then users need to upload the filesystem and it adds complexity and bloat, wm is not a web server, so we do not want to head in that direction. Maybe in a future version

<!-- gh-comment-id:471010982 --> @tablatronix commented on GitHub (Mar 8, 2019): because then users need to upload the filesystem and it adds complexity and bloat, wm is not a web server, so we do not want to head in that direction. Maybe in a future version
Author
Owner

@rafalfigura commented on GitHub (Mar 21, 2019):

e-music, have you tried to convert image to base64 and serve that in html?
img src="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUA
AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot" /

<!-- gh-comment-id:475338412 --> @rafalfigura commented on GitHub (Mar 21, 2019): e-music, have you tried to convert image to base64 and serve that in html? img src="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUA AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO 9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot" /
Author
Owner

@xtech007 commented on GitHub (Apr 4, 2020):

Hi!
Did any of the above worked?
Where you able to add the logo?
If so can you show us, and where in the code!

<!-- gh-comment-id:609049175 --> @xtech007 commented on GitHub (Apr 4, 2020): Hi! Did any of the above worked? Where you able to add the logo? If so can you show us, and where in the code!
Author
Owner

@georgevbsantiago commented on GitHub (May 14, 2021):

In the file "strings_en.h" there is a commented PROGMEM with an example of how to insert a logo. It is to generate the representation of the image in base64 (there are free generators on the internet) See below the code snippet:

// const char HTTP_ROOT_MAIN[]        PROGMEM = "<img title=' alt=' src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAADQElEQVRoQ+2YjW0VQQyE7Q6gAkgFkAogFUAqgFQAVACpAKiAUAFQAaECQgWECggVGH1PPrRvn3dv9/YkFOksoUhhfzwz9ngvKrc89JbnLxuA/63gpsCmwCADWwkNEji8fVNgotDM7osI/x777x5l9F6JyB8R4eeVql4P0y8yNsjM7KGIPBORp558T04A+CwiH1UVUItiUQmZ2XMReSEiAFgjAPBeVS96D+sCYGaUx4cFbLfmhSpnqnrZuqEJgJnd8cQplVLciAgX//Cf0ToIeOB9wpmloLQAwpnVmAXgdf6pwjpJIz+XNoeZQQZlODV9vhc1Tuf6owrAk/8qIhFbJH7eI3eEzsvydQEICqBEkZwiALfF70HyHPpqScPV5HFjeFu476SkRA0AzOfy4hYwstj2ZkDgaphE7m6XqnoS7Q0BOPs/sw0kDROzjdXcCMFCNwzIy0EcRcOvBACfh4k0wgOmBX4xjfmk4DKTS31hgNWIKBCI8gdzogTgjYjQWFMw+o9LzJoZ63GUmjWm2wGDc7EvDDOj/1IVMIyD9SUAL0WEhpriRlXv5je5S+U1i2N88zdPuoVkeB+ls4SyxCoP3kVm9jsjpEsBLoOBNC5U9SwpGdakFkviuFP1keblATkTENTYcxkzgxTKOI3jyDxqLkQT87pMA++H3XvJBYtsNbBN6vuXq5S737WqHkW1VgMQNXJ0RshMqbbT33sJ5kpHWymzcJjNTeJIymJZtSQd9NHQHS1vodoFoTMkfbJzpRnLzB2vi6BZAJxWaCr+62BC+jzAxVJb3dmmiLzLwZhZNPE5e880Suo2AZgB8e8idxherqUPnT3brBDTlPxO3Z66rVwIwySXugdNd+5ejhqp/+NmgIwGX3Py3QBmlEi54KlwmjkOytQ+iJrLJj23S4GkOeecg8G091no737qvRRdzE+HLALQoMTBbJgBsCj5RSWUlUVJiZ4SOljb05eLFWgoJ5oY6yTyJp62D39jDANoKKcSocPJD5dQYzlFAFZJflUArgTPZKZwLXAnHmerfJquUkKZEgyzqOb5TuDt1P3nwxobqwPocZA11m4A1mBx5IxNgRH21ti7KbAGiyNn3HoF/gJ0w05A8xclpwAAAABJRU5ErkJggg==' /><h1>{v}</h1><h3>WiFiManager</h3>";
const char HTTP_ROOT_MAIN[]        PROGMEM = "<h1>{v}</h1><h3>WiFiManager</h3>";
<!-- gh-comment-id:840960191 --> @georgevbsantiago commented on GitHub (May 14, 2021): In the file "strings_en.h" there is a commented PROGMEM with an example of how to insert a logo. It is to generate the representation of the image in base64 (there are free generators on the internet) See below the code snippet: ``` // const char HTTP_ROOT_MAIN[] PROGMEM = "<img title=' alt=' src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAADQElEQVRoQ+2YjW0VQQyE7Q6gAkgFkAogFUAqgFQAVACpAKiAUAFQAaECQgWECggVGH1PPrRvn3dv9/YkFOksoUhhfzwz9ngvKrc89JbnLxuA/63gpsCmwCADWwkNEji8fVNgotDM7osI/x777x5l9F6JyB8R4eeVql4P0y8yNsjM7KGIPBORp558T04A+CwiH1UVUItiUQmZ2XMReSEiAFgjAPBeVS96D+sCYGaUx4cFbLfmhSpnqnrZuqEJgJnd8cQplVLciAgX//Cf0ToIeOB9wpmloLQAwpnVmAXgdf6pwjpJIz+XNoeZQQZlODV9vhc1Tuf6owrAk/8qIhFbJH7eI3eEzsvydQEICqBEkZwiALfF70HyHPpqScPV5HFjeFu476SkRA0AzOfy4hYwstj2ZkDgaphE7m6XqnoS7Q0BOPs/sw0kDROzjdXcCMFCNwzIy0EcRcOvBACfh4k0wgOmBX4xjfmk4DKTS31hgNWIKBCI8gdzogTgjYjQWFMw+o9LzJoZ63GUmjWm2wGDc7EvDDOj/1IVMIyD9SUAL0WEhpriRlXv5je5S+U1i2N88zdPuoVkeB+ls4SyxCoP3kVm9jsjpEsBLoOBNC5U9SwpGdakFkviuFP1keblATkTENTYcxkzgxTKOI3jyDxqLkQT87pMA++H3XvJBYtsNbBN6vuXq5S737WqHkW1VgMQNXJ0RshMqbbT33sJ5kpHWymzcJjNTeJIymJZtSQd9NHQHS1vodoFoTMkfbJzpRnLzB2vi6BZAJxWaCr+62BC+jzAxVJb3dmmiLzLwZhZNPE5e880Suo2AZgB8e8idxherqUPnT3brBDTlPxO3Z66rVwIwySXugdNd+5ejhqp/+NmgIwGX3Py3QBmlEi54KlwmjkOytQ+iJrLJj23S4GkOeecg8G091no737qvRRdzE+HLALQoMTBbJgBsCj5RSWUlUVJiZ4SOljb05eLFWgoJ5oY6yTyJp62D39jDANoKKcSocPJD5dQYzlFAFZJflUArgTPZKZwLXAnHmerfJquUkKZEgyzqOb5TuDt1P3nwxobqwPocZA11m4A1mBx5IxNgRH21ti7KbAGiyNn3HoF/gJ0w05A8xclpwAAAABJRU5ErkJggg==' /><h1>{v}</h1><h3>WiFiManager</h3>"; const char HTTP_ROOT_MAIN[] PROGMEM = "<h1>{v}</h1><h3>WiFiManager</h3>"; ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#708
No description provided.