-
Notifications
You must be signed in to change notification settings - Fork 159
OTA Update
Over-the-Air (OTA) update is a mechanism that allows firmware updates to be deployed to ESP32 devices wirelessly, eliminating the need for physical connections. Elegant OTA is the library that facilitates this process on ESP32 microcontrollers.
Before being able to use OTA, ensure you have the following prerequisites:
-
#define WEBSERVER
enabled in theUSER_SETTINGS.h
file on the already flashed software - A Wifi connection established to the board
- Either a direct connection to the board
- OR a connection via a router (see
USER_SETTINGS.cpp
for Wifi settings)
Tip
Starting from version 7.0.0 , many settings are stored to persistent memory. This means that all the things you configure in Webserver (Wifi settings, max charge/discharge rate, SOC scaling settings, Battery capacity) dont have to be configured again. The system will use the previously set settings automatically!
To use the OTA feature, you need to generate a firmware binary (.bin) file from your Arduino IDE project. Follow these steps:
- Open your Arduino IDE and load the new Battery-Emulator release you want to update to the board.
- Configure your settings, the following are mandatory:
- Correct battery & inverter choice (
USER_SETTINGS.h
) - Which hardware you use (
USER_SETTINGS.h
) - CAN configuration (
USER_SETTINGS.cpp
)
- Correct battery & inverter choice (
- Generate the .bin file, via "Sketch", "Export Compiled Binary"
- This will create a folder called Build where you opened the Software.ino file
- Inside the Build folder, locate the "software.ino.bin" file. This is the file to be uploaded to the board.
- Start by navigating to the web address (Note that IP will be different compared to direct / router connection)
- At the bottom of the page, click the "Perform OTA update"
- On the ElegantOTA page, select the "Select file" option
-
Select the
Software.ino.bin
file found in the '...\Battery-Emulator\Software\build\esp32.esp32.esp32' folder, that you generated previously -
Flashing will commence, once completed you will see this message:
- Congratulations, you have now updated the firmware remotely over the air! 🥳