🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    ENV Hat 3 and StickC Plus 2 [Wire.513] requestFrom(): i2cRead returned Error 263

    M5 Stick/StickC
    3
    17
    1.2k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      PascalS @felmue
      last edited by

      @felmue Thanks for the link.

      Strangely, they are now not showing up (not found is now in the log). That wasnt before.

      1 Reply Last reply Reply Quote 0
      • P
        PascalS @felmue
        last edited by

        @felmue

        The port scan went as expect, only internals are found.

        I2C Scan - internal
        ................................................................................0x51 ......................0x68 ......................
        I2C Scan - Groove Port
        ..............................................................................................................................
        I2C Scan - Hat Port
        ..............................................................................................................................

        Does that mean a hardware error?

        Greetings Pascal

        felmueF 1 Reply Last reply Reply Quote 0
        • felmueF
          felmue @PascalS
          last edited by felmue

          Hello @PascalS

          hmm, have you tried to power cycle M5StickCPlus2?

          1. disconnect USB
          2. remove HAT
          3. press and hold power button until green LED lights up
          4. release power button - green LED goes dark - M5StickCPlus2 is now off
          5. re-attach HAT
          6. re-connect USB - M5StickCPlus2 powers on
          7. re-test

          Thanks
          Felix

          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.

          GPIO translation table M5Stack / M5Core2
          Information about various M5Stack products.
          Code examples

          P 2 Replies Last reply Reply Quote 0
          • P
            PascalS @felmue
            last edited by

            @felmue Thanks for your help :)

            Propably it is a hardware failure, I do not get any i2c signals back.

            Wil return it and run it with new hardware. I update the thread when I heard back from the seller.

            Thanks for your help!

            Greetings Pascal

            1 Reply Last reply Reply Quote 0
            • P
              PascalS @felmue
              last edited by

              @felmue Unfortunately, also a newly bought M5Stick and a newly bought ENV hat didn´t change anything.

              Could it be that the hat port uses another Wire?

              felmueF 1 Reply Last reply Reply Quote 0
              • felmueF
                felmue @PascalS
                last edited by felmue

                Hello @PascalS

                hmm, that is really strange. Do you have any other hat to try if the hat port works for you in general?

                ENV III hat is supported in UIFlow2. Maybe try with UIFlow2? Just to see if it works that way.

                Thanks
                Felix

                GPIO translation table M5Stack / M5Core2
                Information about various M5Stack products.
                Code examples

                P 1 Reply Last reply Reply Quote 0
                • P
                  PascalS @felmue
                  last edited by

                  @felmue 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.

                  Do you know were the difference between UIFlow 2 and Arduino is?

                  felmueF 1 Reply Last reply Reply Quote 0
                  • felmueF
                    felmue @PascalS
                    last edited by

                    Hello @PascalS

                    at least we know now that the hardware is ok.

                    Apart from that I am stumped. Sorry.

                    Thanks
                    Felix

                    GPIO translation table M5Stack / M5Core2
                    Information about various M5Stack products.
                    Code examples

                    P 1 Reply Last reply Reply Quote 0
                    • P
                      PascalS @felmue
                      last edited by

                      @felmue Finally I got the solution using separate Wires and PlattformIO to manage my libraries :)

                      With the following ini file (PlattformIO config file)

                      [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
                      

                      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.
                      It worked, however, I need to change the I2C begin call from "Wire0" (just called Wire) to the secondary I2C channel Wire1

                      Before:

                      while (!qmp.begin(&Wire, QMP6988_SLAVE_ADDRESS_L, 0, 26, 400000U)) {
                           Serial.println("QMP6988 not found");
                       }
                      

                      After:

                      while (!qmp.begin(&Wire1, QMP6988_SLAVE_ADDRESS_L, 0, 26, 400000U)) {
                           Serial.println("QMP6988 not found");
                       }
                      

                      Maybe this helps someone in the future :)

                      ajb2k3A 1 Reply Last reply Reply Quote 1
                      • ajb2k3A
                        ajb2k3 @PascalS
                        last edited by

                        @PascalS Now I see the problem.
                        Wire is hard defined and set to internal.

                        You need to use Wire1 to access the external devices.
                        I vaguely remember reading about this issue before but as I don't have arduino I had forgotten about it.
                        Thanks for the reminder.

                        UIFlow, so easy an adult can learn it!
                        If I don't know it, be patient!
                        I've ether not learned it or am too drunk to remember it!
                        Author of the WIP UIFlow Handbook!
                        M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post