ov9281 dtbo with balena fin

Hi,

I’ve got the same arducam B0165 MIPI camera with ov9281 chipset. You have helped me [1] get it working in the past using the arducam userspace library. I have since switched to using it via the v4l2 linux kernel subsystem on the RPi 3B, and now I want to switch to that on the balena as well.

The switch is accomplished via a single dtoverlay line in config.txt: dtoverlay=ov9281.

However, that does not work on the balena fin - for the same reason presumably, that the overlay is rpi-3b specific, and needs to be updated for the balena fin.

Has anyone done this already? i.e. gotten ov9281.dtbo working on balena fin?

Thanks in advance,
Alon

[1] Arducam B0165 not working on Balena Fin v1.1 (The Raspberry Pi Camera Module v1 does)

Hey

I remember that ticket - I’ll set up a device with the hardware and the overlay by tomorrow and give it a shot.

That’s great. Let me know if I can help in any way.

Alon

Just to update, I tried on a limb to build the latest kernel from raspberrypi (5.10.33-v7+) because the reported error, “Unsupported sensor id” was similar to a report that ended up being fixed by it (a long shot that didn’t pan out).

So adding that running 96110e96f1a82e236afb9a248258f1ef917766e9 (git describe --tags gives raspberrypi-kernel_1.20210303-1-2218-g96110e96f1a8) from https://github.com/raspberrypi/linux.git still results in the error. (used default config, i.e. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2709_defconfigper Kernel building - Raspberry Pi Documentation)

Additionally, repeatedly unloading and reloading the ov9281 module results in the same error, but with different read values from the I2C bus:

[   89.481688] ov9281 10-0060 Unexpected sensor id(42dc3c00), ret(-5)
[  108.230681] ov9281 10-0060 Unexpected sensor id(9b1c3c00), ret(-5)
[  109.830790] ov9281 10-0060 Unexpected sensor id(9b1c3c00), ret(-5)
[  111.154344] ov9281 10-0060 Unexpected sensor id(723c3c00), ret(-5)
[  112.312128] ov9281 10-0060 Unexpected sensor id(723c3c00), ret(-5)
[  113.350073] ov9281 10-0060 Unexpected sensor id(299c3c00), ret(-5)
[  114.373747] ov9281 10-0060 Unexpected sensor id(383c3c00), ret(-5)
[  115.310245] ov9281 10-0060 Unexpected sensor id(babc3c00), ret(-5)
[  116.360306] ov9281 10-0060 Unexpected sensor id(aa7c3c00), ret(-5)
[  117.290401] ov9281 10-0060 Unexpected sensor id(b6bc3c00), ret(-5)
[  118.182629] ov9281 10-0060 Unexpected sensor id(405c3c00), ret(-5)
[  119.012934] ov9281 10-0060 Unexpected sensor id(413c3c00), ret(-5)
[  119.794808] ov9281 10-0060 Unexpected sensor id(2b5c3c00), ret(-5)
[  120.632320] ov9281 10-0060 Unexpected sensor id(3bdc3c00), ret(-5)

Perhaps the fact that the lower 20 bits are always c3c00 is important.

Any progress on your side? /fingers crossed/

Alon
p.s. tried to upload the overlay, beyond message size (32K), will try to attach it (dtc -I fs /proc/device-tree) instead.


Just a small update, in case you are working on this - I’ve managed to get the I2C side working, but then when I try to stream I get no results. Turning on the verbosity on the bcm2835_unicam kernel module shows that the ISR routine is never called. I can share the dt-blob & the changes I’ve done to the dts files (I’ve not yet figured out how to use the overlays so I ended up changing the dts sources in the kernel tree).

@anujdeshpande Hi again. Any progress on this?

Hi, are you able to use the device with the overlay on a rpi 3b running balenaOS

hmm, missed this, sorry: I did not try the balena OS, but raspbian works fine on rpi 3b.

ok, tested with balena os, works fine:

  1. Installed release of GitHub - balena-io-examples/balena-rust-hello-world: Example of how to deploy Rust code on a balena supported device.
  2. Device configuration:
    a. Define DT overlays = ov9281
    b. BALENA_HOST_CONFIG_start_x=1
    c. Define device GPU memory in megabytes = 128
  3. ssh inside
    a. apt update
    b. apt install -y v4l-utils
    c.
v4l2-ctl  --stream-mmap --stream-count=100
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

d.

v4l2-ctl  --list-devices | head -3
unicam (platform:3f801000.csi):
        /dev/video0
        /dev/video1

Used balenaOS 2.77.0+rev1, supervisor version 12.5.10.
Kernel (uname -a): Linux 2321c48 5.4.83-v7 #1 SMP Mon Dec 14 12:43:54 UTC 2020 armv7l GNU/Linux

Hey @floion, sorry to bug you, I could use all the help I can get! Thanks in advance.