<?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[ENV Hat 3 and StickC Plus 2 [Wire.513] requestFrom(): i2cRead returned Error 263]]></title><description><![CDATA[<p dir="auto">Hi everyone,</p>
<p dir="auto">I am currently struggeling with getting my newly purchesd ENV 3 Hat and StickC Plus 2 to work.</p>
<p dir="auto"><strong>Current Error:</strong> "ENV Hat 3 and StickC Plus 2 [Wire.513] requestFrom(): i2cRead returned Error 263"</p>
<p dir="auto">My code looks like this:</p>
<p dir="auto">It is a combination of these two example (<a href="https://github.com/m5stack/M5StickCPlus2/blob/master/examples/Basic/display/display.ino" target="_blank" rel="noopener noreferrer nofollow ugc">Example1</a>, <a href="https://github.com/m5stack/M5Unit-ENV/blob/master/examples/Hat_ENVIII_M5StickCPlus/Hat_ENVIII_M5StickCPlus.ino" target="_blank" rel="noopener noreferrer nofollow ugc">Example2</a>)</p>
<pre><code>#include "M5StickCPlus2.h"
#include "M5UnitENV.h"

SHT3X sht3x;
QMP6988 qmp;

void draw_function(LovyanGFX* gfx) {
    int x      = rand() % gfx-&gt;width();
    int y      = rand() % gfx-&gt;height();
    int r      = (gfx-&gt;width() &gt;&gt; 4) + 2;
    uint16_t c = rand();
    gfx-&gt;fillRect(x - r, y - r, r * 2, r * 2, c);
}

void setup() {
    auto cfg = M5.config();
    StickCP2.begin(cfg);
    int textsize = StickCP2.Display.height() / 60;
    if (textsize == 0) {
        textsize = 1;
    }
    StickCP2.Display.setTextSize(textsize);
    
    if (!qmp.begin(&amp;Wire, QMP6988_SLAVE_ADDRESS_L, 0, 26, 400000U)) {
        Serial.println("Couldn't find QMP6988");
        while (1) delay(1);
    }

    if (!sht3x.begin(&amp;Wire, SHT3X_I2C_ADDR, 0, 26, 400000U)) {
        Serial.println("Couldn't find SHT3X");
        while (1) delay(1);
    }
}

void loop() {
    int x      = rand() % StickCP2.Display.width();
    int y      = rand() % StickCP2.Display.height();
    int r      = (StickCP2.Display.width() &gt;&gt; 4) + 2;
    uint16_t c = rand();
    StickCP2.Display.fillCircle(x, y, r, c);
    draw_function(&amp;StickCP2.Display);

      if (sht3x.update()) {
        Serial.println("-----SHT3X-----");
        Serial.print("Temperature: ");
        Serial.print(sht3x.cTemp);
        Serial.println(" degrees C");
        Serial.print("Humidity: ");
        Serial.print(sht3x.humidity);
        Serial.println("% rH");
        Serial.println("-------------\r\n");
    }

    if (qmp.update()) {
        Serial.println("-----QMP6988-----");
        Serial.print(F("Temperature: "));
        Serial.print(qmp.cTemp);
        Serial.println(" *C");
        Serial.print(F("Pressure: "));
        Serial.print(qmp.pressure);
        Serial.println(" Pa");
        Serial.print(F("Approx altitude: "));
        Serial.print(qmp.altitude);
        Serial.println(" m");
        Serial.println("-------------\r\n");
    }
    delay(1000);
}
</code></pre>
<p dir="auto">Produces the following output:</p>
<p dir="auto">*<em><strong>[377696][E][Wire.cpp:513] requestFrom(): i2cRead returned Error 263<br />
[377724][E][Wire.cpp:513] requestFrom(): i2cRead returned Error 263<br />
-----QMP6988-----<br />
Temperature: 0.00 <em>C<br />
Pressure: 0.00 Pa<br />
Approx altitude: inf m<br />
-------------</em></strong></em></p>
<p dir="auto">I am happy for any help to get these two to work :)</p>
<p dir="auto">Greetings  Pascal</p>
]]></description><link>https://community.m5stack.com/topic/6718/env-hat-3-and-stickc-plus-2-wire-513-requestfrom-i2cread-returned-error-263</link><generator>RSS for Node</generator><lastBuildDate>Mon, 04 May 2026 00:01:20 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/6718.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 22 Aug 2024 12:23:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ENV Hat 3 and StickC Plus 2 [Wire.513] requestFrom(): i2cRead returned Error 263 on Wed, 04 Sep 2024 04:58:58 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/pascals" aria-label="Profile: PascalS">@<bdi>PascalS</bdi></a> Now I see the problem.<br />
<strong>Wire</strong> is hard defined and set to internal.</p>
<p dir="auto">You need to use <strong>Wire1</strong> to access the external devices.<br />
I vaguely remember reading about this issue before but as I don't have arduino I had forgotten about it.<br />
Thanks for the reminder.</p>
]]></description><link>https://community.m5stack.com/post/26344</link><guid isPermaLink="true">https://community.m5stack.com/post/26344</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Wed, 04 Sep 2024 04:58:58 GMT</pubDate></item><item><title><![CDATA[Reply to ENV Hat 3 and StickC Plus 2 [Wire.513] requestFrom(): i2cRead returned Error 263 on Tue, 03 Sep 2024 13:07:27 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a> Finally I got the solution using separate Wires and PlattformIO to manage my libraries :)</p>
<p dir="auto">With the following ini file (PlattformIO config file)</p>
<pre><code>[env:miniscale]
platform = espressif32@6.1.0
board = m5stick-c
framework = arduino
lib_ldf_mode = deep
monitor_speed = 115200
build_flags = 
	-DCORE_DEBUG_LEVEL=0
	-Wl,--allow-multiple-definition
lib_deps = 
	https://github.com/m5stack/M5StickCPlus2.git
	m5stack/M5Unit-ENV@^1.0.1
</code></pre>
<p dir="auto">Not knowing why, but I need the "-Wl" to run at all and the "--allow-multiple-definition" flag for the hat to work in conjunction with sensors mounted to the groove port.<br />
It worked, however, I need to change the I2C begin call from "Wire0" (just called Wire) to the secondary I2C channel Wire1</p>
<p dir="auto">Before:</p>
<pre><code>while (!qmp.begin(&amp;Wire, QMP6988_SLAVE_ADDRESS_L, 0, 26, 400000U)) {
     Serial.println("QMP6988 not found");
 }
</code></pre>
<p dir="auto">After:</p>
<pre><code>while (!qmp.begin(&amp;Wire1, QMP6988_SLAVE_ADDRESS_L, 0, 26, 400000U)) {
     Serial.println("QMP6988 not found");
 }
</code></pre>
<p dir="auto">Maybe this helps someone in the future :)</p>
]]></description><link>https://community.m5stack.com/post/26335</link><guid isPermaLink="true">https://community.m5stack.com/post/26335</guid><dc:creator><![CDATA[PascalS]]></dc:creator><pubDate>Tue, 03 Sep 2024 13:07:27 GMT</pubDate></item><item><title><![CDATA[Reply to ENV Hat 3 and StickC Plus 2 [Wire.513] requestFrom(): i2cRead returned Error 263 on Fri, 30 Aug 2024 09:41:00 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/pascals" aria-label="Profile: PascalS">@<bdi>PascalS</bdi></a></p>
<p dir="auto">at least we know now that the hardware is ok.</p>
<p dir="auto">Apart from that I am stumped. Sorry.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/26281</link><guid isPermaLink="true">https://community.m5stack.com/post/26281</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Fri, 30 Aug 2024 09:41:00 GMT</pubDate></item><item><title><![CDATA[Reply to ENV Hat 3 and StickC Plus 2 [Wire.513] requestFrom(): i2cRead returned Error 263 on Thu, 29 Aug 2024 11:45:09 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a> You were right, in UIFlow 2 it worked perfectly fine. However, I need them to work in Arduino, so that it fits with our current framework.</p>
<p dir="auto">Do you know were the difference between UIFlow 2 and Arduino is?</p>
]]></description><link>https://community.m5stack.com/post/26268</link><guid isPermaLink="true">https://community.m5stack.com/post/26268</guid><dc:creator><![CDATA[PascalS]]></dc:creator><pubDate>Thu, 29 Aug 2024 11:45:09 GMT</pubDate></item><item><title><![CDATA[Reply to ENV Hat 3 and StickC Plus 2 [Wire.513] requestFrom(): i2cRead returned Error 263 on Wed, 28 Aug 2024 17:01:37 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/pascals" aria-label="Profile: PascalS">@<bdi>PascalS</bdi></a></p>
<p dir="auto">hmm, that is really strange. Do you have any other hat to try if the hat port works for you in general?</p>
<p dir="auto">ENV III hat is supported in UIFlow2. Maybe try with UIFlow2? Just to see if it works that way.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/26261</link><guid isPermaLink="true">https://community.m5stack.com/post/26261</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Wed, 28 Aug 2024 17:01:37 GMT</pubDate></item><item><title><![CDATA[Reply to ENV Hat 3 and StickC Plus 2 [Wire.513] requestFrom(): i2cRead returned Error 263 on Wed, 28 Aug 2024 11:11:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a> Unfortunately, also a newly bought M5Stick and a newly bought ENV hat didn´t change anything.</p>
<p dir="auto">Could it be that the hat port uses another Wire?</p>
]]></description><link>https://community.m5stack.com/post/26254</link><guid isPermaLink="true">https://community.m5stack.com/post/26254</guid><dc:creator><![CDATA[PascalS]]></dc:creator><pubDate>Wed, 28 Aug 2024 11:11:31 GMT</pubDate></item><item><title><![CDATA[Reply to ENV Hat 3 and StickC Plus 2 [Wire.513] requestFrom(): i2cRead returned Error 263 on Fri, 23 Aug 2024 12:57:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a> Thanks for your help :)</p>
<p dir="auto">Propably it is a hardware failure, I do not get any i2c signals back.</p>
<p dir="auto">Wil return it and run it with new hardware. I update the thread when I heard back from the seller.</p>
<p dir="auto">Thanks for your help!</p>
<p dir="auto">Greetings Pascal</p>
]]></description><link>https://community.m5stack.com/post/26212</link><guid isPermaLink="true">https://community.m5stack.com/post/26212</guid><dc:creator><![CDATA[PascalS]]></dc:creator><pubDate>Fri, 23 Aug 2024 12:57:20 GMT</pubDate></item><item><title><![CDATA[Reply to ENV Hat 3 and StickC Plus 2 [Wire.513] requestFrom(): i2cRead returned Error 263 on Fri, 23 Aug 2024 12:49:30 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/pascals" aria-label="Profile: PascalS">@<bdi>PascalS</bdi></a></p>
<p dir="auto">hmm, have you tried to power cycle M5StickCPlus2?</p>
<ol>
<li>disconnect USB</li>
<li>remove HAT</li>
<li>press and hold power button until green LED lights up</li>
<li>release power button - green LED goes dark - M5StickCPlus2 is now off</li>
<li>re-attach HAT</li>
<li>re-connect USB - M5StickCPlus2 powers on</li>
<li>re-test</li>
</ol>
<p dir="auto">Thanks<br />
Felix</p>
<p dir="auto">P.S. if that doesn't make the HAT show up in the I2C scan or make it work with the original program then I am afraid that yes, there might be a hardware issue.</p>
]]></description><link>https://community.m5stack.com/post/26211</link><guid isPermaLink="true">https://community.m5stack.com/post/26211</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Fri, 23 Aug 2024 12:49:30 GMT</pubDate></item><item><title><![CDATA[Reply to ENV Hat 3 and StickC Plus 2 [Wire.513] requestFrom(): i2cRead returned Error 263 on Fri, 23 Aug 2024 11:01:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a></p>
<p dir="auto">The port scan went as expect, only internals are found.</p>
<p dir="auto">I2C Scan - internal<br />
................................................................................0x51 ......................0x68 ......................<br />
I2C Scan - Groove Port<br />
..............................................................................................................................<br />
I2C Scan - Hat Port<br />
..............................................................................................................................</p>
<p dir="auto">Does that mean a hardware error?</p>
<p dir="auto">Greetings Pascal</p>
]]></description><link>https://community.m5stack.com/post/26208</link><guid isPermaLink="true">https://community.m5stack.com/post/26208</guid><dc:creator><![CDATA[PascalS]]></dc:creator><pubDate>Fri, 23 Aug 2024 11:01:00 GMT</pubDate></item><item><title><![CDATA[Reply to ENV Hat 3 and StickC Plus 2 [Wire.513] requestFrom(): i2cRead returned Error 263 on Fri, 23 Aug 2024 10:58:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a> Thanks for the link.</p>
<p dir="auto">Strangely, they are now not showing up (not found is now in the log). That wasnt before.</p>
]]></description><link>https://community.m5stack.com/post/26207</link><guid isPermaLink="true">https://community.m5stack.com/post/26207</guid><dc:creator><![CDATA[PascalS]]></dc:creator><pubDate>Fri, 23 Aug 2024 10:58:15 GMT</pubDate></item><item><title><![CDATA[Reply to ENV Hat 3 and StickC Plus 2 [Wire.513] requestFrom(): i2cRead returned Error 263 on Fri, 23 Aug 2024 10:55:46 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/pascals" aria-label="Profile: PascalS">@<bdi>PascalS</bdi></a></p>
<p dir="auto">from your first log I think the ENV III Hat was recognized properly else the log would have ended with either of the "Couldn't find ...".</p>
<p dir="auto">Anyways, please find an I2C scanner for internal, Groove and Hat <a href="https://github.com/felmue/MyM5StackExamples/blob/main/M5StickCPlus2/I2CScanInternalGrooveHat/I2CScanInternalGrooveHat.ino" target="_blank" rel="noopener noreferrer nofollow ugc">here</a>.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/26205</link><guid isPermaLink="true">https://community.m5stack.com/post/26205</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Fri, 23 Aug 2024 10:55:46 GMT</pubDate></item><item><title><![CDATA[Reply to ENV Hat 3 and StickC Plus 2 [Wire.513] requestFrom(): i2cRead returned Error 263 on Fri, 23 Aug 2024 09:00:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a> From your posts, I get the feeling that you have a lot of knowledge. :)</p>
<p dir="auto">As a last ressort, I tried to find a I2C scanner sketch and ended up with the following code.</p>
<pre><code>/*********
  Rui Santos
  Complete project details at https://randomnerdtutorials.com  
*********/

#include &lt;Wire.h&gt;
 
void setup() {
  Wire.begin();
  Serial.begin(115200);
  Serial.println("\nI2C Scanner");
}
 
void loop() {
  byte error, address;
  int nDevices;
  Serial.println("Scanning...");
  nDevices = 0;
  for(address = 1; address &lt; 127; address++ ) {
    Wire.beginTransmission(address);
    error = Wire.endTransmission();
    if (error == 0) {
      Serial.print("I2C device found at address 0x");
      if (address&lt;16) {
        Serial.print("0");
      }
      Serial.println(address,HEX);
      nDevices++;
    }
    else if (error==4) {
      Serial.print("Unknow error at address 0x");
      if (address&lt;16) {
        Serial.print("0");
      }
      Serial.println(address,HEX);
    }    
  }
  if (nDevices == 0) {
    Serial.println("No I2C devices found\n");
  }
  else {
    Serial.println("done\n");
  }
  delay(5000);          
}
</code></pre>
<p dir="auto">I was not sure, but in all the sketches they used sda=0 and scl=26.</p>
<p dir="auto">If I scan those, I cant get any devices found. However, if I scan the standard sda/scl = 21/22, then I find two devices (propably build into the Stick itself).</p>
<p dir="auto">Is this a sign for an hardware failure?</p>
<p dir="auto">Greetings Pascal</p>
]]></description><link>https://community.m5stack.com/post/26204</link><guid isPermaLink="true">https://community.m5stack.com/post/26204</guid><dc:creator><![CDATA[PascalS]]></dc:creator><pubDate>Fri, 23 Aug 2024 09:00:38 GMT</pubDate></item><item><title><![CDATA[Reply to ENV Hat 3 and StickC Plus 2 [Wire.513] requestFrom(): i2cRead returned Error 263 on Thu, 22 Aug 2024 17:41:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/pascals" aria-label="Profile: PascalS">@<bdi>PascalS</bdi></a></p>
<p dir="auto">the only difference between Hat and Unit (apart from the different GPIOs it uses as <a class="plugin-mentions-user plugin-mentions-a" href="/user/ajb2k3" aria-label="Profile: ajb2k3">@<bdi>ajb2k3</bdi></a> pointed out) is that the Hat is powered by 3.3 V from M5StickCPlus2 whereas the Unit is powerd by 5 V (with an internal DC/DC converter).</p>
<p dir="auto">I used the <a href="https://github.com/m5stack/M5Unit-ENV" target="_blank" rel="noopener noreferrer nofollow ugc">M5Unit-ENV</a> library, copied the code you posted and manually wired the Unit to the Hat port. In other word I used exactly the code you posted without any modifications.</p>
<p dir="auto">Sorry, at this point I have not more ideas as to why it wouldn't work on your side.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/26201</link><guid isPermaLink="true">https://community.m5stack.com/post/26201</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Thu, 22 Aug 2024 17:41:20 GMT</pubDate></item><item><title><![CDATA[Reply to ENV Hat 3 and StickC Plus 2 [Wire.513] requestFrom(): i2cRead returned Error 263 on Thu, 22 Aug 2024 17:14:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/pascals" aria-label="Profile: PascalS">@<bdi>PascalS</bdi></a> HATS use different pins to UNITS</p>
]]></description><link>https://community.m5stack.com/post/26198</link><guid isPermaLink="true">https://community.m5stack.com/post/26198</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Thu, 22 Aug 2024 17:14:00 GMT</pubDate></item><item><title><![CDATA[Reply to ENV Hat 3 and StickC Plus 2 [Wire.513] requestFrom(): i2cRead returned Error 263 on Thu, 22 Aug 2024 15:51:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/felmue" aria-label="Profile: felmue">@<bdi>felmue</bdi></a> Thanks for your test.</p>
<p dir="auto">Unfortunately I cant get either of them to connect.</p>
<p dir="auto">Is their a difference between Hat and Unit? Which library versions did you use?</p>
]]></description><link>https://community.m5stack.com/post/26196</link><guid isPermaLink="true">https://community.m5stack.com/post/26196</guid><dc:creator><![CDATA[PascalS]]></dc:creator><pubDate>Thu, 22 Aug 2024 15:51:44 GMT</pubDate></item><item><title><![CDATA[Reply to ENV Hat 3 and StickC Plus 2 [Wire.513] requestFrom(): i2cRead returned Error 263 on Thu, 22 Aug 2024 13:49:45 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/pascals" aria-label="Profile: PascalS">@<bdi>PascalS</bdi></a></p>
<p dir="auto">hmm, your code works for me.</p>
<p dir="auto">Note: I don't have an ENV III <strong>hat</strong>, but I have the ENV III <strong>unit</strong> which I used to simulate ENV III hat. So it could be something subtle between the two making it work for me.</p>
<p dir="auto">That said, I suggest you first try with the ENV III example alone and if that still doesn't work try to only init and read either qmp or sht3x and see how that goes.</p>
<p dir="auto">Thanks<br />
Felix</p>
]]></description><link>https://community.m5stack.com/post/26194</link><guid isPermaLink="true">https://community.m5stack.com/post/26194</guid><dc:creator><![CDATA[felmue]]></dc:creator><pubDate>Thu, 22 Aug 2024 13:49:45 GMT</pubDate></item></channel></rss>