> For the complete documentation index, see [llms.txt](https://docs.trmnl.com/go/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.trmnl.com/go/how-it-works.md).

# How it Works

Overview of TRMNL's architecture.

<figure><img src="https://1607647240-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnXhDs1PQJ2VX7ppA91eY%2Fuploads%2FA4pT22XByrC88tAJoe4a%2Ftrmnl-screen-generation-flow.png?alt=media&amp;token=4585ebe4-67c3-465a-bc3c-1e96681330ce" alt="TRMNL device <> server lifecycle"><figcaption><p>Device, Server, Plugin Sync, Screen Render</p></figcaption></figure>

The TRMNL **web server** hosts a growing directory of [first-party plugins](https://trmnl.com/integrations) and [community plugins](https://trmnl.com/recipes) that are driven by [API endpoints](https://trmnl.com/api-docs) + a [templating engine](https://help.trmnl.com/en/articles/10671186-liquid-101). Our [Framework UI](https://trmnl.com/framework) design system is recommended, but not required, for plugin development. Learn how to build custom plugins [here](https://help.trmnl.com/en/articles/9510536-private-plugins).

Our [native devices](https://shop.trmnl.com/collections/devices) feature custom PCBs powered by ESP32 controllers ranging from C3 Mini to S3 and C5, 1800-6000 mAh LiPo batteries, and 7.5" - 10.3"+ EPD screens housed in injection-molded PC or ABS soft touch plastic. Customers may disassemble their device and mod their firmware without impacting our [Terms of Service](https://trmnl.com/terms).

TRMNL **firmware** supports automatic OTA (over the air) updates to WiFi-connected devices and is [open source](https://github.com/usetrmnl/trmnl-firmware). Here's how it works:

1. Device wakes up and requests content from web server every *n* period\*
2. Web server responds with the latest pre-rendered image for that device (PNG for most models). Response JSON includes a link to this image and timing instructions for the next "refresh" request.
3. Device renders the content, then goes to sleep for the instructed amount of time.

{% hint style="info" %}
\* "N" is the device's refresh rate, anywhere from 5 minutes to 24 hours, and each item in a [Playlist](https://help.trmnl.com/en/articles/11663305-playlist-scheduler) can override it. Plugins fetch new data + re-render on their own refresh interval, so the device always gets the most recently created screen for whichever playlist item is up next.
{% endhint %}

## Opinionated device <> server relationship

Most IoT products support SSH-ing directly into peripheral devices. We've heard too many horror stories about how this can go wrong, and decided to invert the paradigm.

**Your TRMNL device pings our server, never the other way around**.

Each request to our `/api/display` endpoint ([docs](https://docs.trmnl.com/go/private-api/screens)) includes only the details needed to render the right screen + support customers -- an API key, device MAC address, firmware version, model, screen width + height, refresh rate, battery voltage + charging status, and WiFi signal strength.

**We do not collect your location or WiFi credentials.** Your local network's SSID and password are stored only on your TRMNL device. Like any web server we see your device's IP address when it checks in. We keep it for 7 days in our request logs, plus a short window while our support team is debugging your device.

When the TRMNL web server responds to a device's request we include only a few fields. These include the image link + filename, the `refresh_rate` in seconds, `update_firmware` (true/false), a direct download link to the firmware's \[public] binary package, and whether the device should be reset. Full response shape is in our [API docs](https://trmnl.com/api-docs). Customers may disable OTA updates, reset their device to transfer ownership, or destroy data from their web account.

**TRMNL does not store rendered content over time.**

Whenever the web server generates a new image it replaces the previous image. This [keeps our costs low](https://x.com/useTRMNL/status/1892058143636476374), affording perpetual service without subscription fees. This also protects users because we only have access to the most recent screen rendered for each of your plugins.
