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

    [Solved]M5StickC I2C bus error

    UIFlow
    2
    5
    10.1k
    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.
    • C
      csqrd
      last edited by m5-docs

      While using the M5StickC with the ENV "environment sensor" connected I receive the following error when running the ENV sample UICode program (https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/ENV/UIFlo):

      >>> env0 = units.ENV(units.PORTA)
      Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "m5flow/units.py", line 83, in init
      File "lib/bmp280.py", line 147, in init
      OSError: I2C bus error (6)

      I tried a second ENV sensor and received the same error. Any suggestions would be appreciated.

      1 Reply Last reply Reply Quote 0
      • H
        heybin
        last edited by

        0_1555552359157_02cec498-7d5a-4e29-a25a-2b5dfd62779a-image.png

        check if the grove port is in proper contact :)

        1 Reply Last reply Reply Quote 0
        • C
          csqrd
          last edited by

          Thanks for the response. I replaced the grove cable with another grove cable and made sure it was fully seated and still got an error.

          >>> import units
          >>> a = units.E
          Traceback (most recent call last):
          File "<stdin>", line 1, in <module>
          AttributeError: 'module' object has no attribute 'E'

          >>> a = units.ENV(units.P)
          Traceback (most recent call last):
          File "<stdin>", line 1, in <module>
          AttributeError: 'module' object has no attribute 'P'

          >>> a = units.ENV(units.PORTA)
          >>>

          Tried this as well:
          >>> from machine import I2C
          >>> i2c = I2C(freq=400000, sda=21, scl=22)
          >>> Traceback (most recent call last):
          File "boot.py", line 29, in reboot
          File "m5flow/hardware/axp192.py", line 96, in btnState
          File "m5flow/hardware/axp192.py", line 103, in _regChar
          OSError: I2C bus error (6)

          >>> i2c.scan()
          [52, 81, 108]
          >>> Traceback (most recent call last):
          File "boot.py", line 29, in reboot
          File "m5flow/hardware/axp192.py", line 96, in btnState
          File "m5flow/hardware/axp192.py", line 103, in _regChar
          OSError: I2C bus error (6)

          1 Reply Last reply Reply Quote 0
          • H
            heybin
            last edited by

            0_1555556974669_dc7406be-8ad0-4191-821c-9002af3328ed-image.png
            It mean env init well, you can try a.temperature() and a.pressure() and a.humidity() to get msg

            1 Reply Last reply Reply Quote 0
            • H
              heybin
              last edited by

              StickC grove IIC not 21, 22, it`s 32, 33

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