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

    (Solved)M5StickC+ToF:I2C bus error (19)

    Scheduled Pinned Locked Moved UIFlow
    4 Posts 2 Posters 6.4k Views 1 Watching
    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.
    • K Offline
      Koms
      last edited by Koms

      While using the M5StickC with the M5STACK-TOF-UNIT "Dostance Sensor" connected I receive the following error when running the simple block code on UIFlow

      It used to work fine(using same code), but suddenly I receive the error.

      Error:
      I2C bus error (19)

      Code(from UIFlow)

      from m5stack import *
      from m5ui import *
      from uiflow import *
      import time
      import unit
      
      setScreenColor(0x111111)
      tof0 = unit.get(unit.TOF, unit.PORTA)
      
      
      
      label0 = M5TextBox(8, 27, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
      
      
      while True:
        label0.setText(str(tof0.distance))
        wait(1)
        wait_ms(2)
      

      I try another code also, but I still recieved same error.
      it looks like

      tof0 = unit.get(unit.TOF, unit.PORTA)

      part might has a probelm.

      from m5stack import *
      from m5ui import *
      from uiflow import *
      import time
      import unit
      
      setScreenColor(0x111111)
      tof0 = unit.get(unit.TOF, unit.PORTA)
      
      
      
      
      
      label0 = M5TextBox(8, 27, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
      
      
      while True:
        label0.setText(str('Hello M5'))
        wait(1)
        wait_ms(2)
      

      Any suggestions would be appreciated.

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

        Hello @Koms

        I am running your code just fine with UIFlow firmware 1.7.3 on my M5StickC.

        • are you using the latest UIFlow firmware?
        • have you tried another cable? (I get error 19 when I disconnect the unit)
        • is the cable plugged in all the way?

        Thanks
        Felix

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

        1 Reply Last reply Reply Quote 0
        • K Offline
          Koms
          last edited by

          Hi! @felmue

          Thank you for your advices.

          are you using the latest UIFlow firmware?

          Yes

          have you tried another cable? (I get error 19 when I disconnect the unit)

          I tried another cable, the problem is solved!

          Thank you so much!

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

            Hello @Koms

            you are welcome. Thank you for reporting back. I am glad to hear you got it working.

            Cheers
            Felix

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

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • First post
              Last post