FiPy with OV2640 camera - I2C bus error
-
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
-
@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!
-
@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.
-
@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:
-
@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.
-
@Yusuf-BAYLAV Hi Yusuf, here you can see my setup following instructions from this link: https://github.com/grahamPatico/micropython-ov2640-Pycom.
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
-
@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?
-
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,