Download PDF
        SAMOVAR 
×
Menu

Preparing the ESP32 for upload

Samovar 7.00: the instructions below using the Arduino IDE remain a valid installation method. As an equal option you can use the configurator: flash_windows.bat on Windows (only 64-bit Windows 10/11) or flash_macos_linux.sh on macOS/Linux. The configurator installs PlatformIO and the required ESP32 core version itself; the Arduino IDE is not needed for it. See Building and flashing with PlatformIO. The USB controller driver (below) is needed in any case.
 
If you have an ESP32, you can already upload the sketch and test how Samovar works.
First, simply connect the ESP32 to a USB port of the computer.
The ESP32 board has an onboard USB and a CH340/CH341 or CP210x controller (this is usually stated on the product page)
Look in "This PC > Properties > Device Manager - Ports (COM & LPT)" («Этот компьютер > Свойства > Диспетчер устройств - Порты (COM и LPT)»); a new port should appear.
 

 
If the computer has detected new hardware but has not installed the driver, the new port will not appear. You need to download the drivers for the controller on your ESP32 board and install them manually.
Download the driver CH340/CH341 (Windows, Mac, Linux)
Download the  drivers 210/341 from our website, Windows only.
 
To upload the sketch to the ESP32, you need to install the Arduino IDE. It is used as a sketch editor, as a sketch compiler, and also for uploading the compiled program to the ESP32..
 
Below and further on, a method of the initial installation of the Samovar sketch to the ESP32 is offered that will give a guaranteed positive result.
 
We download  and install the Arduino IDE version 1.8.x.
Preparing the ESP32 for upload
1

Download the installer

The installer for installing in the operating system
2

Download the zip archive

For running without installing in the OS
Whichever  option you choose, you will be asked to thank the developers; that is up to you.
If you just want to download the program, press the "JUST DOWNLOAD" button. Another window opens offering to subscribe to the news; press the "JUST DOWNLOAD" button again.
A file will be downloaded. If you chose the zip archive, unpack it anywhere on the computer (it is advisable to avoid Cyrillic characters in the directory path).
If you chose to install the program, it is recommended not just to install it into the default directory but to add the version number to the directory name. This will make later use easier.
 
For example.
C:\Program Files(x86)\Arduino1_1_18;
C:\Program Files(x86)\Arduino1_1_16
 
After installing the Arduino IDE, it must be taught to work with the ESP32; by default it cannot.
Note: 
If this field already contains a link to the descriptions of other boards, the links can be separated with commas. Like this:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json, http://arduino.esp8266.com/stable/package_esp8266com_index.json
Attention!
If this field contains the link https://dl.espressif.com/dl/package_esp32_index.json, it must be removed.
 
 
 
Next, in the Arduino IDE open the "Boards Manager" («Менеджер плат»).
To do this, click "Tools" > "Board" > "Boards Manager…" («Инструменты» > «Плата» > «Менеджер плат…»).
 
A new window opens. In the search field type “esp32”. The add-on  (or  another commonly used name, SDK) for ESP32 will be found: “ESP32 by Espressif Systems”.
 
In the drop-down menu select version 2.0.17, press - Install («Установка»)  and wait for the installation to finish
 
Note: 
If the add-on is already installed but its version is different, remove it and install 2.0.17
The PlatformIO configurator uses exactly version 2.0.17 too. The sketch also builds with core 3.x, but the WiFi update (USE_UPDATE_OTA) is automatically disabled in it, and the Samovar partition table must be added to the core manually (see Sketch update).
 
 
 
Restart the Arduino IDE, then select the required board in the menu "Tools" > "Board > ESP32 Arduino" («Инструменты» > «Плата > ESP32 Arduino»).
In our case it is “DOIT ESP32 DEVKIT V1”.
 
 
 
 
Check that in  "Tools > Port > Serial ports" («Инструменты > Порт > Последовательные порты») the port the board is connected to is selected.
 
 
 
Now we need to check that everything is done correctly.
In the Arduino IDE, open the example sketch “WiFi Scan”.
To do this, click "File" > "Examples" >  (subsection: examples for DOIT ESP32 DEVKIT V1) > "WiFi" > "WiFi Scan" («Файл» > «Примеры» > ... > «WiFi» > «WiFi Scan»); the sketch opens in the editor window.
Click the "Upload" («Загрузка»)  button in the Arduino IDE. Wait a while for the code to compile and upload to the ESP32 board. The upload button icon looks like this:
 
 
When the sketch is uploaded to the ESP32 successfully, you should see the message "Done uploading" («Загрузка завершена»)
 
In the Arduino IDE open "Tools" > "Serial Monitor" («Инструменты» > «Монитор порта») and set the data rate to 115200 baud.
Reconnect the ESP32 to the USB port. As a result you should see in the serial monitor all the Wi-Fi networks around the ESP32 board.
This completes the setup and check of the ESP32.

If the ESP32 was used before in other projects or the Samovar sketch uploads incorrectly, you need to erase the flash memory of the ESP32 module
 
 In the Arduino IDE
The Arduino IDE has an "Erase Flash" option. To erase the flash memory:
 
1. Select the suitable ESP32 board from the "Tools" → "Board" menu («Инструменты» → «Доска»).
2. Select the correct COM port from the "Tools" → "Port" menu.
3. Go to the "Tools" → "Erase Flash" menu. In the drop-down menu choose "All Flash Contents" («Все содержимое флэш-памяти»).
4. Press the "Erase Flash" option («Стереть флэш»). The progress is shown in the output console at the bottom of the IDE. When the process finishes, a confirmation message appears.
 
With ESPTool
ESPTool is an open-source utility based on Python. To erase the flash memory of the ESP32 module:
 
1. Open a terminal window on the computer and hold the BOOT button on the ESP32 module.
2. Enter the command in the terminal, replacing COMx with the real COM port of the ESP32:
python -m esptool --port COMx erase_flash.
3. Press Enter.
4. When the erasing process starts in the terminal, you can release the BOOT button. After a few seconds the ESP32 flash memory will be completely erased.
 
With the configurator
Run flash_windows.bat (flash_macos_linux.sh), select the COM port of the board and press the "Erase flash completely" («Полностью очистить флеш») button. Confirm: the firmware, LittleFS and all saved settings will be deleted. The button works only over a USB connection.
 
Important: if after the message "Connecting…" new series of dots appear on the screen, it means the ESP32 module is not in bootloader/flashing mode. In this case repeat the process while holding the BOOT button while performing