Vittil

Devices

Chips

Vittil runs on every ESP-IDF 5.5 target, on whatever network your application brings up.

  • esp32, esp32s2, esp32s3, esp32c2, esp32c3, esp32c5, esp32c6, esp32c61, esp32h2, esp32p4. ESP-IDF 5.5 or later.
  • Wi-Fi, Ethernet or any other network. vittil_start() waits for it and never brings it up itself.

Adding a Coredump Partition

ESP-IDF’s usual partition tables add the coredump partition by themselves. On your own table, one line adds it.

  • The usual tables include it once CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH is on, the second line of the quickstart’s sdkconfig.
  • On your own table, make sure it has a line like this, or add one. Any name works; the type is data, the subtype coredump.
partitions.csv
coredump, data, coredump,, 64K
  • A smaller partition works too: Vittil fits the dump to it.
  • The start line at boot names the partition the device sends from.
  • Without a partition, a crash still arrives, as a crash summary: the cause and fault address, the abort or assert line, the crashed task’s registers and backtrace, the last log lines, about six, the firmware version and build.

Devices in the Field

A device already in the field reports from its first crash after the update.

  • Its partition table is the one it shipped with. An OTA update does not change it.
  • With a coredump partition in that table, the full coredump.
  • Without one, the crash summary, about a kilobyte, kept in memory a reboot does not clear and checked by a CRC32 at the next boot.

What Leaves the Device

The Coredump

After a crash, the next boot uploads the coredump: every task, the variables and the last log lines.

  • Every task’s backtrace, stacks and local variables, the global and static variables, and the last log lines.
  • Staged in flash until the server has it, then erased. Kept for the next boot otherwise.
  • Fitted to the partition. On a small one the variables are cut first (.bss, then .data, from their ends), then the other tasks’ stacks. The crashed task and the log lines are never cut, and the Issue names what was left out.
  • Without a coredump partition, the crash summary. A crash reset that left neither is reported with its reset reason.
  • The crash carries the device’s time when the clock is set (SNTP). Otherwise it is stamped when it arrives.

The Ping

Then one ping every 30 minutes, so the device shows Live.

  • Live while it pings, Offline after a day of silence. The interval is CONFIG_VITTIL_PING_INTERVAL_S.
  • Every request is HTTPS to app.vittil.io with your project key.
  • The key can only send crashes, pings and ELFs into its own project, and it is never written to the log.

The Firmware’s Cost

Typically 10 KB of flash and 5 KB of RAM. vittil_start() never blocks.

FlashTypically 10 KB.
RAM5 KB.

Decoding

The ELF

Your build uploads the ELF by itself, right after the link. Crashes are decoded against it.

  • tools/elf_upload.py sends build/<project>.elf with the project key from sdkconfig. idf.py build, idf.py flash and a CI build all run it. Nothing is added to your build commands.
  • Once per new ELF. A build that leaves the ELF unchanged sends nothing, and an ELF Vittil already has is not stored twice.
  • The build never waits on it or fails for it. Offline, it prints nothing and the next build tries again.
  • A crash from a build whose ELF has not arrived yet shows its addresses, and decodes once the ELF arrives.

Uploading an ELF by Hand

The upload can be turned off and done by hand, from the Issue page or a script.

  • CONFIG_VITTIL_ELF_UPLOAD=n turns the automatic upload off.
  • On the crash’s Issue page: Upload ELF.
  • From a script:
Terminal
curl -X PUT -H "Authorization: Bearer $VITTIL_PROJECT_KEY" \
     --data-binary @build/<project>.elf \
     https://app.vittil.io/api/firmware/<build>/elf
  • <build> is the first 9 characters of the ELF’s SHA-256 (CONFIG_APP_RETRIEVE_LEN_ELF_SHA), the build the device reports at boot.

Configuration

The Project Key

One setting: the project key, from Settings in the Vittil app.

  • idf.py menuconfig, under Vittil. Nothing else is needed.
  • For a CI, the VITTIL_PROJECT_KEY environment variable is read when the build first creates sdkconfig.
  • sdkconfig.defaults is read only for settings sdkconfig does not hold yet. On a project built before, put the two quickstart lines in sdkconfig itself.

Advanced Options

Everything else has a default. Seven options under Advanced, each with its help in menuconfig.

  • With coredump to flash on, Vittil sets three coredump settings itself: the dump on its own stack, the first crash of a crash loop kept until it is uploaded, and the global and static variables in the dump.
CONFIG_VITTIL_ELF_UPLOADyUpload the ELF at every build that changes it.
CONFIG_VITTIL_PING_INTERVAL_S1800Seconds between pings.
CONFIG_VITTIL_LOG_RING_BYTES2048Log kept for the coredump, about 25 lines.
CONFIG_VITTIL_WRITERyFit the dump to the partition, with the variables.
CONFIG_VITTIL_SUMMARYyA crash summary when there is no coredump.
CONFIG_VITTIL_SUMMARY_LOG_BYTES512Log kept in a crash summary, about six lines.
CONFIG_VITTIL_TRANSPORT_APPnSend through the application’s own transport.

The Application’s Transport

By default Vittil sends through ESP-IDF’s HTTP client. An application with an HTTP path of its own can carry Vittil’s requests instead.

  • CONFIG_VITTIL_TRANSPORT_APP=y, then three functions registered with vittil_set_transport() before vittil_start(): begin opens a POST of a known length to the URL with its two headers, write sends one piece of the body, end finishes, frees the handle and returns the HTTP status.
  • ESP-IDF’s HTTP client is then not linked for Vittil. vittil_start() refuses to start until a transport is registered.
  • Vittil calls them from its own task, one request at a time: a ping’s body under 200 bytes, a coredump’s up to the partition’s size in pieces of 3,072 bytes. The signatures are in vittil.h and the SDK README.

Your Data

Retention

The decoded crash and its dump are kept for the plan’s retention: 7 days on Free, 90 days on Starter, a year on Pro.

  • The ELF stays with the project.
  • Pings are kept 7 days.

Past the Plan’s Limit

Nothing is dropped and nothing is charged. Decoding pauses until the next month or an upgrade.

  • Crashes keep arriving and are stored, counted and grouped.
  • An upgrade decodes the backlog.
  • The free plan does not expire. Cancel any time.

Troubleshooting

Log Lines

A healthy device logs the start line at boot, one line per report and the first ping, then nothing. All lines carry the tag vittil.

A warning says what to do.

W no project key: the server will refuse every sendCONFIG_VITTIL_PROJECT_KEY is empty, or sdkconfig still holds an older value.
W CONFIG_VITTIL_PROJECT_KEY is not a Vittil project key ...Copy the key again from Settings.
E project key refused (HTTP 401): nothing more is sent until the next bootA wrong or rotated key.
W coredump partition N bytes, a dump needs at least M ...The partition is too small for any dump; crashes arrive as summaries.
W ... waiting: no network for 60 sThe SDK waits for your application’s network.
W ... failed (...), retry 1 of 5 in 23 sThe server was not reached; the SDK retries.