Earwax Build Ups Might Be The Cause Of Your Impaired Hearing… | gadgets4-you

https://gadgets4-you.com/en/tvidler/1/tb/?ref=realtimeclk.com&action=view&encrypt=FUh4yJCat3manI3ZBMGNsHdVdy1S6eqrREow2iM44to&c=38214&site=TVidlerWWAllCPA_theweatherchannel_http://cdn.taboola.com/libtrc/static/thumbnails/96cb7e1ad2a9d020c349b4d10932b66c.jpg_Doctors%20Surprised:%20Earwax%20Might%20Be%20The%20Reason%20Of%20Your%20Tinnitus%20(Ear%20Ringing).%20Try%20This%20Tonight!&tblref=theweatherchannel&tbl_campaignid=15473217&tbl_siteid=1187&tbl_campaignitemid=3106615849&tblci=GiDPHtzs6ZHyy7_jT91-F5i4J_vF-5gvzjlh6Fs4ru_zPiCa_1Yo67DZxbWCg7awAQ&prot=2#tblciGiDPHtzs6ZHyy7_jT91-F5i4J_vF-5gvzjlh6Fs4ru_zPiCa_1Yo67DZxbWCg7awAQ

ESP32 Arduino: Updating firmware from the SPIFFS file system

#include "SPIFFS.h"
#include "Update.h"
 
void setup() {
 
   Serial.begin(115200);
 
   if(!SPIFFS.begin(true)){
        Serial.println("An Error has occurred while mounting SPIFFS");
        return;
   }
  
    File file = SPIFFS.open("/firmware.bin");
 
    if(!file){
        Serial.println("Failed to open file for reading");
        return;
    }
      
    Serial.println("Starting update..");
       
    size_t fileSize = file.size();
    if(!Update.begin(fileSize)){
      
       Serial.println("Cannot do the update");
       return;
    };
    Update.writeStream(file);
    if(Update.end()){
      
      Serial.println("Successful update"); 
    }else {
      
      Serial.println("Error Occurred: " + String(Update.getError()));
      return;
    }
    
    file.close();
    Serial.println("Reset in 4 seconds...");
    delay(4000);
    ESP.restart();
}
 
void loop() {}

Source: ESP32 Arduino: Updating firmware from the SPIFFS file system – techtutorialsx