Ov9218 - EK025 usb camera evaluation kit not working

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

  2. Model number of the product(s)?
    EK025 usb2.0 UC-391 Rev.E

  3. What hardware/platform were you working on?
    raspberry pi 4B [email protected]:~/ArduCAM_USB_Camera_Shield/RaspberryPi/Python/Streaming_demo $ sudo python ArduCam_Py_Demo.py /home/pi/ArduCAM_USB_Camera_Shield/Config/USB2.0_UC-391_Rev.E/MIPI/OV9281/1Lane/OV9281_MIPI_1Lane_RAW8_640x400_120fps.cfg
    Traceback (most recent call last):
    File “/home/pi/ArduCAM_USB_Camera_Shield/RaspberryPi/Python/Streaming_demo/ArduCam_Py_Demo.py”, line 9, in
    from ImageConvert import *
    File “/home/pi/ArduCAM_USB_Camera_Shield/RaspberryPi/Python/Streaming_demo/ImageConvert.py”, line 2, in
    import ArducamSDK
    ImportError: /home/pi/ArduCAM_USB_Camera_Shield/RaspberryPi/Python/Streaming_demo/ArducamSDK.so: undefined symbol: _Py_ZeroStruct
    [email protected]

PRETTY_NAME=“Raspbian GNU/Linux 11 (bullseye)”
NAME=“Raspbian GNU/Linux”
VERSION_ID=“11”
VERSION=“11 (bullseye)”
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL="_http://www.raspbian.org/"
SUPPORT_URL="_http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="_http://www.raspbian.org/RaspbianBugs"

kernel version :
[email protected]:~/ArduCAM_USB_Camera_Shield/RaspberryPi/Python/Streaming_demo $ uname -r
5.15.40-v7l+

[email protected]:~/ArduCAM_USB_Camera_Shield/RaspberryPi/Python/Streaming_demo $ vcgencmd version
May 16 2022 15:40:46
Copyright (c) 2012 Broadcom
version ae6542a8a3aef192cb3536c39106d19f342fab29 (clean) (release) (start)

  1. Instructions you have followed. (link/manual/etc.)
    _www.arducam.com/docs/usb-cameras/

_www.arducam.com/docs/usb-cameras/windows-driver-installation/

  1. Problems you were having?
    not working on both raspberrypi and windows10

ON raspberrypi4B:
[email protected]:~/ArduCAM_USB_Camera_Shield/RaspberryPi/Python/Streaming_demo $ sudo python ArduCam_Py_Demo.py /home/pi/ArduCAM_USB_Camera_Shield/Config/USB2.0_UC-391_Rev.E/MIPI/OV9281/1Lane/OV9281_MIPI_1Lane_RAW8_640x400_120fps.cfg
Traceback (most recent call last):
File “/home/pi/ArduCAM_USB_Camera_Shield/RaspberryPi/Python/Streaming_demo/ArduCam_Py_Demo.py”, line 9, in
from ImageConvert import *
File “/home/pi/ArduCAM_USB_Camera_Shield/RaspberryPi/Python/Streaming_demo/ImageConvert.py”, line 2, in
import ArducamSDK
ImportError: /home/pi/ArduCAM_USB_Camera_Shield/RaspberryPi/Python/Streaming_demo/ArducamSDK.so: undefined symbol: _Py_ZeroStruct

ON windows10 with ArduCam USB Camera Demo:
Camera size exceed error

  1. The dmesg log from your hardware?

  2. Troubleshooting attempts you’ve made?
    All I can get from arducam website and the others.

  3. What help do you need?
    Do we need a driver for USB2.0 instead of USB3.0? How/where to get it?

Please try to install the ArducamSDK using pip:
pip install ArducamSDK

No luck.

On windows 10:
C:\Users\DREAM>pip install ArducamSDK
ERROR: Could not find a version that satisfies the requirement ArducamSDK (from versions: none)
ERROR: No matching distribution found for ArducamSDK

On raspberry pi4B: same error
[email protected]:~/ArduCAM_USB_Camera_Shield/RaspberryPi/Python/Streaming_demo $ sudo python ArduCam_Py_Demo.py /home/pi/ArduCAM_USB_Camera_Shield/Config/USB2.0_UC-391_Rev.E/MIPI/OV9281/1Lane/OV9281_MIPI_1Lane_RAW8_640x400_120fps.cfg
Traceback (most recent call last):
File “/home/pi/ArduCAM_USB_Camera_Shield/RaspberryPi/Python/Streaming_demo/ArduCam_Py_Demo.py”, line 9, in
from ImageConvert import *
File “/home/pi/ArduCAM_USB_Camera_Shield/RaspberryPi/Python/Streaming_demo/ImageConvert.py”, line 2, in
import ArducamSDK
ImportError: /home/pi/ArduCAM_USB_Camera_Shield/RaspberryPi/Python/Streaming_demo/ArducamSDK.so: undefined symbol: _Py_ZeroStruct

Other solutions on this matter or have to give up for USB camera at this moment.

This doesn’t seem unusual,
Here is my test on pi4b:

Hi Wong,
Thank you for your prompt reply. The problem still exists.

It seems to have problems with ArducamSDK.so. All files came from https://github.com/ArduCAM/ArduCAM_USB_Camera_Shield.

I also tried it on Windows10 with the GUI. It indicated that “Camera size exceed error”. I tried changing the smaller size and with various configuration file. The errors still the same.

Any further suggestion ??

I think you need to delete ArducamSDK.so, which is the library for python2.7, which may have caused the conflict.

This seems strange, can you send me the cfg file you used?

after deleted ArducamSDK.so, the error is as follows:

The file was originally downloaded from Github without any modifications:

OV9281_MIPI_1Lane_RAW8_640x400_120fps.cfg
;**************************************************************************************/
[camera parameter]
CFG_MODE = 0
TYPE = OV9281
SIZE = 640, 400
BIT_WIDTH = 8
FORMAT = 4, 0
I2C_MODE = 2
I2C_ADDR = 0xC0
;TRANS_LVL = 64

[control parameter]
MIN_VALUE = 2
MAX_VALUE = 210
STEP = 1
DEF = 120
CTRL_NAME = Framerate
FUNC_NAME = setFramerate
======CODE_BLOCK_START======
function setFramerate(val)
local pix_clk_hz = 80000000
local hts = 728
local vts = math.floor(pix_clk_hz/(hts*val))
writeReg(0x380E, (vts & 0xFF00) >> 8)
writeReg(0x380F, (vts & 0x00FF) >> 0)
end
======CODE_BLOCK_END======

[control parameter]
MIN_VALUE = 1
MAX_VALUE = 33000
STEP = 1
DEF = 10
CTRL_NAME = Exp(us)
FUNC_NAME = setExposureTime
======CODE_BLOCK_START======
function setExposureTime(val)
local line_length = 728
local pixel_clock = 80000000
local time_per_line = line_length / pixel_clock 1e9
–[[ using math.floor convert float to int]]
local coarse_time = math.floor(val
1000 / time_per_line)

local ret, vts_msb = readReg(0x380E)
local ret, vts_lsb = readReg(0x380F)
vts = vts_msb << 8 | vts_lsb
if coarse_time > (vts - 12) then
    coarse_time = vts - 12
end

ret = writeReg(0x3500, (coarse_time & 0xF000) >> 12)
ret = writeReg(0x3501, (coarse_time & 0x0FF0) >> 4)
ret = writeReg(0x3502, (coarse_time & 0x000f) << 4)

end
======CODE_BLOCK_END======

[control parameter]
MIN_VALUE = 100
MAX_VALUE = 1500
STEP = 1
DEF = 100
CTRL_NAME = Gain(0.01x)
FUNC_NAME = setAnalogueGain
======CODE_BLOCK_START======
function setAnalogueGain(val)
gain = math.floor(val / 100)
ret = writeReg(0x3509, (gain & 0x0F) << 4 | math.floor((val / 100) % 1 * 16))
end
======CODE_BLOCK_END======

;**************************************************************************************/

[board parameter]
VRCMD = 0xD7, 0x4600, 0x0100, 1, 0x05
VRCMD = 0xD7, 0x4600, 0x0200, 1, 0x00
VRCMD = 0xD7, 0x4600, 0x0300, 1, 0xC0
VRCMD = 0xD7, 0x4600, 0x0300, 1, 0x40
VRCMD = 0xD7, 0x4600, 0x0400, 1, 0x11
VRCMD = 0xD7, 0x4600, 0x0A00, 1, 0x00
VRCMD = 0xD7, 0x4600, 0x0C00, 1, 0x80
VRCMD = 0xD7, 0x4600, 0x0D00, 1, 0x02
VRCMD = 0xD7, 0x4600, 0x0E00, 1, 0x80
VRCMD = 0xD7, 0x4600, 0x0F00, 1, 0x01
VRCMD = 0xD7, 0x4600, 0x1000, 1, 0x90
VRCMD = 0xD7, 0x4600, 0x1100, 1, 0x00
VRCMD = 0xD7, 0x4600, 0x2300, 1, 0x01
VRCMD = 0xF6, 0x0000, 0x0000, 3, 0x03, 0x04, 0x0C

[board parameter][dev2]

[board parameter][dev3][inf2]
VRCMD = 0xD7, 0x4600, 0x0300, 1, 0x00
VRCMD = 0xD7, 0x4600, 0x0400, 1, 0x00
VRCMD = 0xF3, 0x0000, 0x0000, 0
VRCMD = 0xF9, 0x0004, 0x0000, 0

[board parameter][dev3][inf3]
VRCMD = 0xD7, 0x4600, 0x0300, 1, 0x00
VRCMD = 0xD7, 0x4600, 0x0400, 1, 0x00
VRCMD = 0xF3, 0x0000, 0x0000, 0
VRCMD = 0xF9, 0x0004, 0x0000, 0

;**************************************************************************************/

[register parameter]

REG=0x0103, 0x01
REG=0xFFFE, 0x64
REG=0x0302, 0x32
REG=0x030d, 0x50
REG=0x030e, 0x02
REG=0x3001, 0x00
REG=0x3004, 0x00
REG=0x3005, 0x00
REG=0x3006, 0x04
REG=0x3011, 0x0a
REG=0x3013, 0x18
REG=0x301c, 0xf0
REG=0x3022, 0x01
REG=0x3030, 0x10
REG=0x3039, 0x32
REG=0x303a, 0x00
REG=0x3500, 0x00
REG=0x3501, 0x01
REG=0x3502, 0xf4
REG=0x3503, 0x08
REG=0x3505, 0x8c
REG=0x3507, 0x03
REG=0x3508, 0x00
REG=0x3509, 0x10
REG=0x3610, 0x80
REG=0x3611, 0xa0
REG=0x3620, 0x6e
REG=0x3632, 0x56
REG=0x3633, 0x78
REG=0x3662, 0x03
REG=0x3666, 0x00
REG=0x366f, 0x5a
REG=0x3680, 0x84
REG=0x3712, 0x80
REG=0x372d, 0x22
REG=0x3731, 0x80
REG=0x3732, 0x30
REG=0x3778, 0x10
REG=0x377d, 0x22
REG=0x3788, 0x02
REG=0x3789, 0xa4
REG=0x378a, 0x00
REG=0x378b, 0x4a
REG=0x3799, 0x20
REG=0x3800, 0x00
REG=0x3801, 0x00
REG=0x3802, 0x00
REG=0x3803, 0x00
REG=0x3804, 0x05
REG=0x3805, 0x0f
REG=0x3806, 0x03
REG=0x3807, 0x2f
REG=0x3808, 0x02
REG=0x3809, 0x80
REG=0x380a, 0x01
REG=0x380b, 0x90
REG=0x380c, 0x02
REG=0x380d, 0xd8
REG=0x380e, 0x03
REG=0x380f, 0x93
REG=0x3810, 0x00
REG=0x3811, 0x04
REG=0x3812, 0x00
REG=0x3813, 0x04
REG=0x3814, 0x31
REG=0x3815, 0x22
REG=0x3820, 0x60
REG=0x3821, 0x01
REG=0x382c, 0x05
REG=0x382d, 0xb0
REG=0x389d, 0x00
REG=0x3881, 0x42
REG=0x3882, 0x01
REG=0x3883, 0x00
REG=0x3885, 0x02
REG=0x38a8, 0x02
REG=0x38a9, 0x80
REG=0x38b1, 0x00
REG=0x38b3, 0x02
REG=0x38c4, 0x00
REG=0x38c5, 0xc0
REG=0x38c6, 0x04
REG=0x38c7, 0x80
REG=0x3920, 0xff
REG=0x4003, 0x40
REG=0x4008, 0x02
REG=0x4009, 0x05
REG=0x400c, 0x00
REG=0x400d, 0x03
REG=0x4010, 0x40
REG=0x4043, 0x40
REG=0x4307, 0x30
REG=0x4317, 0x00
REG=0x4501, 0x00
REG=0x4507, 0x03
REG=0x4509, 0x80
REG=0x450a, 0x08
REG=0x4601, 0x04
REG=0x470f, 0x00
REG=0x4f07, 0x00
REG=0x4800, 0x00
REG=0x5000, 0x9f
REG=0x5001, 0x00
REG=0x5e00, 0x00
REG=0x5d00, 0x07
REG=0x5d01, 0x00
REG=0x4f00, 0x04
REG=0x4f10, 0x00
REG=0x4f11, 0x98
REG=0x4f12, 0x0f
REG=0x4f13, 0xc4
REG=0x0100, 0x01
REG=0x3501, 0x20
REG=0x3502, 0x20

[register parameter][dev3][inf2]

[register parameter][dev3][inf3]

Can you run lsusb? Or run dmesg -w and replug the camera.
It looks like the program doesn’t find the device.

Thank you very much for your information,
The config file looks fine,
It should be able to work with USBTest on Windows, “Camera size exceed error” thise error is caused by the SIZE parameter in the configuration file not meeting the requirements, not sure if it’s a file encoding problem, as it is now compliant. Could you try a few other configuration file?

Yeah!!! … It is working on Streaming_demo after following your instruction on both raspberry and Windows. Thanks for your supports.

I will try next on Trigger demo.

Best Regards,