Jupyter cannot initialize Raspberry Pi V2 camera

I have assembled the jetbot and have no issues running basic_motions example in jupyter but I have trouble with examples involving the camera - the jupyter script fails to initialize the camera (“camera = Camera.instance()”) showing BUSY kernel status or the stream stops shortly after initialization. When it happens the heat sink becomes pretty warm.

I am using Raspberry Pi Camera V2 board with 8-megapixel IMX219 sensor from Makerfocus

https://www.amazon.com/gp/product/B07HF81BVL/ref=ppx_yo_dt_b_asin_title_o03_s01?ie=UTF8&psc=1.

as suggested in the bill of materials. I tried rebooting, reconnecting the camera, restarting nvargus-daemon and checking power mode (it is 5W) - nothing seems to help.

Any suggestions are appreciated.
Thank you.
Dmitri

Does the video0 node created in your system?
And check if below command can get the data.

v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=ov1080.raw

Thank you for looking into this. I am getting a message.

bash: v4l2-ctl: command not found

P.S. I am using the image for jetbot from https://github.com/NVIDIA-AI-IOT/jetbot/wiki/Software-Setup

Have apt-get to install v4l-utils for the v4l2-ctl
Suspect this image can’t support the Raspberry Pi V2 camera

Thank you for your help! I have installed v4l-utils. Without the Jupyter script (i.e. without attempt
to initialize the camera) when I run

v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=ov1080.raw

I am getting
<

When I run the Jupyter cell which initializes the camera the same command returns
VIDIOC_S_EMT: failed: Device or resource busy
VIDIOC_REQBUFS: failed: Device or resource busy

It seems that camera initializes after I disconnect/reconnect the cable or/and when I run

sudo systemctl restart nvargus-daemon

but streaming lags and then stops at some point (image does not change.) The heat sink also gets pretty warm.

What the v4l2-ctl --list-devices show up?

vi-output, imx219 6-0010 (platform:54080000.vi:0):
/dev/video0

Any suggestions?

The version of basic_motion I have does not have a step that involves the camera on the JetBot. Are you perhaps running teleoperation or collision_avoidance? Could you provide a screen shot or somehow capture the step you are seeing this issue with the error?

However, I initially ran into an issue with the camera but then found I had the cable for the camera connected backward to the Nano. The non-text side of the camera cable should face the heat-sink of the Nano.

Also, check the output of dmesg and see what it lists for the camera.

This is what I see for the Waveshare IMX219 Camera Module

[    0.584995] max77620 4-003c: max77620 probe successful
[    0.587240] i2c i2c-6: Unbalanced pm_runtime_enable!
[    0.587790] media: Linux media interface: v0.10
[    0.587854] Linux video capture interface: v2.00

This is how the imx219 is listed in dmesg:

[    3.924299] i2c /dev entries driver
[    3.926043] imx219 6-0010: tegracam sensor driver:imx219_v2.0.6
[    3.951559] max77620-power max77620-power: Event recorder REG_NVERC : 0x0

And

[    5.014483] vi 54080000.vi: vi_probe: ++
[    5.030800] vi 54080000.vi: initialized
[    5.036964] vi 54080000.vi: subdev nvcsi--1 bound
[    5.041692] vi 54080000.vi: subdev imx219 6-0010 bound
[    5.047378] mmc0: hw tuning done ...

I purchased another camera and it works fine so it seems the first camera was faulty.

Thank you for helping!

Thanks for answering your question, dvillevald. I was watching this thread since I have a pi camera 2 and have been planning on using it on Nano.