• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
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
795
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 Aug 23, 2024, 10:58 AM

    @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 Aug 23, 2024, 11:01 AM

      @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 Aug 23, 2024, 12:49 PM Reply Quote 0
      • felmueF
        felmue @PascalS
        last edited by felmue Aug 23, 2024, 8:49 PM Aug 23, 2024, 12:49 PM

        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 Aug 23, 2024, 12:57 PM Reply Quote 0
        • P
          PascalS @felmue
          last edited by Aug 23, 2024, 12:57 PM

          @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 Aug 28, 2024, 11:11 AM

            @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 Aug 28, 2024, 4:59 PM Reply Quote 0
            • felmueF
              felmue @PascalS
              last edited by felmue Aug 29, 2024, 1:01 AM Aug 28, 2024, 4:59 PM

              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 Aug 29, 2024, 11:45 AM Reply Quote 0
              • P
                PascalS @felmue
                last edited by Aug 29, 2024, 11:45 AM

                @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 Aug 30, 2024, 9:41 AM Reply Quote 0
                • felmueF
                  felmue @PascalS
                  last edited by Aug 30, 2024, 9:41 AM

                  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 Sep 3, 2024, 1:07 PM Reply Quote 0
                  • P
                    PascalS @felmue
                    last edited by Sep 3, 2024, 1:07 PM

                    @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 Sep 4, 2024, 4:58 AM Reply Quote 1
                    • ajb2k3A
                      ajb2k3 @PascalS
                      last edited by Sep 4, 2024, 4:58 AM

                      @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
                      17 out of 17
                      • First post
                        Last post

                      Looks like your connection to M5Stack Community was lost, please wait while we try to reconnect.