Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    GPy with BNO055 - I2C bus error

    Scheduled Pinned Locked Moved Discussion
    accelerometergpyi2c bus error
    9 Posts 4 Posters 1.6k Views 4 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.
    • S Offline
      sprasad
      last edited by

      I'm trying to interface the bno055 breakout board (by adafruit) with my GPy module. I'm using following micro python library for bno055 https://bitbucket.org/thesheep/micropython-bno055/src

      Upon running the code shown below, following error is got 'OSError: I2C bus error' with a mention of some line numbers in bno055.py and functools.py. However, i2c scan returns the correct device address as 40 (0x28). How can I proceed?

      from machine import Pin, I2C
      import time
      import bno055
      
      i2c = 
      I2C(0, I2C.MASTER, baudrate=1000, pins=(Pin.exp_board.G15, Pin.exp_board.G16))  
      print(i2c.scan()) #Prints "[40]"
      
      s = bno055.BNO055(i2c)
      print(s.temperature())
      print(s.euler())
      i2c.deinit()
      
      L M 2 Replies Last reply Reply Quote 0
      • L Offline
        livius @sprasad
        last edited by

        @sprasad said in GPy with BNO055 - I2C bus error:

        'OSError: I2C bus error' with a mention of some line numbers in bno055.py

        which line?

        and do you use SD card? I ask because you set in i2c init non standard pins - one is from SD card data0.
        Also do you use some externall pullups on i2c line?

        think about people first, then computers

        S 1 Reply Last reply Reply Quote 0
        • S Offline
          sprasad @livius
          last edited by

          @livius here is the complete error

          Traceback (most recent call last):
            File "<stdin>", line 10, in <module>
            File "bno055.py", line 46, in __init__
            File "bno055.py", line 91, in init
            File "bno055.py", line 108, in reset
            File "bno055.py", line 107, in reset
            File "bno055.py", line 104, in reset
            File "functools.py", line 5, in _partial
            File "bno055.py", line 63, in _register
            File "bno055.py", line 51, in _registers
          OSError: I2C bus error
          

          I'm not using SD Card. I'm just using some random pins, no relation as such with anything else.
          I'm not using any external pullups as well.

          L 1 Reply Last reply Reply Quote 0
          • sebS Offline
            seb
            last edited by seb

            @sprasad said in GPy with BNO055 - I2C bus error:

            bno055

            do you have external pull up resistors?

            Edit: your last post says you dont, try adding some

            S 1 Reply Last reply Reply Quote 0
            • L Offline
              livius @sprasad
              last edited by

              @sprasad
              try on default baudrate
              baudrate=100000

              think about people first, then computers

              S 1 Reply Last reply Reply Quote 0
              • S Offline
                sprasad @livius
                last edited by

                @livius I2C device isn't detected at this baud rate. i2c.scan() returns an empty list.

                1 Reply Last reply Reply Quote 0
                • S Offline
                  sprasad @seb
                  last edited by

                  @seb Adafruit documentation says pullups are already present on SDA and SCL pins.
                  SCL - I2C clock pin, connect to your microcontrollers I2C clock line. This pin can be used with 3V or 5V logic, and there's a 10K pullup on this pin.
                  SDA - I2C data pin, connect to your microcontrollers I2C data line. This pin can be used with 3V or 5V logic, and there's a 10K pullup on this pin.

                  L 1 Reply Last reply Reply Quote 0
                  • L Offline
                    livius @sprasad
                    last edited by

                    @sprasad
                    can you show some picture of your setup? It is soldered or simple wires?
                    Did you checked some basic steps like properly connected wires especially GND from sensor to GND to the board?

                    think about people first, then computers

                    1 Reply Last reply Reply Quote 1
                    • M Offline
                      MarcoBenini @sprasad
                      last edited by MarcoBenini

                      @sprasad said in GPy with BNO055 - I2C bus error:

                      I2C(0, I2C.MASTER, baudrate=1000, pins=(Pin.exp_board.G15, Pin.exp_board.G16)) > ```

                      Expansion board G15 and G16 are P8 and P9.
                      P8 is the SD_Data, but You don't use the SD card, the P9 on expansion board is the "led" pin.
                      Try removing the led jumper "enable led signal" on expansion board to disable it.

                      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
                      • 1 / 1
                      • First post
                        Last post

                      Pycom on Twitter

                      Pycom