Samovar 7.00: updating through the Arduino IDE is supported. As an equal option, you can run the configurator of the new release and press "Flash" («Прошить»); LittleFS is uploaded with a separate "Upload LittleFS" («Загрузить LittleFS») button and replaces the web interface files (user files in LittleFS may be lost in the process). The configurator stores your values in the user_config_override.h file next to the sketch - copy it to the directory of the new release, and the settings will be kept. You can also flash over Wi-Fi: the "Update" («Обновить») button finds Samovar on the network if "Allow Wi-Fi update" («Разрешить обновление по Wi-Fi») is enabled in the "Network" («Сеть») section (USE_UPDATE_OTA).
As new versions come out, updating will become necessary. A new release may come with new or changed libraries and tools. Therefore, to avoid errors, it is recommended each time to use exactly the libraries and tools that are in the archive of the specific release.
Attention! Important!
Starting with version 6.0, provided that Samovar is connected to the internet, the interface will be updated automatically for the specific sketch version, i.e. if you need to roll back to an older sketch version, the interface will also roll back to the corresponding version. If there is no internet connection, the interface must be installed by yourself, locally.
Updating the sketch
Using the section
Initial sketch upload we prepared a certain structure of files and directories in ...Documents\Arduino. We will continue based on the previous organization.
Prepare the ... Documents\Arduino\ directory in the following order:
-
Move the libraries and tools directories by dragging (or cut and paste) into the Samovar directory.
-
Move the Samovar directory into an empty Samovar-7.00 directory.
-
Move the Samovar-7.00 directory into the OLD directory.
-
Move the Samovar-7.00.zip archive with the original sketch into the OLD directory.
This way only the OLD directory remains in the ... Documents\Arduino\ directory.
And inside OLD there will be: the Samovar-7.00 archive, and the Samovar-7.00 directory with the nested Samovar directory.
This storage system rules out errors during updates, lets you use the previous settings for the new release and, if necessary, quickly roll back to the previous or an even earlier version.
Next we proceed step by step, as in the first installation: "unpack" the new release in ... Documents\Arduino\ until the previous
directory structure is obtained. Accordingly, the archive and the directory obtained from the archive will have the new version number in their names.
But now we do not upload the sketch to the ESP right away; first we make the necessary settings in the Samovar_ini.h file. This can be done in two ways:
1. The right way.
For convenience you will need special programs that can compare two different files, visually showing the differences between them.
The recommended program is
WinMerge — (
A compare and merge tool for Windows that can compare both files and folders, showing the differences in a visual text form . The program is easy to use and has a Russian interface.)
Or a more advanced, but also harder to learn, program
Notepad++ with the installed plugin
Compare.
An example using the WinMerge program.
To compare, you need to select two different Samovar_ini.h files
First select the file from the OLD directory, where we have just moved the previous Samovar version. It is located at: ... \Documents\Arduino\OLD\Samovar-7.00\Samovar\
Take the second file from the directory with the new Samovar release. It is located in ... \Documents\Arduino\Samovar\
The program compares both files and highlights the lines with differences.
The differences will be highlighted in a lighter tone. You can edit the values on the right manually, or you can place the cursor on the left and give the command "Copy to Right" («Копировать направо»).
This way, line by line, the settings file is adjusted for your equipment. When all edits are done, click the "Save" icon
The main thing is not to mix up that the old settings file is on the left, and the file Samovar will work with is on the right.
2. The quick way
When updating through the Arduino IDE, compare Samovar_ini.h of the new and previous releases and carry over only your own values. Do not paste the old Samovar_ini.h over the new one: even a small release may contain new required parameters.
If the new release introduces new Samovar functions, you must edit the Samovar_ini.h file, otherwise the new functions will be unavailable and Samovar will not work correctly.
If the settings were made in the configurator, you do not need to edit Samovar_ini.h: your values are stored in user_config_override.h, which overrides Samovar_ini.h. It is enough to carry this file over to the new release.
The setup is finished. You can upload the sketch to the ESP. Since this is an update of a previously installed sketch, you will not have to set up the Wi-Fi connection again and
you do not need to load the default settings.
When updating, you can already skip connecting the ESP to the USB port and update the firmware
"over the air"
"Rollback" to an old version.
Something in the new release did not please you, or it does not work correctly. You want to go back to the previous versions. With this system of storing old versions, it is very simple.
Prepare the ... \Documents\Arduino directory as for an update:
-
Move the libraries and tools directories by dragging (or cut and paste) into the Samovar directory.
-
Move the Samovar directory into an empty Samovar-7.00 directory.
-
Move the Samovar-7.00 directory into the OLD directory
-
Move the Samovar-7.00.zip archive with the original sketch into the OLD directory
Next:
-
Go to the OLD directory, choose the previous version and go inside to the Samovar directory: ... \Documents\Arduino\OLD\Samovar-6.16\
-
Copy (copying rather than dragging is recommended) the whole Samovar directory into ... \Documents\Arduino\
From the Samovar directory, move by dragging (or cut and paste) one level up, into ... \Documents\Arduino\, the two directories libraries and tools.
That is all. You can upload the sketch to the ESP.
Later, when updating to a new version, you will just need to clear the ... \Documents\Arduino directory by deleting Samovar, libraries and tools. There is no need to move them to OLD, since they are already there and we used a copy.
When updating the sketch you can already use Arduino IDE versions 2.x.x. But these versions do not have the item "ESP32 LittleFS Data Upload", and without the plugin you will not be able to update the interface locally. Accordingly, if Samovar has no access to the internet, the web interface will not be updated.
Addition. In Arduino IDE 2.x.x versions it became possible to install the interface locally using a plugin. The instructions are here. The plugin (arduino-littlefs-upload-1.1.7.vsix) is in the Samovar archive in the tools\ESP32LittleFS_Arduino IDE 2.X directory, see Initial sketch upload.
You can install several Arduino IDE 2.x.x and Arduino IDE 1.x.x versions on your computer at the same time, and they will not cause any problems for each other. So you can keep using Arduino IDE 2.x as your main IDE and use Arduino IDE 1.x only when you need to upload the LittleFS file system (including the interface) to your ESP32 locally.
When using different versions of the Arduino IDE you need to install them in different directories. For this it is enough to add the version number to the directory name.
For example.
C:\Program Files(x86)\Arduino1_1_18;
C:\Program Files\Arduino IDE_2_3_2;
C:\Program Files\Arduino IDE_2_3_1
This makes it possible to use in each version of the Arduino IDE different versions of the ESP32 SDK from Espressif Systems.
But keep in mind that each of the Arduino IDE versions you use, will have to be configured separately for ESP32.
Attention!
If you use the ESP32 add-on “ESP32 by Espressif Systems” version 3.0.0 or higher, the firmware disables Wi-Fi (OTA) updating by itself: the USE_UPDATE_OTA parameter has no effect in this core, upload only over USB. In addition, you need to change the board type used and select the right partitions. The Samovar partition table is absent in core 3.x; it is added manually (the description is at the beginning of the Samovar.ino file):
copy the partitions\samovar.csv file from the sketch directory to ...\Arduino15\packages\esp32\hardware\esp32\3.x.x\tools\partitions\ (on Windows the Arduino15 directory is in C:\Users\<name>\AppData\Local\);
add three lines to the ...\esp32\3.x.x\boards.txt file:
esp32.menu.PartitionScheme.samovar=Samovar
esp32.menu.PartitionScheme.samovar.build.partitions=samovar
esp32.menu.PartitionScheme.samovar.upload.maximum_size=1507328
restart the Arduino IDE and choose "Tools" → "Partition Scheme" → "Samovar".
The PlatformIO configurator uses core 2.0.17 and the same partition table (partitions/samovar.csv); nothing needs to be added.
Questions and answers. FAQ
I could not find anywhere how to update the firmware "over the air". Please advise...The first time, you in any case need to flash by wire and connect Samovar to your Wi-Fi network. The USE_UPDATE_OTA parameter must be enabled in Samovar_ini.h (enabled by default; in the configurator it is "Allow Wi-Fi update" («Разрешить обновление по Wi-Fi»)), the ESP32 core is 2.0.17.
Reboot Samovar and restart the Arduino IDE. After that, the IP address of Samovar will appear in the network ports of the Arduino IDE (a network port named samovar).
Instead of the USB (COM) port, select the IP address, and the update will go over the air.
Later, if you connect Samovar to the computer with a USB cable, two options will be available in the ports: updating "over the air" or over the COM port. Whichever channel you choose, the sketch will be sent through it.
The configurator works the same way: press "Update" («Обновить»), and both the COM port and Samovar found on the network appear in the port list; select the network one and press "Flash" («Прошить»). The "Upload LittleFS" («Загрузить LittleFS») button also works over the network.