Quick start guide

This guide will show you how to sign up with Toit, setup your local development environment, install the Toit firmware on your ESP32 , and finally how to deploy a Toit app on your ESP32.

1. Sign up

At toit.io, click the Start Now button to create a free Toit account.

2. Install Toit

Download and install the Toit development environment from here.

3. Get an ESP32

If you already have an ESP32 available, jump to step 4 to continue.

Otherwise, you can buy one here.

In the meantime, you can start a Toit simulator from the Toit CLI with:

toit simulator start

Then, jump to step 5 to continue.

4. Provision your ESP32

To install the latest Toit firmware on your ESP32, connect the ESP32 with a USB cable to your computer.

Open a terminal window, and replace MY_SSID and my_password with your own WiFi credentials and run the Toit CLI command to initially provision your hardware with the Toit firmware and WiFi settings:

toit serial provision -p wifi.ssid="MY_SSID" -p wifi.password="my_password"

At the end of the provisioning process, you will receive the name of the device, and a URL to view the device in the Toit console. When your device is online, all device communication will be over-the-air.

Your device has now been added to your Toit project. Only users with access to the same Toit project can communicate with the device via the Toit cloud.

5. Write a Toit app

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

First, create a project folder and save the following Toit code in a file named hello.toit using Visual Studio Code.

// Save as hello.toit
  print "Hello, World!"

Save the following yaml code in a file named hello.yaml and place it in the same folder as the hello.toit file from above:

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

Note! Install the Toit extension for Visual Studio Code for better language support.

Find more Toit code examples here.

6. Deploy a Toit app

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 following command. Replace device-name with the actual name of your device.

toit deploy -d device-name 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

Run the following command (replace device-name with the actual name of your device)

toit device -d device-name ps

View the logs from the device

Run the following command (replace device-name with the actual name of your device)

toit device -d device-name logs -f 10m

7. Uninstall Toit app

Uninstall the Toit app from the device:

Run the following command (replace device-name with the actual name of your device)

toit device -d device-name uninstall HelloApp

8. What's next?

Congratulations! You are now ready to start developing IoT projects using Toit. Next step, look in the tutorials or dive into the Toit language guide.