Anniversary Sale · up to 80% off all librariesEnds Nov 9Shop now
SOFTTDocs
You are reading the documentation for ESP-DASH v4.x.x, which is no longer the latest release. View the v5.x.x documentation.

Branding

Replace the default ESP-DASH Pro v4 dashboard logo with your own image by editing the logo byte array in the library source.

ESP-DASH Pro feature. This functionality is available only in the commercial edition of ESP-DASH.

Branding refers to the logo displayed on the dashboard. You can replace the default logo by defining your image as a byte array in the logo.h and logo.cpp files of the ESP-DASH Pro library source, without modifying any HTML or CSS.

Dashboard with a custom logo

Create or obtain the logo image. SVG is recommended; PNG and JPEG are also supported. Optimize the image to keep the file size small, as it is stored in flash.

Convert the logo to a byte array

  1. Open the File2Raw utility, which converts files into C++ byte arrays.
  2. Select your logo file.
  3. Enable Gzip Compress and Use PROGMEM (Arduino).
  4. Click Convert.

Modify logo.h

  1. Open logo.h in the ESP-DASH Pro library source.

  2. Locate the DASH_LOGO declaration:

    extern const uint8_t DASH_LOGO[];
  3. Set the length of the DASH_LOGO array to the length of your logo's byte array.

  4. Set DASH_LOGO_MIME to the MIME type of your image. The default is image/png; change it if your logo uses another format, for example image/jpeg or image/svg+xml.

  5. Set DASH_LOGO_WIDTH and DASH_LOGO_HEIGHT to the size at which the logo is displayed on the dashboard.

Modify logo.cpp

  1. Open logo.cpp in the ESP-DASH Pro library source.
  2. Replace the contents of the DASH_LOGO array with the byte array generated by File2Raw.

Upload the firmware

Compile your sketch with the modified ESP-DASH Pro library and upload it to your device. The dashboard now displays your logo.

Logos and other branding elements may be protected by copyright and trademark law. Make sure you have the rights or permissions required to use them in your project.

On this page