-
Notifications
You must be signed in to change notification settings - Fork 0
10 ‐ Applying Firmware Updates
When a new version of firmware is released, you can easily install this update over-the-air (OTA) right from the web settings page. There are alternative methods which will be briefly covered here as well, but updating via the web settings is the recommended method as, unless otherwise stated in the release notes, your current WiFi configuration and other settings will be maintained.
The top of the web settings page always shows the currently installed firmware version:
You can always check this before and after a upgrade to assure that the new version has been applied.
Obtaining the new firmware
Whenever a new release is issued, it will include a compiled .bin file under the release's assets.
Unless you plan on modifying the source code, you only need to download and save the .bin file, usually in a format of RobotCarTimer_vx.xx_ESP32.bin. You do not need any other files just to apply the firmware update, but you will need this .bin file for all methods described here.
Once you have the firmware .bin file downloaded and saved locally, open the web settings page and select the Firmware Update button under the Controller commands:
Note: This features is currently marked as a 'beta' feature. It uses a third-party library (ElegantOTA) to install the update. It has been tested with multiple ESP32 boards, but since there are so many varieties of ESP32s, it is impossible to test them all. The 'beta' label will likely be removed when more real-world testing is completed.
When you click the Firmware Upgrade option, you will be shown the ElegantOTA update page:
-
OTA Mode: This should default to 'Firmware', but assure that LittleFS/SPIFFS is not selected as this would try to overwrite the configuration file area with the compiled code. This would not only erase your config file, but likely corrupt the flash, requiring that the firmware be installed via USB and onboarded again. Just assure 'Firmware' is selected for the OTA mode.
-
Use the Select file button to browse to, and select, the .bin file you downloaded. The upload will immediately begin.
IMPORTANT: When you select the .bin file, the upload and update begins immediately with no additional prompts, so be sure you are selecting the correct .bin file.
The upload progress will be shown on the page. When complete, the page will change to show a successful flash message.
The controller will then reboot, loading the new firmware. The 'Go Back' button on this page just takes you back to the first firmware update page. Unless otherwise stated in the release notes, your WiFi configuration and other settings should be maintained. Always check the release notes for breaking changes or special upgrade notes in the event that the upgrade requires additional steps or alters the config file.
After the controller reboots, you can return to the settings page by just entering the controller's IP address in the browser. If the settings page shows the new version number, then the update is complete.
As an alternative, or if the OTA update does not work as planned, you can always flash the new firmware by connecting the controller to a computer with a USB data cable and using a desktop utility to flash the firmware. This is covered (and identical to) the initial installation steps covered in a separate section of this wiki, so you can refer to that section for more details.
IMPORTANT NOTE: When using this method, and depending upon the flashing utility, the flash (and therefore your config file) may be erased before the update occurs. If you find that the board does not complete the boot process and shows 'Ready' after the update, check to see if the RaceTimer_AP hotspot is broadcasting. If so, this is a sure sign the config file was overwritten and you will need to complete the onboarding again and then update all your settings. This is one of the reasons why using the update process via the web settings page is recommended.
Firmware can also be uploaded wirelessly using the Arduino IDE, but this requires obtaining the source code, compiling and then using the ArduinoOTA mode of the controller. You will normally use this method when making changes to the source code. See the section on modifying the source code for more information on using this method.
A few additional notes on upgrading
-
It's always a good idea to note your current settings before updating. Unless noted in the release notes, your current settings should not be overwritten when using the recommended method, but it's advisable that you note your current values (like sensor distances) in the event that you need to onboard and setup the board again.
-
Some ESP32 boards require that the boot button on the board be pressed and held to put the ESP32 into flashing mode until a connection is established. This is more likely when using the desktop app or Arduino IDE methods. but if an update fails due to the inability to establish a connection with the COM port, try holding down the BOOT button in the ESP32 until the connection is made and the update starts.
-
If a flash appears to fail, try it again. Occasionally, especially when using OTA methods, it is possible that the flash was incomplete or corrupted. If the firmware worked previously on the same ESP32, it should work with the new version. On rare occasions, I've had to apply an update three or four times before it worked.
-
Watch the power LED on the ESP32 (usually the red LED). If you notice it flickering (it should remain solid), that generally means the board is stuck in a boot loop. You may be able to try flashing OTA again, but often you will need to result to the USB/Desktop method if this occurs.
-
If you continue to have issues, check out the Troubleshooting section of this wiki.