<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[M5StickCPlus OTA Failing in Update loop]]></title><description><![CDATA[<p dir="auto">Having been successful for months with the OTA updates with all my ESP devices, all of a sudden the loop in the library <strong>Updater.cpp</strong> is failing (found via printouts).</p>
<p dir="auto">file: ~/Library/Arduino15/packages/m5stack/hardware/esp32/2.0.4/libraries/Update/src/Updater.cpp</p>
<p dir="auto">I successfully retrieve a 'bin' file from a web location (over http) and then get to the update loop.</p>
<p dir="auto">Then the following never gets all the bits:</p>
<pre><code> size_t written = Update.writeStream(_client);
</code></pre>
<p dir="auto">Inside the while loop of writeStream, there is a call:</p>
<p dir="auto">toRead = data.readBytes(_buffer + _bufferLen, bytesToRead).</p>
<p dir="auto">While sometimes reading 4096 bytes, eventually this returns 0 and after a number of times (300 in code) it quits with an UPDATE_ERROR_STREAM (#6) error. Sometimes it return 0 but after a couple tries works.</p>
<p dir="auto">Anyone have any ideas on what might be the issue?   Why would the readBytes in general not work?</p>
<p dir="auto">Is this readBytes grabbing bits from the internet or from the binary already downloaded?</p>
<p dir="auto">thanks.</p>
]]></description><link>https://community.m5stack.com/topic/4794/m5stickcplus-ota-failing-in-update-loop</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Apr 2026 14:15:14 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/4794.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 10 Nov 2022 21:48:36 GMT</pubDate><ttl>60</ttl></channel></rss>