Provision your hardware

The provision command flashes your hardware with the Toit firmware and connects it to the Toit cloud. During this process, your hardware is also assigned a unique hardware ID, and gets a name.

You need the Toit CLI to complete the provisioning steps below. If you haven't installed Toit on your computer yet, follow the steps described here.

Use the provision command only once per hardware device.

Follow the steps to initially provision your device:

  1. Connect the ESP32 with a USB cable to your computer where the Toit CLI is installed.
Update drivers!

If you are using macOS or Windows, you might need to update the drivers from here and here. Install both drivers, reboot your computer and try to run the Toit CLI serial commands again.

List the serial ports currently in use on your computer by running the following command with the Toit CLI

toit serial ports

To avoid mistakes when talking with your device on a serial connection, set the default serial port to be used in the CLI with

toit serial port use <port>
  1. Use the Toit CLI to provision your ESP32 with initial device settings and the latest released Toit firmware. Replace <SSID> and <password> with your own WiFi credentials in the following command:
toit serial provision -p wifi.ssid=<SSID> -p wifi.password=<password>

For example:

toit serial provision -p wifi.ssid=xyz -p wifi.password="my pw"

The WiFi settings for your ESP32 can be changed later on.

The provision commands automatically claims the device into your organization, thereby linking it with your Toit account.

  1. The provision process might take up to 5 minutes. When finished, it will output the following information:
device was successfully flashed
claiming the device
device successfully claimed
|              DEVICE ID               |  DEVICE NAME  |             HARDWARE ID              |
| 6e880945-2605-4ed7-bca6-93770bbbc064 | my-device     | 1db312cf-6d19-4c16-84d7-6b7f32b36da1 |

If you have trouble connecting your ESP32 via a serial port to your computer, or problems with flashing the ESP32, please visit the troubleshooting page.

Device models

The provision command sets the model on the device. The default model is esp32-4mb.

If you want to use another device model, you can provide it with -m in the provision command:

toit serial provision -m <model> -p wifi.ssid=<SSID> -p wifi.password=<password>

Look for available device models for each firmware version available in the Toit console.