<header class="entry-header" style="box-sizing: inherit; padding: 0px 0px 1em; margin-left: auto; margin-right: auto; color: #333333; font-family: Ubuntu, sans-serif; font-size: 16px; background-color: #ffffff;">
   <h1 class="entry-title" style="box-sizing: inherit; font-size: 1.625rem; margin: 0px 0px 0.25em; clear: both; line-height: 1.4; padding: 0px; font-weight: 300;">ESP32 Arduino: Updating firmware from the SPIFFS file system</h1>
   </header>
<div class="entry-content" style="box-sizing: inherit; margin-left: auto; margin-right: auto; color: #333333; font-family: Ubuntu, sans-serif; font-size: 16px; background-color: #ffffff; height: auto !important;">
   <p style="box-sizing: inherit; margin-bottom: 1.5em; padding: 0px;">In this tutorial we will learn how to update the firmware of the ESP32 from a binary file on the SPIFFS file system of the device. The tests shown here were performed using an&nbsp;<a href="https://www.dfrobot.com/product-1798.html?tracking=5977b2a20858a" style="box-sizing: inherit; background-color: transparent; color: #222222; text-decoration-line: none; box-shadow: rgb(15, 15, 15) 0px -1px 0px inset; transition: color 80ms ease-in 0s, box-shadow 130ms ease-in-out 0s, -webkit-box-shadow 130ms ease-in-out 0s;" target="_blank">ESP32 board</a>&nbsp;from DFRobot.</p>
   <span id="more-27446" style="box-sizing: inherit;"></span>
   <h2 style="box-sizing: inherit; clear: both; line-height: 1.4; margin: 0px 0px 0.75em; padding: 1.5em 0px 0px; color: #666666; font-size: 1.625rem; font-weight: 300;">Introduction</h2>
   <p style="box-sizing: inherit; margin-bottom: 1.5em; padding: 0px;">In this tutorial we will learn how to update the firmware of the ESP32 from a binary file on the SPIFFS file system of the device.</p>
   <p style="box-sizing: inherit; margin-bottom: 1.5em; padding: 0px;">For this tutorial we will need to obtain the binary file of a compiled Arduino Sketch.&nbsp;<a href="https://techtutorialsx.com/2019/07/15/esp32-arduino-exporting-binary-file-of-compiled-sketch/" style="box-sizing: inherit; background-color: transparent; color: #222222; text-decoration-line: none; box-shadow: rgb(15, 15, 15) 0px -1px 0px inset; transition: color 80ms ease-in 0s, box-shadow 130ms ease-in-out 0s, -webkit-box-shadow 130ms ease-in-out 0s;" target="_blank">This</a>&nbsp;previous tutorial explains in detail how to do it.</p>
   <p style="box-sizing: inherit; margin-bottom: 1.5em; padding: 0px;">We will also need to upload it to the SPIFFS file system of the device afterwards, using&nbsp;<a href="https://github.com/me-no-dev/arduino-esp32fs-plugin" style="box-sizing: inherit; background-color: transparent; color: #222222; text-decoration-line: none; box-shadow: rgb(15, 15, 15) 0px -1px 0px inset; transition: color 80ms ease-in 0s, box-shadow 130ms ease-in-out 0s, -webkit-box-shadow 130ms ease-in-out 0s;" target="_blank">this</a>&nbsp;Arduino IDE plugin. You can check how to do it&nbsp;<a href="https://techtutorialsx.com/2018/08/24/esp32-arduino-spiffs-file-upload-ide-plugin/" style="box-sizing: inherit; background-color: transparent; color: #222222; text-decoration-line: none; box-shadow: rgb(15, 15, 15) 0px -1px 0px inset; transition: color 80ms ease-in 0s, box-shadow 130ms ease-in-out 0s, -webkit-box-shadow 130ms ease-in-out 0s;" target="_blank">here</a>.</p>
   <p style="box-sizing: inherit; margin-bottom: 1.5em; padding: 0px;">The tests shown here were performed using an&nbsp;<a href="https://www.dfrobot.com/product-1798.html?tracking=5977b2a20858a" style="box-sizing: inherit; background-color: transparent; color: #222222; text-decoration-line: none; box-shadow: rgb(15, 15, 15) 0px -1px 0px inset; transition: color 80ms ease-in 0s, box-shadow 130ms ease-in-out 0s, -webkit-box-shadow 130ms ease-in-out 0s;" target="_blank">ESP32 board</a>&nbsp;from DFRobot.</p>
   <h2 style="box-sizing: inherit; clear: both; line-height: 1.4; margin: 0px 0px 0.75em; padding: 1.5em 0px 0px; color: #666666; font-size: 1.625rem; font-weight: 300;">The code of the new program</h2>
   <p style="box-sizing: inherit; margin-bottom: 1.5em; padding: 0px;">We will start by writing the code for the program that will be flashed to the ESP32 from the SPIFFS file system. It will be a very simple “Hello World”, for demonstration purposes.</p>
   <p style="box-sizing: inherit; margin-bottom: 1.5em; padding: 0px;">We will start by opening a serial connection on the Arduino setup function, so we can output our message.</p>
   <div class="google-auto-placed ap_container" style="box-sizing: inherit; width: 524.313px; height: auto; clear: none; text-align: center;"><ins data-ad-format="auto" class="adsbygoogle adsbygoogle-noablate" data-ad-client="ca-pub-7702225573833553" data-adsbygoogle-status="done" data-overlap-observer-io="false" style="box-sizing: inherit; background: transparent; text-decoration-line: none; display: block; margin: auto; height: 280px;"><ins id="aswift_6_expand" style="box-sizing: inherit; background: transparent; text-decoration-line: none; display: inline-table; border: none; height: 280px; margin: 0px; padding: 0px; position: relative; visibility: visible; width: 524px;"><ins id="aswift_6_anchor" style="box-sizing: inherit; background: transparent; text-decoration-line: none; display: block; border: none; height: 280px; margin: 0px; padding: 0px; position: relative; visibility: visible; width: 524px; overflow: visible;"><iframe id="aswift_6" name="aswift_6" sandbox="allow-forms allow-pointer-lock allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-top-navigation-by-user-activation" width="524" height="280" frameborder="0" src="https://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-7702225573833553&amp;output=html&amp;h=280&amp;adk=209788816&amp;adf=1785603359&amp;w=524&amp;fwrn=4&amp;fwrnh=100&amp;lmt=1589532842&amp;num_ads=1&amp;rafmt=1&amp;armr=3&amp;sem=mc&amp;pwprc=3411199944&amp;psa=1&amp;guci=2.2.0.0.2.2.0.0&amp;ad_type=text_image&amp;format=524x280&amp;url=https%3A%2F%2Ftechtutorialsx.com%2F2019%2F07%2F21%2Fesp32-arduino-updating-firmware-from-the-spiffs-file-system%2F&amp;flash=0&amp;fwr=0&amp;pra=3&amp;rh=131&amp;rw=524&amp;rpe=1&amp;resp_fmts=3&amp;wgl=1&amp;fa=27&amp;adsid=ChAI8Pv49QUQrp6w-bqXv-JcEioAJIohhM63pm94WgL6wiqFhIKb4s_tND2udV8w0pVGqi6C-r23XjXaIQQ&amp;dt=1589532842276&amp;bpp=2&amp;bdt=1192&amp;idt=-M&amp;shv=r20200511&amp;cbv=r20190131&amp;ptt=9&amp;saldr=aa&amp;abxe=1&amp;cookie=ID%3D118e8887a10bc8a2%3AT%3D1589421365%3AS%3DALNI_Ma8UdqAiOwOwRwvTYl4v80plEEQxw&amp;crv=1&amp;prev_fmts=0x0%2C524x280%2C336x280&amp;nras=2&amp;correlator=6095696427925&amp;frm=20&amp;pv=1&amp;ga_vid=343393661.1589421366&amp;ga_sid=1589532842&amp;ga_hid=622458622&amp;ga_fc=1&amp;iag=0&amp;icsg=3002714648739888&amp;dssz=58&amp;mdo=0&amp;mso=0&amp;u_tz=540&amp;u_his=10&amp;u_java=0&amp;u_h=1440&amp;u_w=2560&amp;u_ah=1400&amp;u_aw=2560&amp;u_cd=24&amp;u_nplug=3&amp;u_nmime=4&amp;adx=179&amp;ady=1499&amp;biw=1261&amp;bih=1287&amp;scr_x=0&amp;scr_y=0&amp;eid=21066085%2C21066124&amp;oid=3&amp;pvsid=2400951310403349&amp;pem=493&amp;ref=https%3A%2F%2Fwww.google.com%2F&amp;rx=0&amp;eae=0&amp;fc=1408&amp;brdim=-7%2C40%2C-7%2C40%2C2560%2C40%2C1294%2C1407%2C1278%2C1287&amp;vis=1&amp;rsz=%7C%7Cs%7C&amp;abl=NS&amp;fu=8336&amp;bc=31&amp;jar=2020-05-15-08&amp;ifi=6&amp;uci=a!6&amp;btvi=1&amp;fsb=1&amp;xpc=tO0AUGHLtv&amp;p=https%3A//techtutorialsx.com&amp;dtd=20" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" allowfullscreen="true" data-google-container-id="a!6" data-google-query-id="CO_coqO_tekCFdpwYAod9M8DAQ" data-load-complete="true" style="box-sizing: inherit; margin-bottom: 1.5em; max-width: 100%; left: 0px; position: absolute; top: 0px; border-width: 0px; border-style: initial; width: 524px; height: 280px;"></iframe></ins></ins></ins></div>
   <p style="box-sizing: inherit; margin-bottom: 1.5em; padding: 0px;">Then, in the Arduino loop, we will print a “Hello World” message every second.</p>
   <p style="box-sizing: inherit; margin-bottom: 1.5em; padding: 0px;">The complete code can be seen below and, as mentioned, it is really simple.</p>
   <div style="box-sizing: inherit;">
      <div id="highlighter_787390" class="syntaxhighlighter  cpp" style="box-sizing: inherit; width: 524.313px; margin: 1em 0px !important; position: relative !important; overflow: auto hidden !important; font-size: 1em !important;">
         <table border="0" cellpadding="0" cellspacing="0" style="width: 524px; box-sizing: content-box !important; margin: 0px !important; border-radius: 0px !important; background: none !important; border-width: 0px !important; border-style: initial !important; border-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; font-family: Monaco, Consolas, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; table-layout: auto !important;">
            <tbody style="box-sizing: content-box !important; border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important;">
               <tr style="box-sizing: content-box !important; border: 0px !important; border-radius: 0px !important; background: none !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important;">
                  <td class="gutter" style="box-sizing: content-box !important; padding: 0px !important; border-radius: 0px !important; background: none !important; border-width: 0px !important; border-style: initial !important; border-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; color: #afafaf !important;">
                     <div class="line number1 index0 alt2" style="box-sizing: content-box !important; border-radius: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border-width: 0px 3px 0px 0px !important; border-top-style: initial !important; border-right-style: solid !important; border-bottom-style: initial !important; border-left-style: initial !important; border-top-color: initial !important; border-right-color: #6ce26c !important; border-bottom-color: initial !important; border-left-color: initial !important; border-image: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 0.5em 0px 1em !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; white-space: pre !important;">1</div>
                     <div class="line number2 index1 alt1" style="box-sizing: content-box !important; border-radius: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border-width: 0px 3px 0px 0px !important; border-top-style: initial !important; border-right-style: solid !important; border-bottom-style: initial !important; border-left-style: initial !important; border-top-color: initial !important; border-right-color: #6ce26c !important; border-bottom-color: initial !important; border-left-color: initial !important; border-image: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 0.5em 0px 1em !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; white-space: pre !important;">2</div>
                     <div class="line number3 index2 alt2" style="box-sizing: content-box !important; border-radius: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border-width: 0px 3px 0px 0px !important; border-top-style: initial !important; border-right-style: solid !important; border-bottom-style: initial !important; border-left-style: initial !important; border-top-color: initial !important; border-right-color: #6ce26c !important; border-bottom-color: initial !important; border-left-color: initial !important; border-image: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 0.5em 0px 1em !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; white-space: pre !important;">3</div>
                     <div class="line number4 index3 alt1" style="box-sizing: content-box !important; border-radius: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border-width: 0px 3px 0px 0px !important; border-top-style: initial !important; border-right-style: solid !important; border-bottom-style: initial !important; border-left-style: initial !important; border-top-color: initial !important; border-right-color: #6ce26c !important; border-bottom-color: initial !important; border-left-color: initial !important; border-image: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 0.5em 0px 1em !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; white-space: pre !important;">4</div>
                     <div class="line number5 index4 alt2" style="box-sizing: content-box !important; border-radius: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border-width: 0px 3px 0px 0px !important; border-top-style: initial !important; border-right-style: solid !important; border-bottom-style: initial !important; border-left-style: initial !important; border-top-color: initial !important; border-right-color: #6ce26c !important; border-bottom-color: initial !important; border-left-color: initial !important; border-image: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 0.5em 0px 1em !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; white-space: pre !important;">5</div>
                     <div class="line number6 index5 alt1" style="box-sizing: content-box !important; border-radius: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border-width: 0px 3px 0px 0px !important; border-top-style: initial !important; border-right-style: solid !important; border-bottom-style: initial !important; border-left-style: initial !important; border-top-color: initial !important; border-right-color: #6ce26c !important; border-bottom-color: initial !important; border-left-color: initial !important; border-image: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 0.5em 0px 1em !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; white-space: pre !important;">6</div>
                     <div class="line number7 index6 alt2" style="box-sizing: content-box !important; border-radius: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border-width: 0px 3px 0px 0px !important; border-top-style: initial !important; border-right-style: solid !important; border-bottom-style: initial !important; border-left-style: initial !important; border-top-color: initial !important; border-right-color: #6ce26c !important; border-bottom-color: initial !important; border-left-color: initial !important; border-image: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 0.5em 0px 1em !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; white-space: pre !important;">7</div>
                     <div class="line number8 index7 alt1" style="box-sizing: content-box !important; border-radius: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border-width: 0px 3px 0px 0px !important; border-top-style: initial !important; border-right-style: solid !important; border-bottom-style: initial !important; border-left-style: initial !important; border-top-color: initial !important; border-right-color: #6ce26c !important; border-bottom-color: initial !important; border-left-color: initial !important; border-image: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 0.5em 0px 1em !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; white-space: pre !important;">8</div>
                     </td>
                  <td class="code" style="width: 488px; box-sizing: content-box !important; padding: 0px !important; border-radius: 0px !important; background: none !important; border-width: 0px !important; border-style: initial !important; border-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important;">
                     <div class="container" style="box-sizing: content-box !important; border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: relative !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important;">
                        <div class="line number1 index0 alt2" style="box-sizing: content-box !important; border-radius: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; white-space: pre !important;">
                           <code class="cpp keyword bold" style="box-sizing: content-box !important; font-family: Monaco, Consolas, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace !important; font-size: 1em !important; border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-weight: bold !important; direction: ltr !important; box-shadow: none !important; display: inline !important; color: #006699 !important;">void</code>
                           <code class="cpp plain" style="box-sizing: content-box !important; font-family: Monaco, Consolas, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace !important; font-size: 1em !important; border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; direction: ltr !important; box-shadow: none !important; display: inline !important;">setup() {</code>
                           </div>
                        <div class="line number2 index1 alt1" style="box-sizing: content-box !important; border-radius: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; white-space: pre !important;">
                           <code class="cpp spaces" style="box-sizing: content-box !important; font-family: Monaco, Consolas, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace !important; font-size: 1em !important; border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; direction: ltr !important; box-shadow: none !important; display: inline !important;">&nbsp;&nbsp;</code>
                           <code class="cpp plain" style="box-sizing: content-box !important; font-family: Monaco, Consolas, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace !important; font-size: 1em !important; border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; direction: ltr !important; box-shadow: none !important; display: inline !important;">Serial.begin(115200);</code>
                           </div>
                        <div class="line number3 index2 alt2" style="box-sizing: content-box !important; border-radius: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; white-space: pre !important;">
                           <code class="cpp plain" style="box-sizing: content-box !important; font-family: Monaco, Consolas, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace !important; font-size: 1em !important; border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; direction: ltr !important; box-shadow: none !important; display: inline !important;">}</code>
                           </div>
                        <div class="line number4 index3 alt1" style="box-sizing: content-box !important; border-radius: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; white-space: pre !important;">&nbsp;</div>
                        <div class="line number5 index4 alt2" style="box-sizing: content-box !important; border-radius: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; white-space: pre !important;">
                           <code class="cpp keyword bold" style="box-sizing: content-box !important; font-family: Monaco, Consolas, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace !important; font-size: 1em !important; border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-weight: bold !important; direction: ltr !important; box-shadow: none !important; display: inline !important; color: #006699 !important;">void</code>
                           <code class="cpp plain" style="box-sizing: content-box !important; font-family: Monaco, Consolas, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace !important; font-size: 1em !important; border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; direction: ltr !important; box-shadow: none !important; display: inline !important;">loop() {</code>
                           </div>
                        <div class="line number6 index5 alt1" style="box-sizing: content-box !important; border-radius: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; white-space: pre !important;">
                           <code class="cpp spaces" style="box-sizing: content-box !important; font-family: Monaco, Consolas, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace !important; font-size: 1em !important; border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; direction: ltr !important; box-shadow: none !important; display: inline !important;">&nbsp;&nbsp;</code>
                           <code class="cpp plain" style="box-sizing: content-box !important; font-family: Monaco, Consolas, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace !important; font-size: 1em !important; border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; direction: ltr !important; box-shadow: none !important; display: inline !important;">Serial.println(</code>
                           <code class="cpp string" style="box-sizing: content-box !important; font-family: Monaco, Consolas, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace !important; font-size: 1em !important; border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; direction: ltr !important; box-shadow: none !important; display: inline !important; color: blue !important;">"Hello world"</code>
                           <code class="cpp plain" style="box-sizing: content-box !important; font-family: Monaco, Consolas, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace !important; font-size: 1em !important; border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; direction: ltr !important; box-shadow: none !important; display: inline !important;">);</code>
                           </div>
                        <div class="line number7 index6 alt2" style="box-sizing: content-box !important; border-radius: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; white-space: pre !important;">
                           <code class="cpp spaces" style="box-sizing: content-box !important; font-family: Monaco, Consolas, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace !important; font-size: 1em !important; border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; direction: ltr !important; box-shadow: none !important; display: inline !important;">&nbsp;&nbsp;</code>
                           <code class="cpp plain" style="box-sizing: content-box !important; font-family: Monaco, Consolas, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace !important; font-size: 1em !important; border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; direction: ltr !important; box-shadow: none !important; display: inline !important;">delay(1000);</code>
                           </div>
                        <div class="line number8 index7 alt1" style="box-sizing: content-box !important; border-radius: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; white-space: pre !important;">
                           <code class="cpp plain" style="box-sizing: content-box !important; font-family: Monaco, Consolas, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace !important; font-size: 1em !important; border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; direction: ltr !important; box-shadow: none !important; display: inline !important;">}</code>
                           </div>
                        </div>
                     </td>
                  </tr>
               </tbody>
            </table>
         </div>
      </div>
   <h2 style="box-sizing: inherit; clear: both; line-height: 1.4; margin: 0px 0px 0.75em; padding: 1.5em 0px 0px; color: #666666; font-size: 1.625rem; font-weight: 300;">Uploading the binary file to the SPIFFS file system</h2>
   <p style="box-sizing: inherit; margin-bottom: 1.5em; padding: 0px;">Now that we have written our final firmware in the previous section, we need to compile it and upload it to the SPIFFS file system of the ESP32.</p>
   <p style="box-sizing: inherit; margin-bottom: 1.5em; padding: 0px;">The first thing we will need to do is obtaining the compiled binary file.&nbsp;<a href="https://techtutorialsx.com/2019/07/15/esp32-arduino-exporting-binary-file-of-compiled-sketch/" style="box-sizing: inherit; background-color: transparent; color: #222222; text-decoration-line: none; box-shadow: rgb(15, 15, 15) 0px -1px 0px inset; transition: color 80ms ease-in 0s, box-shadow 130ms ease-in-out 0s, -webkit-box-shadow 130ms ease-in-out 0s;" target="_blank">This</a>&nbsp;previous tutorial explains in detail how to do it.</p>
   <p style="box-sizing: inherit; margin-bottom: 1.5em; padding: 0px;">In short, we simply need to click the&nbsp;<span style="box-sizing: inherit; font-weight: 700;">Sketch</span>&nbsp;menu at the top of the Arduino IDE and select the “<span style="box-sizing: inherit; font-weight: 700;">Export compiled Binary</span>” option, as shown in figure 1.</p>
   <div class="wp-block-image" style="box-sizing: inherit; margin-bottom: 1.5em;">
      <figure class="aligncenter" style="box-sizing: inherit; display: table; margin: 0px auto; clear: both;"><img data-attachment-id="27452" data-permalink="https://techtutorialsx.com/2019/07/21/esp32-arduino-updating-firmware-from-the-spiffs-file-system/image-10-3/" data-orig-file="https://i1.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-10.png?fit=717%2C597&amp;ssl=1" data-orig-size="717,597" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image-10" data-image-description="" data-medium-file="https://i1.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-10.png?fit=300%2C250&amp;ssl=1" data-large-file="https://i1.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-10.png?fit=525%2C437&amp;ssl=1" src="https://i1.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-10.png?w=525&amp;ssl=1" alt="Exporting the compiled binary for the sketch, using the Arduino IDE" class="wp-image-27452 jetpack-lazy-image jetpack-lazy-image--handled" data-recalc-dims="1" srcset="https://i1.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-10.png?w=717&amp;ssl=1 717w, https://i1.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-10.png?resize=300%2C250&amp;ssl=1 300w" data-lazy-loaded="1" sizes="(max-width: 525px) 100vw, 525px" style="box-sizing: inherit; border-style: none; height: auto; max-width: 100%;" />
         <figcaption style="box-sizing: inherit; display: table-caption; margin-top: 0.5em; margin-bottom: 1.5em; color: #555d66; font-size: 13px; caption-side: bottom; font-style: italic;"><span style="box-sizing: inherit; font-weight: 700;">Figure 1</span>&nbsp;– Exporting the compiled binary, using the Arduino IDE.</figcaption>
         </figure>
      </div>
   <p style="box-sizing: inherit; margin-bottom: 1.5em; padding: 0px;">When the procedure finishes, the binary file should be available in the sketch folder. You can navigate to the sketch folder by clicking on the&nbsp;<span style="box-sizing: inherit; font-weight: 700;">Sketch</span>&nbsp;menu and selecting the “<span style="box-sizing: inherit; font-weight: 700;">Show Sketch Folder</span>” option. This is illustrated in figure 2.</p>
   <div class="wp-block-image" style="box-sizing: inherit; margin-bottom: 1.5em;">
      <figure class="aligncenter" style="box-sizing: inherit; display: table; margin: 0px auto; clear: both;"><img data-attachment-id="27453" data-permalink="https://techtutorialsx.com/2019/07/21/esp32-arduino-updating-firmware-from-the-spiffs-file-system/image-11-3/" data-orig-file="https://i0.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-11.png?fit=714%2C596&amp;ssl=1" data-orig-size="714,596" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image-11" data-image-description="" data-medium-file="https://i0.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-11.png?fit=300%2C250&amp;ssl=1" data-large-file="https://i0.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-11.png?fit=525%2C438&amp;ssl=1" src="https://i0.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-11.png?w=525&amp;ssl=1" alt="Opening the Arduino Sketch folder." class="wp-image-27453 jetpack-lazy-image jetpack-lazy-image--handled" data-recalc-dims="1" srcset="https://i0.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-11.png?w=714&amp;ssl=1 714w, https://i0.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-11.png?resize=300%2C250&amp;ssl=1 300w" data-lazy-loaded="1" sizes="(max-width: 525px) 100vw, 525px" style="box-sizing: inherit; border-style: none; height: auto; max-width: 100%;" />
         <figcaption style="box-sizing: inherit; display: table-caption; margin-top: 0.5em; margin-bottom: 1.5em; color: #555d66; font-size: 13px; caption-side: bottom; font-style: italic;"><span style="box-sizing: inherit; font-weight: 700;">Figure 2&nbsp;</span>– Opening the Arduino Sketch folder.</figcaption>
         </figure>
      </div>
   <p style="box-sizing: inherit; margin-bottom: 1.5em; padding: 0px;">There you should see the&nbsp;<span style="box-sizing: inherit; font-weight: 700;">.ino</span>&nbsp;file of your sketch and below a&nbsp;<span style="box-sizing: inherit; font-weight: 700;">.bin</span>&nbsp;file. Your&nbsp;<span style="box-sizing: inherit; font-weight: 700;">.bin</span>&nbsp;file will have the name of your sketch appended with the name of your board. The content of the folder is shown in figure 3.</p>
   <div class="wp-block-image" style="box-sizing: inherit; margin-bottom: 1.5em;">
      <figure class="aligncenter" style="box-sizing: inherit; display: table; margin: 0px auto; clear: both;"><img data-attachment-id="27448" data-permalink="https://techtutorialsx.com/2019/07/21/esp32-arduino-updating-firmware-from-the-spiffs-file-system/image-6-3/" data-orig-file="https://i1.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-6.png?fit=550%2C119&amp;ssl=1" data-orig-size="550,119" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image-6" data-image-description="" data-medium-file="https://i1.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-6.png?fit=300%2C65&amp;ssl=1" data-large-file="https://i1.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-6.png?fit=525%2C114&amp;ssl=1" src="https://i1.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-6.png?w=525&amp;ssl=1" alt="Content of the Sketch folder, containing the compiled binary." class="wp-image-27448 jetpack-lazy-image jetpack-lazy-image--handled" data-recalc-dims="1" srcset="https://i1.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-6.png?w=550&amp;ssl=1 550w, https://i1.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-6.png?resize=300%2C65&amp;ssl=1 300w" data-lazy-loaded="1" sizes="(max-width: 525px) 100vw, 525px" style="box-sizing: inherit; border-style: none; height: auto; max-width: 100%;" />
         <figcaption style="box-sizing: inherit; display: table-caption; margin-top: 0.5em; margin-bottom: 1.5em; color: #555d66; font-size: 13px; caption-side: bottom; font-style: italic;"><span style="box-sizing: inherit; font-weight: 700;">Figure 3</span>&nbsp;– Content of the Sketch folder, containing the compiled binary.</figcaption>
         </figure>
      </div>
   <p style="box-sizing: inherit; margin-bottom: 1.5em; padding: 0px;">To simplify accessing it later, you can edit the name of the binary file to be called “<span style="box-sizing: inherit; font-weight: 700;">firmware.bin</span>“. In the code of the next section, when accessing the file in the SPIFFS file system, I’ll be assuming this name. Figure 4 shows how the file should look like after the rename.</p>
   <div class="wp-block-image" style="box-sizing: inherit; margin-bottom: 1.5em;">
      <figure class="aligncenter" style="box-sizing: inherit; display: table; margin: 0px auto; clear: both;"><img data-attachment-id="27449" data-permalink="https://techtutorialsx.com/2019/07/21/esp32-arduino-updating-firmware-from-the-spiffs-file-system/image-7-4/" data-orig-file="https://i0.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-7.png?fit=560%2C113&amp;ssl=1" data-orig-size="560,113" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image-7" data-image-description="" data-medium-file="https://i0.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-7.png?fit=300%2C61&amp;ssl=1" data-large-file="https://i0.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-7.png?fit=525%2C106&amp;ssl=1" src="https://i0.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-7.png?w=525&amp;ssl=1" alt="Renaming the binary file of the compiled Sketch." class="wp-image-27449 jetpack-lazy-image jetpack-lazy-image--handled" data-recalc-dims="1" srcset="https://i0.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-7.png?w=560&amp;ssl=1 560w, https://i0.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-7.png?resize=300%2C61&amp;ssl=1 300w" data-lazy-loaded="1" sizes="(max-width: 525px) 100vw, 525px" style="box-sizing: inherit; border-style: none; height: auto; max-width: 100%;" />
         <figcaption style="box-sizing: inherit; display: table-caption; margin-top: 0.5em; margin-bottom: 1.5em; color: #555d66; font-size: 13px; caption-side: bottom; font-style: italic;"><span style="box-sizing: inherit; font-weight: 700;">Figure 4</span>&nbsp;– Renaming the binary file.</figcaption>
         </figure>
      </div>
   <p style="box-sizing: inherit; margin-bottom: 1.5em; padding: 0px;">So, after renaming the file, we still need to upload it to the ESP32 file system. The easiest way is by using&nbsp;<a href="https://github.com/me-no-dev/arduino-esp32fs-plugin" style="box-sizing: inherit; background-color: transparent; color: #222222; text-decoration-line: none; box-shadow: rgb(15, 15, 15) 0px -1px 0px inset; transition: color 80ms ease-in 0s, box-shadow 130ms ease-in-out 0s, -webkit-box-shadow 130ms ease-in-out 0s;" target="_blank">this</a>&nbsp;plugin. You can check&nbsp;<a href="https://techtutorialsx.com/2018/08/24/esp32-arduino-spiffs-file-upload-ide-plugin/" style="box-sizing: inherit; background-color: transparent; color: #222222; text-decoration-line: none; box-shadow: rgb(15, 15, 15) 0px -1px 0px inset; transition: color 80ms ease-in 0s, box-shadow 130ms ease-in-out 0s, -webkit-box-shadow 130ms ease-in-out 0s;" target="_blank">here</a>&nbsp;a detailed guide on how to use it.</p>
   <p style="box-sizing: inherit; margin-bottom: 1.5em; padding: 0px;">In short, we simply need to create a folder called&nbsp;<span style="box-sizing: inherit; font-weight: 700;">data</span>&nbsp;inside our sketch folder (the one where we are currently located). This is shown in figure 5.</p>
   <div class="wp-block-image" style="box-sizing: inherit; margin-bottom: 1.5em;">
      <figure class="aligncenter" style="box-sizing: inherit; display: table; margin: 0px auto; clear: both;"><img data-attachment-id="27450" data-permalink="https://techtutorialsx.com/2019/07/21/esp32-arduino-updating-firmware-from-the-spiffs-file-system/image-8-4/" data-orig-file="https://i1.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-8.png?fit=549%2C136&amp;ssl=1" data-orig-size="549,136" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image-8" data-image-description="" data-medium-file="https://i1.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-8.png?fit=300%2C74&amp;ssl=1" data-large-file="https://i1.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-8.png?fit=525%2C130&amp;ssl=1" src="https://i1.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-8.png?w=525&amp;ssl=1" alt="Creating the data folder inside the Arduino Sketch folder." class="wp-image-27450 jetpack-lazy-image jetpack-lazy-image--handled" data-recalc-dims="1" srcset="https://i1.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-8.png?w=549&amp;ssl=1 549w, https://i1.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-8.png?resize=300%2C74&amp;ssl=1 300w" data-lazy-loaded="1" sizes="(max-width: 525px) 100vw, 525px" style="box-sizing: inherit; border-style: none; height: auto; max-width: 100%;" />
         <figcaption style="box-sizing: inherit; display: table-caption; margin-top: 0.5em; margin-bottom: 1.5em; color: #555d66; font-size: 13px; caption-side: bottom; font-style: italic;"><span style="box-sizing: inherit; font-weight: 700;">Figure 5</span>&nbsp;– Creating the data folder.</figcaption>
         </figure>
      </div>
   <p style="box-sizing: inherit; margin-bottom: 1.5em; padding: 0px;">Then, we need to place there the files we want to upload to the ESP32 SPIFFS file system. In our case, we should place there the “<span style="box-sizing: inherit; font-weight: 700;">firmware.bin</span>” file, as illustrated in figure 6.</p>
   <figure class="wp-block-image" style="box-sizing: inherit; margin: 1em 0px 1.5em;"><img data-attachment-id="27451" data-permalink="https://techtutorialsx.com/2019/07/21/esp32-arduino-updating-firmware-from-the-spiffs-file-system/image-9-3/" data-orig-file="https://i0.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-9.png?fit=602%2C95&amp;ssl=1" data-orig-size="602,95" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image-9" data-image-description="" data-medium-file="https://i0.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-9.png?fit=300%2C47&amp;ssl=1" data-large-file="https://i0.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-9.png?fit=525%2C83&amp;ssl=1" src="https://i0.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-9.png?w=525&amp;ssl=1" alt="Final content of the data folder." class="wp-image-27451 jetpack-lazy-image jetpack-lazy-image--handled" data-recalc-dims="1" srcset="https://i0.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-9.png?w=602&amp;ssl=1 602w, https://i0.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-9.png?resize=300%2C47&amp;ssl=1 300w" data-lazy-loaded="1" sizes="(max-width: 525px) 100vw, 525px" style="box-sizing: inherit; border-style: none; height: auto; max-width: 100%;" />
      <figcaption style="box-sizing: inherit; margin-top: 0.5em; margin-bottom: 1.5em; color: #555d66; font-size: 13px; font-style: italic;"><span style="box-sizing: inherit; font-weight: 700;">Figure 6</span>&nbsp;– Final content of the data folder.</figcaption>
      </figure>
   <p style="box-sizing: inherit; margin-bottom: 1.5em; padding: 0px;">Then we go back to the Arduino IDE and under the&nbsp;<span style="box-sizing: inherit; font-weight: 700;">Tools</span>&nbsp;menu we just need to select the “<span style="box-sizing: inherit; font-weight: 700;">ESP32 Sketch Data Upload</span>” option, with the ESP32 connected to the computer. This is shown in figure 7.</p>
   <figure class="wp-block-image" style="box-sizing: inherit; margin: 1em 0px 1.5em;"><img data-attachment-id="27454" data-permalink="https://techtutorialsx.com/2019/07/21/esp32-arduino-updating-firmware-from-the-spiffs-file-system/image-12-3/" data-orig-file="https://i2.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-12.png?fit=718%2C596&amp;ssl=1" data-orig-size="718,596" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="image-12" data-image-description="" data-medium-file="https://i2.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-12.png?fit=300%2C249&amp;ssl=1" data-large-file="https://i2.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-12.png?fit=525%2C436&amp;ssl=1" src="https://i2.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-12.png?w=525&amp;ssl=1" alt="Uploading the content of the data folder to the SPIFFS file system, using the Arduino IDE." class="wp-image-27454 jetpack-lazy-image jetpack-lazy-image--handled" data-recalc-dims="1" srcset="https://i2.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-12.png?w=718&amp;ssl=1 718w, https://i2.wp.com/techtutorialsx.com/wp-content/uploads/2019/07/image-12.png?resize=300%2C249&amp;ssl=1 300w" data-lazy-loaded="1" sizes="(max-width: 525px) 100vw, 525px" style="box-sizing: inherit; border-style: none; height: auto; max-width: 100%;" />
      <figcaption style="box-sizing: inherit; margin-top: 0.5em; margin-bottom: 1.5em; color: #555d66; font-size: 13px; font-style: italic;"><span style="box-sizing: inherit; font-weight: 700;">Figure 7</span>&nbsp;– Uploading the content of the data folder to the SPIFFS file system.</figcaption>
      </figure>
   <p style="box-sizing: inherit; margin-bottom: 1.5em; padding: 0px;">Once the procedure finishes, the binary file should be on the device SPIFFS file system.</p>
   <h2 style="box-sizing: inherit; clear: both; line-height: 1.4; margin: 0px 0px 0.75em; padding: 1.5em 0px 0px; color: #666666; font-size: 1.625rem; font-weight: 300;">The code</h2>
   <p style="box-sizing: inherit; margin-bottom: 1.5em; padding: 0px;">We will start our code by including the libraries we need. We will need the&nbsp;<span style="box-sizing: inherit; font-weight: 700;">SPIFFS.h</span>, to be able to access the binary file on the file system, and the&nbsp;<span style="box-sizing: inherit; font-weight: 700;">Update.h</span>, which exposes the functionality we need to update the firmware of the ESP32.</p>
   <p style="box-sizing: inherit; margin-bottom: 1.5em; padding: 0px;">You can check the header file of the&nbsp;<span style="box-sizing: inherit; font-weight: 700;">Update.h</span>&nbsp;library&nbsp;<a href="https://github.com/espressif/arduino-esp32/blob/master/libraries/Update/src/Update.h" style="box-sizing: inherit; background-color: transparent; color: #222222; text-decoration-line: none; box-shadow: rgb(15, 15, 15) 0px -1px 0px inset; transition: color 80ms ease-in 0s, box-shadow 130ms ease-in-out 0s, -webkit-box-shadow 130ms ease-in-out 0s;" target="_blank">here</a>. The implementation file can be seen&nbsp;<a href="https://github.com/espressif/arduino-esp32/blob/master/libraries/Update/src/Updater.cpp" style="box-sizing: inherit; background-color: transparent; color: #222222; text-decoration-line: none; box-shadow: rgb(15, 15, 15) 0px -1px 0px inset; transition: color 80ms ease-in 0s, box-shadow 130ms ease-in-out 0s, -webkit-box-shadow 130ms ease-in-out 0s;" target="_blank">here</a>.</p>
   <div style="box-sizing: inherit;">
      <div id="highlighter_510838" class="syntaxhighlighter  cpp" style="box-sizing: inherit; width: 524.313px; margin: 1em 0px !important; position: relative !important; overflow: auto hidden !important; font-size: 1em !important;">
         <table border="0" cellpadding="0" cellspacing="0" style="width: 524px; box-sizing: content-box !important; margin: 0px !important; border-radius: 0px !important; background: none !important; border-width: 0px !important; border-style: initial !important; border-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; font-family: Monaco, 