Pico(micropython) cannot connect by I2C (OV2640)

  1. Where did you get the camera module(s)?
    freemarket

  2. Model number of the product(s)?
    OV1640(b0067)

  3. What hardware/platform were you working on?
    micropython on pico and pico w

  4. Instructions you have followed. (link/manual/etc.)
    GitHub - teco-kit/Arducam_OV2640_Python_Package_Raspberry_Pi_Pico: Package for Python for the Arducam OV2640

  5. Problems you were having?
    I2C is not connected

  6. The dmesg log from your hardware?
    I2C(0).scan()
    → []

  7. Troubleshooting attempts you’ve made?

  8. What help do you need?

@kazu

Could you give me the hardware connection diagram?

The example you provided is not provided by us. Did you write it yourself or was it provided by another company?

I did it once using only the camera without using the UART part.
Also, github is based on GitHub - ArduCAM/PICO_SPI_CAM, so there are almost no changes. (In that case, just delete the parts other than OV1640.)

@kazu

If possible, please verify the availability of the camera first using the methods and warehouses we provide.

I got home and i’ll do that.
please wait for it…
It’s first time to use Circuitpython…

>>> i2c = bitbangio.I2C(scl=board.GP9, sda=board.GP8,frequency=1000000)

>>> i2c.try_lock()
True
>>> i2c.try_lock()
False
>>> i2c.try_lock()
False
>>> i2c.scan()
[]
>>> i2c.scan()
[88]
>>> i2c.scan()
[18, 112, 114]
>>> i2c.scan()
[25]
>>> i2c.scan()
[16, 49, 67]
>>> i2c.scan()
[54]
>>> i2c.scan()
[32]
>>> i2c.scan()
[]
>>> i2c.scan()
[10]
>>> i2c.scan()
[31, 33, 49]
>>> i2c.scan()
[]
>>> i2c.scan()
[44, 118]
>>> i2c.scan()
[37, 44, 56]
>>> i2c.scan()
[]
>>> i2c.scan()
[66]
>>> i2c.scan()
[45, 47, 65, 68, 78, 89, 114]
>>> i2c.scan()
[12, 18]
>>> i2c.scan()
[36, 42, 44, 50, 74, 80]
>>> i2c.scan()
[59, 112]
>>> i2c.scan()
[12, 92]
>>> i2c.scan()
[59]
>>> i2c.scan()
[]
>>> i2c.scan()
[15, 26, 36, 44, 114, 116]
>>> i2c.scan()
[]
>>> i2c.scan()
[55, 90, 94, 96, 99, 102, 113]
>>> i2c.scan()
[114]
>>> i2c.scan()
[18, 25, 43]
>>> i2c.scan()
[119]
>>> i2c.scan()
[86, 104]
>>> i2c.scan()
[40, 43]
>>> i2c.scan()
[101]
>>> 

I looked some code and try to check connection of I2C
It looks like good

I think Micropython has some bugs…
so i’ll look issues and try to get better…

run ArduCAM_Mini_2MP_Plus_VideoStreaming.py
returns

[]
Traceback (most recent call last):
  File "<stdin>", line 18, in <module>
  File "Arducam.py", line 189, in Camera_Detection
  File "Arducam.py", line 233, in wrSensorReg8_8
  File "Arducam.py", line 238, in iic_write
OSError: [Errno 19] No such device

Maybe I need a resistor on the I2C pin?

I’m trying to get camera values with no i2c…
It means I cannot change options of camera.
But there are some probrems…
When it takes picture, mycam.get_bit(ARDUCHIP_TRIG,CAP_DONE_MASK) is always 0.
so, i cannot finish taking picture.
I think it needs i2c connections and Camera init()
Do you have any ideas or ways to get values?

This code is copy of ArduCAM/PICO_SPI_CAM
I deleted I2C functions , so this code is runnig by only SPI

There is a possibility that it may be an initial defect, so I would like to purchase another used one, that is, one that has worked in the past, and try running the same code.

@kazu

Could you send me your wiring diagram, please try to be as clear as possible, I also want to see the connections of the i2c part specifically.



when i got home, i’ll upload some pictures that connecting cam and pico

i also want python code of hostapp.exe

when im free, ill make ros2 node that receive bytearrys and change it jpeg , then send it to topic.