{"id":4589,"date":"2024-12-16T07:03:26","date_gmt":"2024-12-16T13:03:26","guid":{"rendered":"https:\/\/lab.rapternet.us\/?p=4589"},"modified":"2024-12-03T22:03:27","modified_gmt":"2024-12-04T04:03:27","slug":"esp32-not-accepting-ota-updates","status":"publish","type":"post","link":"https:\/\/lab.rapternet.us\/?p=4589","title":{"rendered":"ESP32 not Accepting OTA Updates"},"content":{"rendered":"\n<p>I started running into issues when I began using ESP32s instead of 8266s, I could do the initial flash over serial, and follow it up with some configuration. But the moment I tried to OTA update with further configuration, it would fail every time. The errors were always the same vein, connection reset by the ESP before the update could complete.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>The error message below is the message I got every time, each time at some different percentage complete, even at 95% it would fail.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">INFO Uploading \/data\/build\/esphome-web-757c70\/.pioenvs\/esphome-web-757c70\/firmware.bin (1370368 bytes)<br \/>Uploading: [=====================                                       ] 35% ERROR Error receiving acknowledge chunk OK: [Errno 104] Connection reset by peer<\/pre>\n\n\n\n<p>It took quite some time of trying various actions, none of which managed to fix the issues. I could always reflash via serial, but after that it would perpetually fail to OTA update. I finally tried changing the platform from Arduino to esp-idf.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">esp32:<br \/>  board: esp32dev<br \/>  framework:<br \/>    type: arduino<\/pre>\n\n\n\n<p>I found that swapping the framework type to esp-idf instead of arduino framework, and flashing it over serial would allow me to finally be able to OTA update again on the device. I&#8217;m not sure if this will be a long term fix yet, but so far so good. It managed to fix the problem on two of my ESP32 bare boards that I had been seeing the issue with, then I went and installed it on my boards that were in devices.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">esp32:<br \/>  board: esp32dev<br \/>  framework:<br \/>    type: esp-idf<\/pre>\n\n\n\n<p>I was able to flash with that over a serial connection to the ESP, and afterwards I could finally OTA update again.<\/p>\n\n\n\n<p>I ran into a side effect that caused my pn532 NFC readers to stop working in their default config despite compiling fine after this change. I&#8217;m still not sure what caused it, I fixed one by changing what GPIO it was connected to and then updating it a few times (oddly it didn&#8217;t work the first time).<\/p>\n\n\n\n<p>I don&#8217;t regret making the change though I wish the same GPIO usage would work with the new esp-idf platform that worked with the Arduino platform.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I started running into issues when I began using ESP32s instead of 8266s, I could do the initial flash over serial, and follow it up with some configuration. But the moment I tried to OTA update with further configuration, it would fail every time. The errors were always the same vein, connection reset by the &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/lab.rapternet.us\/?p=4589\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;ESP32 not Accepting OTA Updates&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[56],"tags":[76,74],"class_list":["post-4589","post","type-post","status-publish","format-standard","hentry","category-making","tag-espdeck","tag-esphome"],"_links":{"self":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts\/4589","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4589"}],"version-history":[{"count":7,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts\/4589\/revisions"}],"predecessor-version":[{"id":4651,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts\/4589\/revisions\/4651"}],"wp:attachment":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4589"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4589"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4589"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}