Luos with ESP32: ESP IDF and Espressif IDE Setup
What you will learn:
You want to use Luos engine and the advantage of a Luos network with an ESP32 MCU. In this tutorial, you will learn how to use a simple button package with the ESP32 Family.
Part 1: Environment
1. Introduction
In this tutorial, we will learn how to perform the following essential actions:
- Configure the embedded environment on Espressif IDE.
- Flash a button service, create a Luos network and detect your service.
2. Set up your environment
The only two things you will need for now are an ESP32 development board and a USB cable.
Remember that Luos only covers the ESP32 series, ESP32-S2, ESP32-S3 and ESP32-C3 series.
Plug the USB cable into the USB port of the board and to a computer, then clone or download the Luos engine repository.
And here we go!
Espressif IDE (only for Windows users)
-
From the Espressif website, download the latest version of espressif IDE and follow the installation instructions.
-
Start Espressif IDE:
- Import the project in your IDE:
-
From the Luos engine folder you just cloned or downloaded, navigate to the folder ../examples/projects/ESP32/button. Import your project. Click on Finish.
-
Your project is now added in the IDE:
- Select the target you want to build.
- Click on the hammer to build your project.
- At the end of building your project, the folders build and esp_id_component are created.
- A file called sdkconfig appears, containing the default configuration for our target.
- Modify the file sdkconfig. By default, Usart Iram functions are not declared in the RAM. You must configure them in the RAM.
Find the line #CONFIG_UART_ISR_IN_IRAM is not set
and replace it with the line CONFIG_UART_ISR_IN_IRAM=y
- Now that you have placed all the necessary parts of the code in the RAM, you need to rebuild the code:
a. Choose your target and your USB port to upload the firmware:
b. Be sure that it is the right project selected to be uploaded in your board.
c. Click on run application.
You may need to press the reset button just before flashing your board.
You have successfully uploaded your first button service to an ESP Board! Ok, great, but what's the next step?
A button service is not really interesting by itself. On the second part, we will see how to detect it on a Luos network in order to be controlled.