Quick Start Guide

This guide takes you from signing up for a Toit account, to install the Toit CLI locally and get an ESP32 microcontroller, and finally how to deploy a Toit app on your ESP32 or a simulated device.

1. Sign up

Create a free Toit account to get access to the Toit cloud. Go to toit.io and follow the sign-up instructions.

Shortly after, you'll receive a welcome email with a link to set the password for your Toit account.

2. Install Toit

Next, install the Toit CLI which is used for preparing your ESP32 with Toit, and to deploy Toit apps. Download here.

On macOS and Linux, put the Toit CLI manually to PATH. If you need help, follow the step by step instructions here.

On Windows, the Toit CLI is automatically put on PATH by the installer.

3. Get an ESP32

You can buy an ESP32 here. If you already have one available, jump to step 4 to continue.

Don't have an ESP32 yet?

In the meantime, use the Toit playground or a simulated device to continue learning about the Toit platform. Start a new Toit simulator from the Toit console by clicking the "Start simulator" button, or run the following command in the Toit CLI:

toit simulator start --alias MyToitDevice

Next, jump to step 5 to continue.

4. Provision your ESP32

With your ESP32 ready for use, the first step is to initially provision your ESP32.

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

Replace SSID and password with your own WiFi credentials and run the Toit CLI command:

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

At the end of the provisioning process, you will receive the name of the device, and a URL to view it in the Toit console. If there were errors, please consult the provision or troubleshooting pages.

5. Deploy Toit app

You can either run a Toit program once on your ESP32 or deploy the same Toit program as a long-lived app.

First, save the following Toit code in a file named hello.toit

// Save as hello.toit
  print "Hello, World!"
Run program on a device
Run the Toit program once on your device with the CLI command
toit run -d MyToitDevice hello.toit

To deploy the Toit program as a long-lived app, save the following yaml content in a file named hello.yaml and place it next to the hello.toit from above:

# Save as hello.yaml
name: "HelloApp"
entrypoint: hello.toit
  on_boot: true
  on_install: true

Deploying a Toit app on your device means that the Toit code in the toit file will be executed repeatedly according to the scheduling defined in hello.yaml. In this case, when the app is installed on the device and if the device reboots.

Deploy the Toit app named HelloApp on your device with the command:

toit deploy -d MyToitDevice hello.yaml

When deploying an app, the device is not required to be online. The app will be installed on the device when it comes online.

Verify that the app has been deployed with the command:

toit device -d MyToitDevice ps

or go to the Apps tab of your device to view the list of apps deployed.

View the logs from the device with

toit device -d MyToitDevice logs -f 10m

or go to the Logs tab of your device to view the logs from the application deployed.

6. Uninstall Toit app

As the last step, uninstall the Toit app from the device with the command

toit device -d MyToitDevice uninstall HelloApp

or go to the Apps tab of your device to uninstall the app.