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

    FiPy with OV2640 camera - I2C bus error

    Scheduled Pinned Locked Moved FiPy
    8 Posts 4 Posters 101 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.
    • A Offline
      Adnan Sabovic 0
      last edited by

      Hi guys,

      I am trying to enable image capturing on my FiPy board using OV2640 and the driver for MicroPython that I found on your forum. I connected the camera to appropriate pins and try to run the code but I got this issue OSError: I2C bus error. I used examples related to Pycom boards (https://github.com/grahamPatico/micropython-ov2640-Pycom). Does anyone know the solution to this problem? Any help is welcome!

      Cheers,
      Adnan

      J 1 Reply Last reply Reply Quote 0
      • Yusuf BAYLAVY Offline
        Yusuf BAYLAV
        last edited by

        Dear Adnan,

        It is hard to reproduce the situation you are facing with this much information.
        Hence, it will worth if you provide us some more details logs, screenshots with your I2C device. Then, we may try to give you a hand on this.
        I guess what you are facing with sounds like a driver issue. Let's chase this all together with the community.
        If you find something, you share those here in the forum as well.

        Have a nice one,

        KR.
        Yusuf BAYLAV
        Solutions Architect / Evangelist @ pycom

        A 1 Reply Last reply Reply Quote 0
        • J Offline
          jcaron @Adnan Sabovic 0
          last edited by

          @Adnan-Sabovic-0 IIRC there are various different boards based on the OV2640 and they don’t all use the same interface (some use SCCB, others use SPI+I2C, and there are probably other options as well).

          Can you start by clarifying exactly which board you are using (exact reference and ideally photos as well) and how you wired it?

          A 1 Reply Last reply Reply Quote 0
          • A Offline
            Adnan Sabovic 0 @Yusuf BAYLAV
            last edited by

            @Yusuf-BAYLAV Hi Yusuf, here you can see my setup following instructions from this link: https://github.com/grahamPatico/micropython-ov2640-Pycom.

            fipy setup.jpeg

            Also, from this GitHub link, I took the code related to Pycom boards where the OV2640 driver was enabled. The error occurs in this part:

            self.i2c.writeto_mem(SENSORADDR, 0xff, b'\x01')
            self.i2c.writeto_mem(SENSORADDR, 0x12, b'\x80')

            Is the problem with the definition, or maybe address where data is buffered, don't know? Hope this can help a bit with the solution to my problem.

            Br,
            Adnan

            J 1 Reply Last reply Reply Quote 0
            • J Offline
              jcaron @Adnan Sabovic 0
              last edited by

              @Adnan-Sabovic-0 can’t see full wiring on your picture, but as shown you are missing at least VCC and probably GND.

              Please tell us the full exact wiring as you use it.

              1 Reply Last reply Reply Quote 0
              • A Offline
                Adnan Sabovic 0 @jcaron
                last edited by

                @jcaron I am using FiPy board (https://development.pycom.io/datasheets/development/fipy/) which is connected to Expansion board 3.0 (https://development.pycom.io/datasheets/expansionboards/expansion3/) using the appropriate pins. I have already tested simple examples and it works. Now I am trying to enable the OV2640 camera to work properly with the FiPy board. In order to do that, I found this implementation on GitHub (https://github.com/grahamPatico/micropython-ov2640-Pycom) where the driver for Pycom boards was implemented. I downloaded and used the example related to the Pycom board (Pycom folder on git). I connected the camera using the following setup:

                Camera Pin Expansion board Pin
                CS Pin 'P9' (orange wire)
                MOSI Pin 'P11' (yellow wire)
                MISO Pin 'P14' (green wire)
                SCK Pin 'P10' (blue wire)
                SDA Pin 'P21' (white wire)
                SCL Pin 'P22' (black wire)

                In their setup, they used Gpy and Expansion board as well but without VDD and GND pins; I2C and SPI pins were used.

                Also, I am sending you the picture of my setup showing the pins connection clearer:

                setup with fipy.png

                S 1 Reply Last reply Reply Quote 0
                • S Offline
                  SciWax @Adnan Sabovic 0
                  last edited by

                  @Adnan-Sabovic-0
                  Firstly, welcome to the forum.

                  The author just described, how your GPy board can communicate with the external device, which is your camera.

                  The camera also needs power and needs to be grounded, therefore you need to connect the VCC Pin of the camera with the 3.3V Pin on your expansion board. You also need to connect the GND Pin of your camera with the GND pin on your expansion board. That's what jcaron was talking about.

                  A 1 Reply Last reply Reply Quote 1
                  • A Offline
                    Adnan Sabovic 0 @SciWax
                    last edited by

                    @SciWax @jcaron I forgot to reply to you guys. You were right, I forgot to connect the supply wires to my board. After I did that, everything is fine. It works! Thanks a lot!

                    1 Reply Last reply Reply Quote 1

                    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