Local ESP32 webserver with Mongoose and TTGO T-Display

  • June 10, 2025

Mongoose is an embedded networking library from Cesanta. It can give an ESP32 a local web interface and API endpoints. The Mongoose library and Mongoose OS are different projects; use the documentation for the one you are actually installing.

Start with a maintained example

Use Cesanta’s ESP32 Device Dashboard or the current Mongoose documentation as your starting point. The example’s board, SDK and build system must match. An ESP32-C6 configuration cannot simply be used on an original ESP32-based TTGO T-Display.

A practical sequence

  1. Identify the exact TTGO model, chip, flash size and USB interface on the board. Also note which display controller your board actually uses.
  2. Follow the example’s specified ESP-IDF version and build commands. Save the version or commit reference in your project.
  3. Build the unchanged networking example before adding a display or sensors.
  4. Configure your own test network according to the example. Keep passwords out of public code repositories.
  5. Read the local IP address in the log and open the page from a client on the same network.
  6. Add one endpoint with a non-sensitive test value. Test both a successful response and an unknown URL.
  7. Only then integrate the display using a library and pinout matching the particular TTGO version.

The event loop needs time

Mongoose uses events and a networking event loop. Long blocking operations in sensor code or display updates can make the webserver slow or unstable. Keep tasks short, measure response times and test over time. Do not copy function names or so-called glue files from old examples without checking that they exist in the version you use.

HTTP is not automatically HTTPS

A working HTTP endpoint does not become secure simply by changing text in a browser address. TLS requires specific configuration, including keys and certificates, and space on the device. Use the project’s current TLS examples and verify the connection at the client. A library alone also does not establish access control or secure updates.

Testing and licensing

Start on an isolated test network and do not forward ports to an unprotected prototype. Check the library licence and any commercial terms for your use. A tutorial is a learning project; production use requires a separate review of authentication, stored secrets, input validation and update strategy.

Find development boards, or first build the example using hardware you already have.

Leave a comment

Please note, comments need to be approved before they are published.