Need help configuring OV9281-B0162

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

  2. Model number of the product(s).
    OV9281-B0162

  3. What hardware/platform were you working on?
    RPI 3B+ and 4B

  4. Instructions you have followed. (link/manual/etc.)
    Wiki install instructions on Arducam website

  5. Problems you were having.
    Module is detected (ls /dev/video0), but cannot be opened of use by applications

  6. The dmesg log from your hardware.
    How do I do this?

  7. Troubleshooting attempts you’ve made.
    New ribbon cable, new Pi (changed from Pi3B+ to Pi4B), new micro ssd card, reformat/reinstall all software
    “v4l2-ctl --stream-mmap --stream-count=-1 -d /dev/video0 --stream-to=/dev/null” yields no response

  8. What help do you need?
    I need assistance getting this camera properly configured and accessible

I am trying to configure an OV9281-B0162 camera for use on an RPI4B.
I’ve installed software per the wiki, and ls /dev/video0 shows the module is detected.

“./arducamstill” detects the camera and shows available formats:

pi@raspberrypi:~/MIPI_Camera/RPI $ ./arducamstill
Open camera...
Found sensor ov9281 at address 60
mode: 0, width: 1280, height: 800, pixelformat: GREY, desc:  1 lan raw8 60fps
mode: 1, width: 1280, height: 720, pixelformat: GREY, desc: (null)
mode: 2, width: 640, height: 400, pixelformat: GREY, desc: (null)
mode: 3, width: 320, height: 200, pixelformat: GREY, desc: (null)
mode: 4, width: 160, height: 100, pixelformat: GREY, desc: (null)
mode: 5, width: 1280, height: 800, pixelformat: GREY, desc: Used for ov9281 2lans raw8
mode: 6, width: 1280, height: 800, pixelformat: Y10P, desc: Used for ov9281 2lans raw10
mode: 7, width: 1280, height: 800, pixelformat: GREY, desc: Used for ov9281 1lane raw8 1280x800 external trigger mode
mode: 8, width: 1280, height: 720, pixelformat: GREY, desc: Used for ov9281 1lane raw8 1280x720 external trigger mode
mode: 9, width: 640, height: 400, pixelformat: GREY, desc: Used for ov9281 1lane raw8 640x400 external trigger mode
mode: 10, width: 320, height: 200, pixelformat: GREY, desc: Used for ov9281 1lane raw8 320x200 external trigger mode
mode: 11, width: 1280, height: 800, pixelformat: GREY, desc: Used for ov9281 2lanes raw8 1280x800 external trigger mode
mode: 12, width: 1280, height: 800, pixelformat: Y10P, desc: Used for ov9281 2lanes raw10 1280x800 external trigger mode
mode: 13, width: 1280, height: 720, pixelformat: GREY, desc: Used for ov9281 2lanes raw8 1280x720 external trigger mode
mode: 14, width: 640, height: 400, pixelformat: GREY, desc: Used for ov9281 2lanes raw8 640x400 external trigger mode
mode: 15, width: 320, height: 200, pixelformat: GREY, desc: Used for ov9281 2lanes raw8 320x200 external trigger mode
mode: 16, width: 1280, height: 800, pixelformat: BA81, desc:  Used for ov9782 1 lan raw8 60fps
mode: 17, width: 1280, height: 720, pixelformat: BA81, desc: Used for ov9782 1280x720
mode: 18, width: 640, height: 400, pixelformat: BA81, desc: Used for ov9782 640x400
mode: 19, width: 320, height: 200, pixelformat: BA81, desc: Used for ov9782 320x200
mode: 20, width: 160, height: 100, pixelformat: BA81, desc: Used for ov9782 160x100
mode: 21, width: 1280, height: 800, pixelformat: BA81, desc: Used for ov9281 2lans raw8
mode: 22, width: 1280, height: 800, pixelformat: pBAA, desc: Used for ov9782 1280x800
index: 0, CID: 0x00980914, desc: V4L2_CID_HFLIP, min: 0, max: 1, default: 0, current: 0
index: 1, CID: 0x00980915, desc: V4L2_CID_VFLIP, min: 0, max: 1, default: 0, current: 0
index: 2, CID: 0x00980911, desc: V4L2_CID_EXPOSURE, min: 1, max: 65535, default: 681, current: 32
index: 3, CID: 0x00980913, desc: V4L2_CID_GAIN, min: 0, max: 15, default: 1, current: 8
index: 4, CID: 0x00981901, desc: V4L2_CID_ARDUCAM_EXT_TRI, min: 0, max: 1, default: 0, current: 0

“./camera-i2c” shows no i2c devices:

pi@raspberrypi:~/MIPI_Camera/RPI/utils $ ./camera_i2c
setting GPIO for board revsion: c03114
Raspberry Pi3B / Pi3B+ / 3A / 4B(1G/2G/4G)
Set state of 133 to 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

VLC “Open Capture Device” preview won’t load:

Hello, when using MIPI_Camera library to drive the OV9281 camera, check whether dtoverlay=ov9281 exists in the /boot/config.txt file. If it exists, please comment dtoverlay=ov9281, and then restart the system and try to drive the camera again.

Hello, dtoverlay=ov9281 does exist in /boot/config.txt.
After commenting that line and restarting, video0 is not found and cannot be opened.
“./arducamstill” now shows the current mode at the bottom of the list.
It did not show this before.

pi@raspberrypi:~/MIPI_Camera/RPI $ ./arducamstill
Open camera...
Found sensor ov9281 at address 60
mode: 0, width: 1280, height: 800, pixelformat: GREY, desc:  1 lan raw8 60fps
mode: 1, width: 1280, height: 720, pixelformat: GREY, desc: (null)
mode: 2, width: 640, height: 400, pixelformat: GREY, desc: (null)
mode: 3, width: 320, height: 200, pixelformat: GREY, desc: (null)
mode: 4, width: 160, height: 100, pixelformat: GREY, desc: (null)
mode: 5, width: 1280, height: 800, pixelformat: GREY, desc: Used for ov9281 2lans raw8
mode: 6, width: 1280, height: 800, pixelformat: Y10P, desc: Used for ov9281 2lans raw10
mode: 7, width: 1280, height: 800, pixelformat: GREY, desc: Used for ov9281 1lane raw8 1280x800 external trigger mode
mode: 8, width: 1280, height: 720, pixelformat: GREY, desc: Used for ov9281 1lane raw8 1280x720 external trigger mode
mode: 9, width: 640, height: 400, pixelformat: GREY, desc: Used for ov9281 1lane raw8 640x400 external trigger mode
mode: 10, width: 320, height: 200, pixelformat: GREY, desc: Used for ov9281 1lane raw8 320x200 external trigger mode
mode: 11, width: 1280, height: 800, pixelformat: GREY, desc: Used for ov9281 2lanes raw8 1280x800 external trigger mode
mode: 12, width: 1280, height: 800, pixelformat: Y10P, desc: Used for ov9281 2lanes raw10 1280x800 external trigger mode
mode: 13, width: 1280, height: 720, pixelformat: GREY, desc: Used for ov9281 2lanes raw8 1280x720 external trigger mode
mode: 14, width: 640, height: 400, pixelformat: GREY, desc: Used for ov9281 2lanes raw8 640x400 external trigger mode
mode: 15, width: 320, height: 200, pixelformat: GREY, desc: Used for ov9281 2lanes raw8 320x200 external trigger mode
mode: 16, width: 1280, height: 800, pixelformat: BA81, desc:  Used for ov9782 1 lan raw8 60fps
mode: 17, width: 1280, height: 720, pixelformat: BA81, desc: Used for ov9782 1280x720
mode: 18, width: 640, height: 400, pixelformat: BA81, desc: Used for ov9782 640x400
mode: 19, width: 320, height: 200, pixelformat: BA81, desc: Used for ov9782 320x200
mode: 20, width: 160, height: 100, pixelformat: BA81, desc: Used for ov9782 160x100
mode: 21, width: 1280, height: 800, pixelformat: BA81, desc: Used for ov9281 2lans raw8
mode: 22, width: 1280, height: 800, pixelformat: pBAA, desc: Used for ov9782 1280x800
index: 0, CID: 0x00980914, desc: V4L2_CID_HFLIP, min: 0, max: 1, default: 0, current: 0
index: 1, CID: 0x00980915, desc: V4L2_CID_VFLIP, min: 0, max: 1, default: 0, current: 0
index: 2, CID: 0x00980911, desc: V4L2_CID_EXPOSURE, min: 1, max: 65535, default: 681, current: 32
index: 3, CID: 0x00980913, desc: V4L2_CID_GAIN, min: 0, max: 15, default: 1, current: 8
index: 4, CID: 0x00981901, desc: V4L2_CID_ARDUCAM_EXT_TRI, min: 0, max: 1, default: 0, current: 0
mmal: Failed to fix lens shading, use the default mode!
Failed to set focus, the camera may not support this control.
Failed to set focus, the camera may not support this control.
Start preview...
Current mode: 0, width: 1280, height: 800, pixelformat: GREY, desc:  1 lan raw8 60fps
Mono camera does not support automatic white balance.
[Framerate]: 60 pfs, [Exposure]: 0681, [Focus]: 0000,[Rgain]: 0000, [Bgain]: 0000

“./camera_i2c” still shows nothing

pi@raspberrypi:~/MIPI_Camera/RPI/utils $ ./camera_i2c
setting GPIO for board revsion: c03114
Raspberry Pi3B / Pi3B+ / 3A / 4B(1G/2G/4G)
Set state of 133 to 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Hello,
if you add dtoverlay=ov9281 to the /boot/config.txt file, Raspberry Pi will load the ov9281 camera driver when it starts, and the system will register the device file /dev/video0. When you comment out dtoverlay=ov9281, the device file /dev/video0 will not be registered either. When using MIPI_Camera library to drive the OV9281 camera, you need to comment out dtoverlay=ov9281, otherwise the two drivers will conflict and the camera will not work normally. From your printed information, I see that the camera is already working normally. Can you see the camera image on the screen?

No.
With dtoverlay=ov9281 commented out, none of the preview functions display an image.
See examples below.
Am I doing something wrong?

pi@raspberrypi:~/MIPI_Camera/RPI $ ./preview-camera0
Open camera...
init camera status = 4100
pi@raspberrypi:~/MIPI_Camera/RPI $ ./raw_callback
Open camera...
Can't detected the support hardware version
Couldn't open I2C device
init camera status = 4097
pi@raspberrypi:~/MIPI_Camera/RPI $ ./capture raw
Open camera...
Can't detected the support hardware version
Couldn't open I2C device
init camera status = 4097
pi@raspberrypi:~/MIPI_Camera/RPI/utils $ ./camera_i2c
setting GPIO for board revsion: c03114
Raspberry Pi3B / Pi3B+ / 3A / 4B(1G/2G/4G)
Set state of 133 to 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                       

Hello, you try to use the ./arducamstill -t 0 command, and then observe whether there is a camera image on the screen. Can you send me a screenshot of the result of running the command?

Hello,
See below.
I should point out that I’m running this RPI headless, and viewing the desktop through VNC viewer.
I have just read a post on another forum stating that a display must be physically connected to the RPI in order to view previews.
Is that true?
As I mentioned, I have also been unable to preview the camera through VLC.

In VNC Viewer I enabled Options > Troubleshooting > “Enable direct capture mode” I am now able to see the preview image.
Thank you for your help!

Amazing, Great to hear that. As normal. the render component will display the image directly to hdmi monitor. In this way, we can see the image through the vnc. :smiley: