ArduCAM / RaspberryPi

This is Arducam camera demos used on Raspberry Pi paltform
BSD 3-Clause "New" or "Revised" License
163 stars 97 forks source link

Failed to use Camera B with UC-444 rev C #100

Closed exbutterfly closed 1 year ago

exbutterfly commented 1 year ago

Hello, Thanks a lot for the documentation you provide. I'm facing an issue with this hardware : Pi Zero 2W + UC-444 rev C + 2xcamera imx219

Os : Raspi 32-bit bullseye

$ uname -a
Linux raspberrypi 5.15.84-v7+ #1613 SMP Thu Jan 5 11:59:48 GMT 2023 armv7l GNU/Linux

Camera A works fine

$ libcamera-jpeg -t 1 -n --mode 640:480 -o cameraA.jpg
[0:54:22.569698215] [2034]  INFO Camera camera_manager.cpp:299 libcamera v0.0.3+40-9b860a66
[0:54:22.634445027] [2035]  WARN RPI raspberrypi.cpp:1308 Mismatch between Unicam and CamHelper for embedded data usage!
[0:54:22.636124731] [2035]  INFO RPI raspberrypi.cpp:1425 Registered camera /base/soc/i2c0mux/i2c@1/imx219@10 to Unicam device /dev/media3 and ISP device /dev/media0
[0:54:22.637855684] [2034]  INFO Camera camera.cpp:1028 configuring streams: (0) 1640x1232-YUV420
[0:54:22.638608898] [2035]  INFO RPI raspberrypi.cpp:805 Sensor: /base/soc/i2c0mux/i2c@1/imx219@10 - Selected sensor format: 1640x1232-SBGGR10_1X10 - Selected unicam format: 1640x1232-pBAA
Stream configuration adjusted
[0:54:23.002857054] [2034]  INFO Camera camera.cpp:1028 configuring streams: (0) 3280x2464-YUV420 (1) 640x480-SBGGR10_CSI2P
[0:54:23.004252389] [2035]  INFO RPI raspberrypi.cpp:805 Sensor: /base/soc/i2c0mux/i2c@1/imx219@10 - Selected sensor format: 640x480-SBGGR10_1X10 - Selected unicam format: 640x480-pBAA
Still capture image received

When i use the script https://github.com/ArduCAM/RaspberryPi/blob/master/Multi_Camera_Adapter/Multi_Adapter_Board_2Channel_uc444/shell/pi_cam_uc444.sh

$ sudo ./pi_cam_uc444.sh
Error: Write failed
Choose camera A
[1:09:43.850071141] [2157]  INFO Camera camera_manager.cpp:299 libcamera v0.0.3+40-9b860a66
[1:09:43.917790168] [2158]  WARN RPI raspberrypi.cpp:1308 Mismatch between Unicam and CamHelper for embedded data usage!
[1:09:43.919579705] [2158]  INFO RPI raspberrypi.cpp:1425 Registered camera /base/soc/i2c0mux/i2c@1/imx219@10 to Unicam device /dev/media3 and ISP device /dev/media0
[1:09:43.920906493] [2157]  INFO Camera camera.cpp:1028 configuring streams: (0) 1640x1232-YUV420
[1:09:43.921638818] [2158]  INFO RPI raspberrypi.cpp:805 Sensor: /base/soc/i2c0mux/i2c@1/imx219@10 - Selected sensor format: 1640x1232-SBGGR10_1X10 - Selected unicam format: 1640x1232-pBAA
Stream configuration adjusted
[1:09:44.321265234] [2157]  INFO Camera camera.cpp:1028 configuring streams: (0) 3280x2464-YUV420 (1) 640x480-SBGGR10_CSI2P
[1:09:44.324852069] [2158]  INFO RPI raspberrypi.cpp:805 Sensor: /base/soc/i2c0mux/i2c@1/imx219@10 - Selected sensor format: 640x480-SBGGR10_1X10 - Selected unicam format: 640x480-pBAA
Still capture image received
Error: Write failed
Choose Camera B
[1:09:45.675303117] [2170]  INFO Camera camera_manager.cpp:299 libcamera v0.0.3+40-9b860a66
[1:09:45.741957223] [2171]  WARN RPI raspberrypi.cpp:1308 Mismatch between Unicam and CamHelper for embedded data usage!
[1:09:45.743674366] [2171]  INFO RPI raspberrypi.cpp:1425 Registered camera /base/soc/i2c0mux/i2c@1/imx219@10 to Unicam device /dev/media3 and ISP device /dev/media0
[1:09:45.744908501] [2170]  INFO Camera camera.cpp:1028 configuring streams: (0) 1640x1232-YUV420
[1:09:45.745620514] [2171]  INFO RPI raspberrypi.cpp:805 Sensor: /base/soc/i2c0mux/i2c@1/imx219@10 - Selected sensor format: 1640x1232-SBGGR10_1X10 - Selected unicam format: 1640x1232-pBAA
[1:10:09.391153619] [2171]  WARN V4L2 v4l2_videodevice.cpp:2007 /dev/video0[12:cap]: Dequeue timer of 23534000.00us has expired!
[1:10:09.391405540] [2171] ERROR RPI raspberrypi.cpp:1875 Unicam has timed out!
[1:10:09.391494288] [2171] ERROR RPI raspberrypi.cpp:1876 Please check that your camera sensor connector is attached securely.
[1:10:09.391592358] [2171] ERROR RPI raspberrypi.cpp:1877 Alternatively, try another cable and/or sensor.
ERROR: Device timeout detected, attempting a restart!!!
^C

The error comes from i2cset -y 1 0x70 0x00 0x01.

Output of some i2c-tools cmd :

$ i2cdetect -l
i2c-1   i2c         bcm2835 (i2c@7e804000)              I2C adapter
i2c-11  i2c         bcm2835 (i2c@7e205000)              I2C adapter
i2c-0   i2c         i2c-11-mux (chan_id 0)              I2C adapter
i2c-10  i2c         i2c-11-mux (chan_id 1)              I2C adapter
$ i2cdetect -l
i2c-1   i2c         bcm2835 (i2c@7e804000)              I2C adapter
i2c-11  i2c         bcm2835 (i2c@7e205000)              I2C adapter
i2c-0   i2c         i2c-11-mux (chan_id 0)              I2C adapter
i2c-10  i2c         i2c-11-mux (chan_id 1)              I2C adapter
$ i2cdetect -l
i2c-1   i2c         bcm2835 (i2c@7e804000)              I2C adapter
i2c-11  i2c         bcm2835 (i2c@7e205000)              I2C adapter
i2c-0   i2c         i2c-11-mux (chan_id 0)              I2C adapter
i2c-10  i2c         i2c-11-mux (chan_id 1)              I2C adapter
$ i2cdetect -y 10
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- 0c -- -- -- 
10: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: 70 -- -- -- -- -- -- --                         
$ i2cdetect -y 11
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- 0c -- -- -- 
10: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: 70 -- -- -- -- -- -- --           
$ i2cget -y 1 0x70 0x00
Error: Read failed
$ i2cget -y 10 0x70 0x00
0x30
$ i2cset -y 1 0x70 0x00 0x00
Error: Write failed
$ i2cset -y 1 0x70 0x00 0x01
Error: Write failed
exbutterfly commented 1 year ago

I close this issue because i found the solution : GPIO pin 2 which correspond to I2C data link was badly welded. A continuity test confrms that. After refreshing weldings all be fine.