This guide will show you how to get a Toit account, install the Toit CLI locally, prepare your ESP32 microcontroller with the Toit firmware, and finally how to deploy a Toit app on your ESP32.
Create a free Toit account to get access to the Toit cloud. Go to toit.io and follow the sign-up instructions.
Next, install the Toit CLI which is used to prepare 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.
You can buy an ESP32 here. If you already have one available, jump to step 4 to continue.
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:
Next, jump to step 5 to continue.
With your ESP32 ready for use, the first step is to initially provision your ESP32 with the Toit firmware and settings.
Connect the ESP32 with a USB cable to your computer.
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.
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
To deploy the Toit program as a long-lived app, save the following yaml content 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 triggers: 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
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:
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:
or go to the apps tab in the Toit console of your device to view the list of deployed apps.
View the logs from the device with
or go to the Logs tab in the Toit console of your device to view the logs from the device.
As the last step, uninstall the Toit app from the device with the command
or go to the Apps tab in the Toit console of your device to uninstall the app.
Congratulations! You are now ready to start developing IoT apps with Toit.