Skip to main content

Disable Firmware OTA

This feature is only available in ElegantOTA Pro.



Modes

ElegantOTA allows you to selective enable or disable OTA modes of your choice for security reasons or when you have a important task running where you don't want it to get interrupted by an OTA update. This will be represented in the portal (ElegantOTA webpage) too.

This function should be used very carefully as it blocks firmware update! If by mistake this is left disabled, your device will not be recoverable by an OTA update.

Disable Firmware OTA:

// Pass 'false' to disable Firmware mode
ElegantOTA.setFirmwareMode(false);

Enable Firmware OTA:

// Pass 'true' to enable Firmware mode
ElegantOTA.setFirmwareMode(true);

Get Firmware OTA mode status:

// You can use this logic inside a function if neccessary
if(ElegantOTA.checkFirmwareMode() == true) {
Serial.println("Firmware mode is enabled");
} else {
Serial.println("Firmware mode is disabled");
}