# Enrolling ESP32 Devices

The following section outlines how to enroll an ESP32 machine. It is expected that your host machine is already set up with the ESP-IDF development environment. Please refer to the [espressif docs](https://docs.espressif.com/projects/esp-idf/en/stable/esp32/get-started/index.html) for more information.

## Requirements

To have your ESP32 firmware be compatible with the Chassy Component, a few requirements need to be met.&#x20;

#### ESP-IDF Version

The Chassy Component requires at least [ESP-IDF 5.4.1.](https://github.com/espressif/esp-idf/releases/tag/v5.4.1)&#x20;

#### OTA Configuration Requirements

At a minimum, it is expected for their to be at least two OTA APP partitions present.&#x20;

An example of such configs can be found in the built in partition tables **Factory app, two OTA configurations** or **Two large size OTA partitions** in partitions.csv of ESP-IDF. More information can be found in the[ ESP-IDF docs](https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-guides/partition-tables.html).

#### Non Volatile Storage (NVS) Requirements

Non-volatile storage of at least 2kb is required. This is used to store chassy library specific information such as access keys and identification information.

&#x20;More information on how to configure the NVS can be found in the [ESP-IDF docs](https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/kconfig.html#nvs)

## Enrolling your Device

Start the enrollment process as outlined in the [Enrolling Machines guide](/user-guides/fleet-user-guide/enrolling-machines.md).&#x20;

On the Select Chip Section, select a baremetal or firmware chip and click Continue.

<figure><img src="/files/jcLbfZPh5L6QezS1LEd5" alt=""><figcaption><p>Fleet Enrollment</p></figcaption></figure>

In Step 1, ensure that your host machine has ESP-IDF 5.4.1 installed and has root access.&#x20;

In Step 2, fill in all the fields.&#x20;

Storage Offset and Storage size refers to the Non Volatile Storage (NVS) address and size.&#x20;

Serial Port refers to the COM port the ESP32 device is connected to. In most cases, this is `/dev/ttyUSB0`.&#x20;

SDKConfig Path refers to the sdkconfig file that is generated when running `idf.py menuconfig`.  For more information on how to generate an sdkconfig file, plesae refer to the [ESP-IDF docs](https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/kconfig.html).

Partition CSV Path refers to the Non Volatile Storage (NVS) csv file that is flashed to the board prior to boot. If you do not have any data to store in the NVS, leave this blank and a csv file will be generated for you. For more information on the NVS csv and it's format, please refer to the [ESP-IDF docs](https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/storage/nvs_partition_gen.html#csv-file-format).

<figure><img src="/files/378iVFUGRQytpHRIMBCF" alt=""><figcaption></figcaption></figure>

Optionally, you can also include Wi-Fi connection information such as the SSID and Password.&#x20;

## Install

Copying and executing the command on your host machine will both enroll the host machine as well as  the ESP32 device. For enrolling the device, three main steps are involved:

* Ensure partition table is configured to allow OTA updates
* Add Chassy specific information to Non Volatile Storage (NVS) csv
* Flash NVS to chip.

The final step to complete enrollment is to boot and run`heartbeat()` at least once.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.chassy.io/user-guides/fleet-user-guide/enrolling-machines/enrolling-esp32-devices.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
