Multi-Launcher Extended is a robust firmware update utility for ESP32 microcontrollers, designed to manage and perform updates from an SD card. This library allows users to upload firmware files, monitor memory usage, and log actions effectively.
- Firmware Updates: Easily update firmware from an SD card.
- Logging: Integrated logging capabilities to track actions and errors.
- Heap Usage Monitoring: Get the current heap memory usage.
- Timestamp Generation: Generate formatted timestamps for logging and debugging.
The LoaderLib class handles firmware updates from the SD card and integrates a logging utility.
- Initialization: Handles SD card initialization and checks for card availability.
- Firmware Update: Updates firmware from a specified file on the SD card.
- Program Listing: Lists all available programs stored in the
/Programsdirectory.
The EssentialsLib class provides essential utility functions.
- Timestamp Generation: Returns a formatted timestamp since the program started.
- Heap Usage Monitoring: Returns the amount of heap memory currently in use.
The LoggerLib class is a custom logging utility that provides various logging functionalities.
- Logging Actions: Records log messages for various operations, helping track the execution flow and errors.
- Arduino IDE: Ensure you have the Arduino IDE installed on your machine.
- ESP32 Board: Add the ESP32 board support to your Arduino IDE.
- SD Card: Format your SD card to FAT32 and ensure it has the required firmware files.
-
Clone the Repository:
git clone https://github.com/Vankanatora/MultiLauncher-Extended.git cd MultiLauncher-Extended -
Open in Arduino IDE: Open the Arduino IDE and navigate to
File>Open, then select the cloned project folder. -
Install Required Libraries: Ensure that you have the following libraries installed:
- SD library
- SPI library
- Update library
- LoggerLib (your custom logging library)
-
Connect Your SD Card: Insert the SD card containing your firmware files into the appropriate slot on the ESP32.
-
Modify Your Firmware Files: Ensure that your firmware files are named correctly (preferably
firmware.binfor ease of access) and are placed in the/Programsdirectory on the SD card. -
Compile and Upload: Connect your ESP32 board to your computer and select the appropriate board and port in the Arduino IDE. Compile and upload the sketch.
-
Logging Output: You can view the log messages in the Serial Monitor (make sure to set the baud rate as per your configuration).
Here's an example of how to use LoaderLib in conjunction with LoggerLib in your sketch:
#include <LoaderLib.h>
#include <LoggerLib.h>
LoggerLib logger(5, 2, 19, 18); // Create an instance of the logger
LoaderLib loader(5, 2, 19, 18, &logger); // Initialize LoaderLib with SD pin settings
void setup() {
logger.begin(115200); // Initialize logger
logger.log("Starting Multi-Launcher Extended...");
// Initialize the SD card
if (loader.begin()) {
logger.log("SD Card initialized.");
} else {
logger.log("Failed to initialize SD Card.");
return;
}
// List all available programs
std::list<String> programs = loader.listAllPrograms();
for (const String& program : programs) {
logger.log("Program found: " + program);
}
// Perform firmware update
loader.update("firmware.bin", [](int status) {
if (status == 1) {
logger.log("Firmware updated successfully!");
} else {
logger.log("Firmware update failed.");
}
});
}
void loop() {
// Leace empty if you use RTOS
}Contributions are welcome! If you have suggestions or improvements, feel free to create a pull request or open an issue.
This project is licensed under the GPL-3.0 license. See the LICENSE file for more details.