I’ve got an OV5642 (B0068) 5MP camera module hooked up to a Raspberry Pi Pico. I’ve been following the PICO_SPI_CAM tutorial from GitHub (GitHub - ArduCAM/PICO_SPI_CAM · GitHub). When I run the Python code, the camera seems to initialize fine — I get ‘CameraType is OV5642’ and ‘SPI interface OK’. But then when I open HostApp.exe and click the Video button, it fails to open the camera. I’ve never actually gotten a preview working. Is there a complete document for using the OV5642 with the Pico?
Thanks for the details. Have you had a chance to look through the SPI camera documentation for the Pico? There’s a section that covers the legacy SPI camera modules:
https://docs.arducam.com/Arduino-SPI-camera/Legacy-SPI-camera/Pico/Camera-Module/SPI-Camera/#1introduction
One thing to keep in mind — the PICO_SPI_CAM tutorial you mentioned is written around a 2MP camera, so the OV5642 may need different handling. Can you post the exact output you’re seeing in HostApp when it fails?
Yes, I’m following that same tutorial, just with the OV5642 instead of the 2MP module it references. Here’s the Python output:
[60]
CameraType is OV5642
SPI interface OK
And here’s what HostApp.exe logs when I click Video:
[13:45:20]: Port Connect Success
[13:46:11]: Camera Open Success
[13:46:11]: Camera Open Failure, Please check that the port number is correct
[13:46:12]: Camera Open Failure, Please check that the port number is correct
[13:46:12]: Camera Open Failure, Please check that the port number is correct
[13:46:13]: Camera Open Failure, Please check that the port number is correct
[13:46:13]: Camera Open Failure, Please check that the port number is correct
[13:46:14]: Camera Close Success
Weird that it says ‘Camera Open Success’ right before all the failures.
That ‘Camera Open Success’ followed by repeated port number errors is interesting. It suggests the host connects to the Pico, but then the stream drops right after opening — usually more of a wiring/connection issue than a code issue. Could you post a few photos of your wiring between the camera and the Pico? Also, double-check that the COM port selected in HostApp matches the one the Pico is actually on.
I actually tried re-soldering some adapters onto the Pico to get a more solid connection. After that the status changed — now the Python output shows:
[60]
CameraType is OV5642
SPI interface error
So now the SPI interface itself is failing. Here’s a photo of the current wiring:

An ‘SPI interface error’ after re-soldering points to the wiring changing. Looking at your photo, can you verify each pin against the OV5642 pinout for the Pico? The SPI error means the Pico can’t talk to the sensor over SPI at all right now. Check the CS, SCK, MOSI, and MISO lines in particular — one of those is likely on the wrong pin or not making contact.
I went back and found one wire was on the wrong pin. I corrected it, and now the SPI error is gone — I’m back to the original behavior (initializes but won’t open). Here are the corrected wiring photos:


Thanks, those corrected photos look right to me. Since you’re back to ‘Camera Open Success’ followed by the port errors, the SPI side is probably fine again. The remaining error specifically says to check the port number. In HostApp, is the selected port the same COM port the Pico enumerates as? Also worth closing any other application that might be holding that port open.
I believe the connection is correct now — I double-checked all the wires. But the camera still won’t open in HostApp. Attached another photo of the current wiring:

Any ideas? I’m stuck on the ‘Camera Open Failure, Please check that the port number is correct’ error.
Thanks for the extra photo — the wiring looks consistent with the corrected setup. Based on everything so far, the SPI interface is working (init succeeds with ‘SPI interface OK’), but HostApp drops the connection right after ‘Camera Open Success’ and keeps throwing the port number error. We’re still investigating whether this is a port configuration issue on the PC side or a handshake problem between HostApp and the Pico firmware when using the OV5642. For now, keep the corrected wiring, confirm the COM port in HostApp matches the Pico, and we’ll keep digging into the open failure.