Giter Club home page Giter Club logo

raspberrypi's Introduction

RaspberryPi

SPI Camera

Multi_Camera_Adapter_V2

  • This adapter board just supports 5MP Raspberry Pi multi camera adapter module is designed for connecting more than one camera to a single CSI camera port on Raspberry Pi board. One adapter board can connect 4 cameras and user can stack up maximum 4 adapter boards that means up to 16 cameras on a single Raspberry Pi board. Please note that Raspberry Pi multi camera adapter board is a nascent product that may have some stability issues and limitations because of the cable’s signal integrity and RPi’s closed source video core libraries, so use it on your own risk. For more information, refer to the link
  • http://www.arducam.com/multi-camera-adapter-module-raspberry-pi/#more-952

Multi_Camera_Adapter_V2.1

  • This adapter board supports 5MP and 8MP since the old multi-camera adapter board doesn’t work with Raspberry Pi 8MP IMX219 pi camera due to the camera driver issue. Now Arducam team designed upgrade V2.1 multi-camera adapter board for both 5MP and 8MP pi cameras. Consider that the high speed CSI camera MIPI signal integrity is sensitive to long cable connection, the new adapter board can only connect maximum 4 cameras to a single pi board. Because it covers the most of the use cases like 360 degree view photography and surveillance, and add more cameras will degrade the performance of the cameras. Like allways please note that Raspberry Pi multi camera adapter board is a nascent product that may have some stability issues and limitations because of the cable’s signal integrity and RPi’s closed source video core libraries, so use it on your own risk.
  • http://www.arducam.com/arducam-v2-1-multi-camera-adapter-board-raspberry-pi-8mp-camera-imx219/

Hardware Connection

Alt text

Motorized_Focus_Camera

  • The standard pi camera is fixed focus lens, some of them are glued which can not be adjust by users, and some of them are not glued which can be adjust the lens focus manually. But in certain circumstance, you want to programmably control the focus distance remotely where the device can not be reached. The ArduCAM team now designed a motorized control focus 5MP and 8MP camera module for Raspberry Pi series boards to address this problem. http://www.arducam.com/programmable-motorized-focus-camera-raspberry-pi/

Pi3

Alt text

Pi4

Alt text

  • Enable the i2c0 adapter
cd RaspberryPi/Motorized_Focus_Camera
sudo chmod +x enable_i2c_vc.sh
./enable_i2c_vc.sh
  • Demos Function
  • Motorized_Focus_Camera_Preview.py
    • This demo support focusing in preview mode, You can see the focus visually
    • Single focus by keyboard up and down
    • Run this demo is very easy , just input the "sudo python Motorized_Focus_Camera_Preview.py" in the terminal.
  • Autofocus.py
    • Before running this demo, you have to install Python Dependency libraries.
    sudo apt-get install python-opencv 
  • Then run the demo by inputing the "sudo python Autofocus.py" in the terminal.

raspberrypi's People

Contributors

aaronbuchwald avatar arducam avatar ardulb avatar dennis-ard avatar glddiv avatar jeff-arducam avatar ljp-while avatar lrnzo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

raspberrypi's Issues

Arducam Multi Camera Adapter have a conflict on RPi.GPIO mode set

Hi,

I have connected PCA9685 and Arducam Multi Camera Adapter on Raspberry Pi 3B+. The problem is that when I put Arducam Multi-Camera adapter and the I2C Adafruit together there is a issue regarding on the following line
gp.setmode(gp.BOARD)
ValueError: A different mode has already been set
Could you tell me please how to solve this error?

I look forward to your reply.
Many thanks.

make install with opencv4 confusing

Dear,

Somewhat confusing. With opencv4.pc the output gives an error of not finding the package opencv. However, its named opencv4 and your modification of 3 Dec 2020 finds and uses the package correctly. As can see in the last line, installation succeeded.

image

ArduCAM UV-544 c++ control

Hi,

I have the ArduCAM UV-544 Rev B board connected to the CSI ribbon and I2C signals. I am using raspberry Pi 3B board. I would like to capture images via c++ application, but the examples are in Python.

I've seen the SPI_Camera folder with the demo application but if I build it and run it I get SPI1 interface Error! message in command line.

Is my camera suitable for that application? I would like to autofocus and capture image using c++.

Any advise would be appreciated.

Thanks

raspivid gst-launch performance

Good Day!
Can you please share information about your product.
As I understood new ArduCam 2.1 is not compatible with raspivid, is it correct?
Instead we have to use /dev/video0 to get raw video (please, correct if I am wrong)
In the end too get compressed video we have to use gst-launch to compress it.
Did you check overall performance:

  1. CPU load
  2. Video latency comparing to raspivid

Am I wrong in that?
Thank you.

LED always on

I have 2 of the Motorized Focus Lens, OV5647, but one of them has the red led always on. Which is annoying.
How do i turn this off?

V2.1 multicamera adapter issue

Hi folks,
I recently purchased the v2.1 multicamera adapter, and connected 4 pi cameras. On connecting as mentioned in the website, still can't find /dev/video0
Tried all the things mentioned like rpi-update, sudo modprobe bcm2835-v4l2, added it to /etc/modules. Also, installed v4l-utils etc. Check the cables too & tried replacing etc. None works.
On the other hand, if i connect the csi port to one of the cameras, and just plug the adapter on GPIO pins. It finds /dev/video0.

Any leads will be helpful. Thanks in advance

Cannot remote launch and watch Multi Cameras

It appears the commands to launch and run the 2 Multicamera demo does not work via SSH. Which means we are required to run this on the raspberry pi only. The issue is here what if I am remote and would like to see the activity on the cameras?

Controlling focus when streaming via other program?

I am using pikrellcam as livestream and recording software and I would like to test it with your motor focus cam. However, the demos are based on showing a preview so the demo is stopped because pikrellcam is using the camera.

Is there some code snippet I could use to only control the motorised focus and use my regular stream to view the result?
At a later stage I plan to incorporate the focus buttons in the GUI with pikrellcam.

Possible conflict with RaspberryPi display?

When using an arducam imx219 motorized focus camera with the RaspberryPi touch screen attached, the display and camera will occasionally lock up when taking pictures and changing focus.

I'm running Autofocus.py.

I think there's some sort of i2c conflict that causes i2c-0 to lock up sometimes, resulting in the pi being unable to receive touch input from the display or control the camera. I can unlock it by running rmmod i2c_dev then modprobe i2c_dev then i2cdetect -y 0.

sh: 1: raspistill: not found

pi@raspberrypi:/RaspberryPi/Multi_Camera_Adapter/Multi_Adapter_Board_4Channel/Multi_Camera_Adapter_V2.1_C++ $ sudo ./init_camera.sh
----Test i2c1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- 0c -- -- --
10: 10 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --
----Detecting the /dev/video0 device
video0 detected!
---Start testing each camera
if all of them are normal, after it finished,you will see four image in the current path.
Start testing the camera A
sh: 1: raspistill: not found
Start testing the camera B
sh: 1: raspistill: not found
Start testing the camera C
sh: 1: raspistill: not found
Start testing the camera D
sh: 1: raspistill: not found
pi@raspberrypi:/RaspberryPi/Multi_Camera_Adapter/Multi_Adapter_Board_4Channel/Multi_Camera_Adapter_V2.1_C++ $ sudo ./init_camera.sh
----Test i2c1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- 0c -- -- --
10: 10 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --
----Detecting the /dev/video0 device
video0 detected!
---Start testing each camera
if all of them are normal, after it finished,you will see four image in the current path.
Start testing the camera A
sh: 1: raspistill: not found
Start testing the camera B
sh: 1: raspistill: not found
Start testing the camera C
sh: 1: raspistill: not found
Start testing the camera D

PLEASE HELP ME TO RESOLVE THIS ISSUE.

Multi-camera Adapter B0120 V2.2 + RPi 4B - All ports disabled executing init_camera.sh

Right on the get-go after purchasing ArduCAM 4-Channel Multi-camera Adapter B0120 V2.2, tried executing the camera modules, RPi 4B on Raspbian Buster seem to have crashed and disabled all of the ports including HDMI ports when trying to execute "init_camera.sh" shell file. Attempt to execute "4cam_cv3.py" doesn't display my 2 camera's outputs.
I'm not sure how to go from here after this. I hope you guys would help out about this issue.
Here are the details below:

Setup:
RPi 4B <-- SDCard 32GB <-- Raspbian Buster
<-- HDMI <-- TV (VIZIO E321VL-TW)
<-- LAN <-- Router
<-- USB <-- USB Wireless Keyboard+Mouse combo
<-- CSI <-- ArduCAM B0120 V2.2 <-- Camera A - RPi Camera V1.3
<-- Camera C - RPi Camera V1.3

Terminal:
$ sudo raspi-config
-- Enabled "Camera"
-- Enabled "I2C"
$ sudo apt install python-pyqt5
$ sudo apt install python-opencv
$ git clone https://github.com/ArduCAM/RaspberryPi.git
$ cd RaspberryPi/Multi_Camera_Adapter/Multi_Adapter_Board_4Channel/Multi_Camera_Adapter_V2.2
$ sudo chmod +x init_camera.sh
$ sudo ./init_camera.sh

Status: CRASH

  • half-way through Terminal execution, when "Start testing the camera A", Rpi 4B seemingly crashed.
      | - ArduCAM Hat status LED lights up OK.
      | - VNC got cut off
      | - RPi 4B LAN Port seemingly disabled (LAN Tx lights went out)
      | - HDMI TV output got cut off. No signal detected.
      | - Keyboard interrupt + doesn’t seem to respond.

Terminal output before CRASH:
0  1  2  3 4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- 36 -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --
---- Configure Adapter Board V2.1
Adapter Board V2.1 configure OK
---- install v4l2 driver configure
v4l2 driver install OK
---- detecting the dev/video0 device
video0 detected!
---- Start testing each camera
if all of them are normal, after it finished, you will see four image in the current path.
Start testing the camera A
####CRASH HAPPENS AFTER THIS LINE####

I've also attempted to troubleshoot by doing the following:

  • add dtparam=i2c_vc=on to /boot/config.txt,then reboot
  • Terminal:
    $ i2cdetect -y 0
    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
    00:          -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: 70 -- -- -- -- -- -- --
  • Run attempt using ArduCAM's 4cam_cv3.py:
    $ python 4cam_cv3.py
  • Output:
    qt5ct: using qt5ct plugin
    qt5ct: D-Bus global menu: no
    VIDIOC_STREAMON: Invalid argument

8M autofocus sensor module failed demos

I think something is wrong with these Demo scripts, because they run more or less well, but closing them DOES NOT keep the focus, making it useless to take photos or video.
I have tested the official 8M V2 camera module on a raspberry Pi 3A +, with updated stretch and buster:

1- Snapshot.py

  • -When running it, the small window pygame appears in BLACK.
  • -Press UP key: value always 512 Image save OK.
  • -We set the focus completely to BLIND.
  • -We see all the jpg defocused.
  • -We close the main cmd window.

Result: 18 unfocused photos.jpg


2- Preview.py

  • -When executing it, two windows appear: the small and always BLACK pygame,
    and the enormously large Preview, which hides much of the desktop.
  • -Close correct focus with the UP key up to a value of 272, and we stop.
  • -We close the window.
  • -We take a photo with raspistill -or previous.jpg of the previously focused object, totally out of focus.

Result: the camera DOES NOT SAVE THE FOCUS, making it completely USELESS


3- Autofocus.py

  • Similar to the previous ones, huge preview window that covers almost everything.
  • AUTOFOCUS OK, photo OK.
  • We close the window.
  • We take a test photo raspistill -o autofocus.jpg: Defocused

Result: Autofocus OK Photo OK, but when closing the window, it doesn't keep focus with raspistill.


4- Folder C, manualFocus.py

  • -Huge pre-screen, which covers almost the entire desktop.
  • -Press the UP key, in the command viewer only UP or DOWN appears, (No numerical value)
  • -We got focus OK.
  • -We close the window.
  • -Test photo raspìstill -o manualfocus.jpg DEFOCUSED again.

Result: It does NOT save the focus value. END of the test.

I wonder if it is an error in the demo scripts and if not, what is the use of buying this module?
Hope someone from the arducam team can help me clarify this issue.
Thanks in advance.

Only use 2 cameras using 4 channel multi adapter board v2.1

I just bought Arducam multi adapter board v2.1 with 4 channels. I successfully run my own code accessing I2C with PiCamera for each port and got the video stream i want. At the time I want to use the provided code (4cam_picamera.py) and disable the img2 and img3 in the codes (bcs rn i only use two cameras), i got the video stream but it's kind of overlapping each other as u can see from the picture attached. The reason I bought the 4 channels instead of the 2 channels because I will use three cameras later on, but now I only have two with me right now. Anyone can help to modify the code to only get two or three cameras working on together? Thank you

image

i2cset failed with error

When I am running init_camera.sh I got message "Error: write failed". This error is coming from command i2cset -y 1 0x70 0x00 0x04.

i2C is enabled. I am using a raspberry pi 3 B with a supposed V2.1 Multi-Camera Adapter Board. I am not sure the distributor sold the correct adapter so I join a picture of the board.
multicamera

Failed to read from camera

Hello,
I have purchased 2x motorized autofocus cameras from utronics. I can't seem to get either of them to work. I have enabled the camera and i2c interfaces through raspi-config as well as tested different cameras and Raspberry Pis. I always get the same message:

mmal: Cannot read camera info, keeping the defaults for OV5647
mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
mmal: Failed to create camera component
mmal: main: Failed to create camera component
mmal: Camera is not detected. Please check carefully the camera module is installed correctly

Exception in thread Thread-1 (most likely raised during interpreter shutdown):⏎

How do you make images saved increment?

How do I make the images saved add a number in succession when saving? Every photo taken simply overrides the last photo taken...

#save image to file.
camera.capture("test.jpg")

I2C device not detected

Hi,

I've been using the Autofocus UV-544 and the I2C ID 0x0c has stopped appearing/being detected. I can see that the ID 0x64 is still being found and the images still can be captured with raspistill, but the autofocus does not seem to work as the 0x0c ID is not responding.

I2C configuration has not been changed, but it is very strange that this one ID to control the autofocus just does not respond any more.

Have you seen this kind of issue before? Any advice would be appreciated.

Thank you.

RPi Multi-Camera V2.1 - "init_camera.sh" appears to "freeze."

So, I'm not 100% sure what's going on. "init_camera.sh" appears to "freeze."
The readout that I'm getting is:

pi@raspberrypi:~/RaspberryPi/Multi_Camera_Adapter/Multi_Adapter_Board_4Channel/Multi_Camera_Adapter_V2.1 $ sudo ./init_camera.sh
----Test i2c1
Error: Could not open file /dev/i2c-1' or /dev/i2c/1': No such file or directory
----Configure Adapter Board V2.1
Error: Could not open file /dev/i2c-1' or /dev/i2c/1': No such file or directory
Adapter Board V2.1 configure OK
----install v4l2 driver
v4l2 driver install OK
----Detecting the /dev/video0 device
video0 detected!
---Start testing each camera
if all of them are normal, after it finished,you will see four image in the current path.
Start testing the camera A
Error: Could not open file /dev/i2c-1' or /dev/i2c/1': No such file or directory
Start testing the camera B
Error: Could not open file /dev/i2c-1' or /dev/i2c/1': No such file or directory
Start testing the camera C
Error: Could not open file /dev/i2c-1' or /dev/i2c/1': No such file or directory
Camera control callback cmd=0x4f525245mmal: No data received from sensor. Check all connections, including the Sunny one on the camera board

This is the point that it consistently stops at.

I'm using an RPi 4(4gig ram), a 7" touch screen, and two 8mp V2 cameras with your V2 MultiCam Adapter.

And when I run "4cam_cv3.py" it just gives me 4 "blank" squares.

Here are the two images that it's taken. As you can see, they appear identical which they shouldn't be
capture_1
capture_2

Multi Camera V2 Demos Don't Use Camera B

Hi, I have the "Arducam Multi Camera Adapter Doubleplexer Stereo Module V2" connected to a Raspberry Pi Zero W and have been trying to get the shell samples to work. Unfortunately, they only seem to take photos from one camera (Camera A). The Stereo Module has UC444 Rev-C on the PCB.

I've tried the scripts in both RaspberryPi/.../Multi_Adapter_Board_2Channel and RaspberryPi/.../Multi_Adapter_Board_2Channel_uc444 and haven't been able to get images from both cameras on either.

The script in RaspberryPi/.../Multi_Adapter_Board_2Channel has no errors/warnings. When I run it I see the camera LEDs toggling on when it takes a photo with Camera A, and turning off when Camera B is supposed to take a photo (Camera A just ends up taking another photo).

For the one in RaspberryPi/.../Multi_Adapter_Board_2Channel_uc444 I get an error when trying to use i2cset, but I believe that's the same as #1 (just noting it down in case I'm mistaken).

I've tried flipping the cameras (e.g moving Camera A to the Camera B slot) and running the scripts again, and Camera A is still the only one that ends up taking a photo.

Let me know if you need more info.

MultiCamera for Raspberrypi v2.1 is not detected as video0

hello there,

when i run the init_camera.sh, i get

----Detecting the /dev/video0 device
Can't find video0 device, please check the hardware connection!

hardware connection is definetly ok, i check several times. when i try raspistill -o test.jpeg i get

mmal: Cannot read camera info, keeping the defaults for OV5647
mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
mmal: Failed to create camera component
mmal: main: Failed to create camera component
mmal: Camera is not detected. Please check carefully the camera module is installed correctly

when i plug in a single camera instead of the MultiCamera Adapter, it works normal, so the pi software/firmware/hardware seems to be ok. any ideas or any hints to debug this?

kind regards

Motorized focus and time lapse

Hello !

I want to set the focus of my camera and then start a time lapse. But after reviewing the demo files I've come to understand that I don't understand how any of this works.

I've tried modifying them so that I just need to set the value in .py script once and start the time lapse but every time I try to do so I get errors.

Is there a simple way to control the focus, set it, and then use the usual picamera control option ?

I know all this scream newbie but I'd be very very thankful if someone could point me in the right direction

Cheers

how to install libopencv-dev

I am trying to run the command on Raspberry Pi 4,

sudo apt-get install -y libopencv-dev

there are some errors below, how to resolved it?
even if I run the command,
sudo apt-get update

These issues still exit.

错误:1 http://raspbian.raspberrypi.org/raspbian buster/main armhf libexif-dev armhf 0.6.21-5.1
404 Not Found [IP: 93.93.128.193 80]
错误:2 http://raspbian.raspberrypi.org/raspbian buster/main armhf libexif-doc all 0.6.21-5.1
404 Not Found [IP: 93.93.128.193 80]
错误:3 http://raspbian.raspberrypi.org/raspbian buster/main armhf mariadb-common all 1:10.3.15-1
404 Not Found [IP: 93.93.128.193 80]
错误:4 http://raspbian.raspberrypi.org/raspbian buster/main armhf libmariadb3 armhf 1:10.3.15-1
404 Not Found [IP: 93.93.128.193 80]
错误:5 http://raspbian.raspberrypi.org/raspbian buster/main armhf libtiffxx5 armhf 4.0.10-4
404 Not Found [IP: 93.93.128.193 80]
错误:6 http://raspbian.raspberrypi.org/raspbian buster/main armhf libtiff-dev armhf 4.0.10-4
404 Not Found [IP: 93.93.128.193 80]
无法修复缺失的软件包。
E: 无法下载 http://raspbian.raspberrypi.org/raspbian/pool/main/libe/libexif/libexif-dev_0.6.21-5.1_armhf.deb 404 Not Found [IP: 93.93.128.193 80]
E: 无法下载 http://raspbian.raspberrypi.org/raspbian/pool/main/libe/libexif/libexif-doc_0.6.21-5.1_all.deb 404 Not Found [IP: 93.93.128.193 80]
E: 无法下载 http://raspbian.raspberrypi.org/raspbian/pool/main/m/mariadb-10.3/mariadb-common_10.3.15-1_all.deb 404 Not Found [IP: 93.93.128.193 80]
E: 无法下载 http://raspbian.raspberrypi.org/raspbian/pool/main/m/mariadb-10.3/libmariadb3_10.3.15-1_armhf.deb 404 Not Found [IP: 93.93.128.193 80]
E: 无法下载 http://raspbian.raspberrypi.org/raspbian/pool/main/t/tiff/libtiffxx5_4.0.10-4_armhf.deb 404 Not Found [IP: 93.93.128.193 80]
E: 无法下载 http://raspbian.raspberrypi.org/raspbian/pool/main/t/tiff/libtiff-dev_4.0.10-4_armhf.deb 404 Not Found [IP: 93.93.128.193 80]
E: 中止安装。

pi@raspberrypi:~ $ cat /etc/rpi-issue
Raspberry Pi reference 2019-06-20
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 150e25c4f8123a4c9c63e8dca1b4737fa6c1135c, stage5

Can't find video0 device

Hi,
I followed the instruction of setting up the multi camera module v2.2, but I get the following error:

----Test i2c1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: 10 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- 64 -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- --
----Detecting the /dev/video0 device
Can't find video0 device, please check the hardware connection!

I tried with zero wh and Pi 3 A+

libarducam_vcm source code missing from repo

Hello. I cannot find the sourcecode for the libarducam_vcm library which is fundamental to the motorized focus camera. Would need that to move into long term support for our device.

sudo ./run_Arducam_Demo does nothing

I run the command: sudo ./run_Arducam_Demo and hit enter,
then it's just blank. Nothing appears.

pi@raspberry: ~/RaspberryPi/SPI_Camera $ sudo ./run_Arducam_Demo
      

Also will this work as a camera input? I'm trying to use this camera for an obstacle avoidance car

For those who are experiencing this issue:

For those who are experiencing this issue:

  • It seems to be a problem on the board we have. I contacted ArduCAM by e-mail and the boards I got directly from them worked without any problem.

Just for documentation, you can make the "not-working board" work, at least for development, following the steps described by @lrnzo

Our team tried to manually create the /dev/video0, in order to make the boards work without this trick, but we have not success so far. The interface is created, it passes on the ArduCAM's script test but it does not work to capture images.

Originally posted by @cjcbusatto in #11 (comment)

Failed to set I2C address

Why i runing sample but has error Failed to set I2C address 😱

import cv2  # sudo apt-get install python-opencv
import numpy as py
import os
import time
from ctypes import *

# load arducam shared object file
arducam_vcm = CDLL('libs/libarducam_vcm.so')
try:
    import picamera
    from picamera.array import PiRGBArray
except:
    sys.exit(0)


def focusing(val):
    arducam_vcm.vcm_write(val)
    # print("focus value: {}".format(val))


def sobel(img):
    img_gray = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)
    img_sobel = cv2.Sobel(img_gray, cv2.CV_16U, 1, 1)
    return cv2.mean(img_sobel)[0]


def laplacian(img):
    img_gray = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY)
    img_sobel = cv2.Laplacian(img_gray, cv2.CV_16U)
    return cv2.mean(img_sobel)[0]


def calculation(camera):
    rawCapture = PiRGBArray(camera)
    camera.capture(rawCapture, format="bgr", use_video_port=True)
    image = rawCapture.array
    rawCapture.truncate(0)
    return laplacian(image)


if __name__ == "__main__":
    # vcm init
    arducam_vcm.vcm_init()
    # open camera
    camera = picamera.PiCamera()

    # open camera preview
    camera.start_preview()
    # set camera resolution to 640x480(Small resolution for faster speeds.)
    camera.resolution = (640, 480)
    time.sleep(0.1)
    camera.shutter_speed = 30000
    print("Start focusing")

    max_index = 10
    max_value = 0.0
    last_value = 0.0
    dec_count = 0
    focal_distance = 10

    while True:
        # Adjust focus
        focusing(focal_distance)
        # Take image and calculate image clarity
        val = calculation(camera)
        # Find the maximum image clarity
        if val > max_value:
            max_index = focal_distance
            max_value = val

        # If the image clarity starts to decrease
        if val < last_value:
            dec_count += 1
        else:
            dec_count = 0
        # Image clarity is reduced by six consecutive frames
        if dec_count > 6:
            break
        last_value = val

        # Increase the focal distance
        focal_distance += 15
        if focal_distance > 1000:
            break

    # Adjust focus to the best
    focusing(max_index)
    time.sleep(1)
    # set camera resolution to 2592x1944
    camera.resolution = (1920, 1080)
    # save image to file.
    camera.capture("test.jpg")
    print("max index = %d,max value = %lf" % (max_index, max_value))
    # while True:
    #	time.sleep(1)

    camera.stop_preview()
    camera.close()

output

pi@raspberrypi:~/camera_test $ sudo python3 test.py
Start focusing
Failed to set I2C address
Failed to set I2C address
Failed to set I2C address
Failed to set I2C address
Failed to set I2C address
Failed to set I2C address
Failed to set I2C address
Failed to set I2C address
Failed to set I2C address
Failed to set I2C address
Failed to set I2C address
Failed to set I2C address
Failed to set I2C address
Failed to set I2C address
max index = 55,max value = 3.607292
pi@raspberrypi:~/camera_test $

Change the exposure time of camera-OV9281?

I run the multi_camera_board.py, and want to change the exposure time. So I add the following code:

camera.software_auto_exposure(False)
address_h_c = c_uint16(0x3500)
address_m_c = c_uint16(0x3501)
address_l_c = c_uint16(0x3502)
expo_h_c = c_uint16(0x0000)
expo_m_c = c_uint16(0x0000)
expo_l_c = c_uint16(0x00ff)
camera.write_sensor_reg(address_h_c.value, expo_h_c.value)
camera.write_sensor_reg(address_m_c.value, expo_m_c.value)
camera.write_sensor_reg(address_l_c.value, expo_l_c.value)

The exposure time becomes lower but I don't have the detail of the exposure registor of OV9281(I can't find its datasheet). Could you add some code like setting the exposure time, gain value in your code, or tell me the detail of these registors?
Thanks!

Motorized focus calibration

Hi,
is there any function relating the parameter 'focal_distance' with an actual distance of objects in focus? I am wondering if it is possible to utilize this camera to measure the distance.

Of course it can be done by experimental calibration with some test chart, but depth of field of this camera is rather huge. Has anyone tried?

Thanks in advance

Is initializing camera 3 in Multi_Camera_Adapter_V2.1_С++.cpp correct?

Hello!
I'am using multicamera adapter module V2.1 (B0120).
It works great with python code. But when I started use c++ code I found this:

 } else if (cam == 2) {
        #ifdef ENABLE_CAMERA_2
        system("i2cset -y 1 0x70 0x00 0x05");
        digitalWrite(7, HIGH);
        digitalWrite(0, LOW);
        digitalWrite(1, HIGH);
        #else
        return -2;
        #endif
    } else if (cam == 3) {
        #ifdef ENABLE_CAMERA_3
        system("i2cset -y 1 0x70 0x00 0x05");
        digitalWrite(7, HIGH);
        digitalWrite(0, LOW);
        digitalWrite(1, HIGH);
        #else
        return -3;

Initializing camera 3 is same as camera 2
I think it is error because in python code initializing camera 3 looks like:

    	i2c = "i2cset -y 1 0x70 0x00 0x06"
        os.system(i2c)
        gp.output(7, False)
    	gp.output(11, True)
    	gp.output(12, False)

I corrected code

    } else if (cam == 3) {
        #ifdef ENABLE_CAMERA_3
        system("i2cset -y 1 0x70 0x00 0x06");
        digitalWrite(7, LOW);
        digitalWrite(0, HIGH);
        digitalWrite(1, LOW);
        #else
        return -3;

And Your c++ code example now works great
P.S. Sorry for bad English

previewopencv for 2.2 multicamera doesnt work for python3 & C++

i run make for 2.2 multi-camera and get this error when i make and run the previewopencv.

./previewOpencv
Detected camera on channal:A
VIDEOIO ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV
ERROR! Unable to open camera

I attempted to do the python previewopencv using python3 and get this error:

[ WARN:0] global /tmp/pip-wheel-2l8ccy47/opencv-python/opencv/modules/videoio/src/cap_v4l.cpp (893) open VIDEOIO(V4L2:/dev/video0): can't open camera by index
Traceback (most recent call last):
File "previewOpencv.py", line 8, in
Arducam_adapter_board.preview()
File "/home/pi/Documents/code/RaspberryPi-master/Multi_Camera_Adapter/Multi_Adapter_Board_4Channel/Multi_Camera_Adapter_V2.2_python/AdapterBoard.py", line 81, in preview
frame.dtype=np.uint8
AttributeError: 'NoneType' object has no attribute 'dtype'

GPL violation - MIPI-Camera drivers include chunks of mmal-vchiq.c

I'm happy that you're releasing products for the Pi, however I suspect you are breaching the GPL licence in providing only prebuilt kernel modules for your OV7251, OV9281, and IMX135 drivers.

A couple of minutes with a hex editor show they include various functions from mmal-vchiq.c, which is licenced under GPLv2, and therefore requires that you provide source code to rebuild the modules.
Indeed the module itself declares itself to be licenced under the GPL licence. The module parameters are a giveaway as to the origin of the code too.

filename:       /home/pi/tmp/RaspberryPi/MIPI_Camera/ov7251-release/4.14.71-v7+/arducam-ov7251-v4l2-pi3.ko
version:        0.0.1
license:        GPL
author:         Everyone
description:    Broadcom 2835 MMAL video capture
srcversion:     5C76648EC6F250C09749E17
alias:          of:N*T*Carducam,ov7251C*
alias:          of:N*T*Carducam,ov7251
depends:        videobuf2-v4l2,videodev,videobuf2-vmalloc,videobuf2-core,v4l2-common
staging:        Y
name:           arducam_ov7251_v4l2
vermagic:       4.14.71-v7+ SMP mod_unload modversions ARMv7 p2v8 
parm:           debug:int
parm:           bcm2835_v4l2_debug:Debug level 0-2
parm:           video_nr:videoX start numbers, -1 is autodetect (array of int)
parm:           max_video_width:Threshold for video mode (int)
parm:           max_video_height:Threshold for video mode (int)

You're likely to hit issues as soon as the kernel goes to 4.19 due to mmal-vchiq having been broken out into an independent kernel module.

Can I point out that there is a mainline kernel driver for ov7251. There is a kernel driver for the Pi CSI-2 receiver peripheral, and a couple of example dtoverlays for configuring it.
This is the better way of supporting these devices, and I'm happy to offer some support to you should you wish to go this route. If implemented cleanly, changes would be acceptable to be merged into the Pi kernel, and that would solve the issues of you having to rebuild against each kernel release.

pinout for UC-444 Rev. C board?

The documentation for this board on Github describes 6 pins of connectivity, but the connector on the board covers 22 GPIO pins, without any pass-through. Obviously, GPIO pins are precious on a Raspi, so could anyone tell me which pins are unused, or open for re-use?

The switch between camera A and C get write failed error in terminal

Hi,
I have tried to use VideoCapture class from OpenCV library to get the image between camera A and C simultaneous. The problem is that I could not get the right frame per second and the images from each camera haven't any noise. The write failed error appears after 1s after running the program.
Multi camera adapter Arducam V2.1

import cv2
import os
import RPi.GPIO as gp

class Camera:
   def setup(self,id):
      if id == 0:
          i2c = "i2cset -y 1 0x70 0x00 0x04"
          os.system(i2c)
          gp.output(7, False)
          gp.output(11, False)
          gp.output(12, True)
      elif id == 1:
          i2c = "i2cset -y 1 0x70 0x00 0x05"
          os.system(i2c)
          gp.output(7, True)
          gp.output(11, False)
          gp.output(12, True)
      elif id == 2:
          i2c = "i2cset -y 1 0x70 0x00 0x06"
          os.system(i2c)
          gp.output(7, False)
          gp.output(11, True)
          gp.output(12, False)
      elif id == 3:
          i2c = "i2cset -y 1 0x70 0x00 0x07"
          os.system(i2c)
          gp.output(7, True)
          gp.output(11, True)
          gp.output(12, False)
    
   def __init__(self):
        
      self.vc = cv2.VideoCapture(0)
      self.vc.set(cv2.CAP_PROP_FRAME_HEIGHT,300)
      self.vc.set(cv2.CAP_PROP_FRAME_WIDTH,300)
      self.vc.set(cv2.CAP_PROP_FPS, 60)
    
      self.setup(0)
      self.cameraid = 0
      if self.vc.isOpened(): # try to get the first frame
         self.rval, self.frame = self.vc.read()
      else:
         self.rval = False
   
   def take_picture(self, index):
       if self.cameraid != index:
          self.setup(index)
          self.cameraid = index
       if self.rval:
          self.rval, self.frame = self.vc.read()
          return self.frame
       else:
          return None

   def __del__(self):
      self.vc.release()

Please tell me what can I do.
Many thanks,
Maria

Add simple commands instead of Arducam_demo

Hi, I've been playing around with the OV5642 mini module and RPI, and so far thats the only one project thats working correctly (plain arducam libs don't compile cause of smbus error), but its pretty useless, unless you get the .APK to connect, which is quite pointless if you want to operate the camera without android phone.
Please attach at least one file that allows simple capture from CLI or script, instead of requiring an app for it.

Issue using Python SMBus2 library in order to read from I2C register of the OV5642

Hi, I am trying to use Python with the SMBus2 library in order to communicate with the OV5642 camera on a Raspberry Pi. Although it seems that the SPI side of the camera works well (using the spidev library on Python) there are issues while I am trying to read I2C registers with the SMBus2 library, what I read are just zeros.
The steps that I am trying to do are these:

from smbus2 import SMBus
bus = SMBus(2)
b = bus.read_byte_data(0x3C, register_id)

I am trying to replicate the code inside the "arducam_i2c_word_read()" function in the C code here, but I am struggling and I don't knwo why. Is it possible to use this camera with python?

NOTE: I am tryin to read from the commod registers ids: 0x300A and 0x300B, but just zeros are retrieved.

V2.1 multicamera adapter issue

I have a problem with multicamera adaptor when I run the 4cam_picamera.py the app only displays the images from cam D also there is a lot of flickering in the images.
20200127_192249 (1)

64bit Pi incompatibility issues for motorized focus code, please offer a pure opencv version

Hi, could you provide a version of your Motorized focus Camera code that solely uses opencv? Raspistill and raspivid don't work with 64bit RPiOS, and pip3 install picamera fails because pip never finds a compatible version. Your python code is already using cv2, so I can't imagine making a slightly different version using opencv commands should be challenging. If anyone is interested, you can use this in python to take in and display the camera snapshots:
`cap = cv2.VideoCapture(0)
ret, frame = cap.read()
cv2.imshow('preview',frame)'

There are also some other tools that you could use to handle converting things into raw RGB images like they do in Autofocus.py.

I don't know about the C/C++ side of things though...

I'm currently running my raspberry pi 4 (8gb) with Debian buster 64bit RPiOS (aarch64 architecture) with Deep learning toolkits from Qengineering

4Channel adapter C++ Not Working

Hi,

It seems that the code in Multi_Camera_Adapter/Multi_Adapter_Board_4Channel/Multi_Camera_Adapter_V2.1_C++/ does not work. When I use it I get a libv4l error and it says cannot open stream. It then sometimes pauses and does nothing or it will end by itself with more libv4l errors saying cannot open stream. I've also noticed that after using this application, raspistill no longer works. If I reboot, it seems to fix it. I was using the multicam adapter with 2 cameras. The version is v2.1 UC-475 Rev.B.

autofocus while recording video

Hi, I've ordered the 8 MP auto-focus camera https://www.arducam.com/product/arducam-imx219-auto-focus-camera-module-drop-in-replacement-for-raspberry-pi-v2-and-nvidia-jetson-nano-camera/

A couple of questions while I wait for it:

  • I've seen your autofocus.py script. While that sets the optimal focal length for a given view, do you know if it's possible to do this at regular intervals while recording to a stream as in: https://picamera.readthedocs.io/en/release-1.13/recipes1.html#recording-video-to-a-stream Maybe use the video splitter port?

  • The first link says "The camera can be used on compute module CM3, CM3+, and NOT compatible with Raspberry Pi 3B/B+." Can you please confirm this? What about the Pi Zero?

Thanks!

Can't see camera view while focusing

Hi there !
I have recently set up my new Camera Trap using Raspberry Pi and an ArduCam and wanted to focus on my Bird Feeder.
I had trouble with Motorized_Focus_Camera_Preview.py. I couldn't view the camera stream while focusing.
So I modified a bit the code to enable that :


import os
import time
import sys
import threading
import pygame
import pygame.camera
from pygame.locals import *
from time import ctime, sleep

DEVICE = '/dev/video0'#the location of the camera
SIZE = (640, 480)#the size of the pygame window

pygame.init()
pygame.key.set_repeat(100)

def runFocus():
    temp_val = 512
    for event in pygame.event.get():
        if event.type ==KEYDOWN:
            print(temp_val)
            if event.key == K_UP:
                print('UP')
                if temp_val < 1000:
                    temp_val += 10
                else:
                    temp_val = temp_val
                value = (temp_val<<4) & 0x3ff0
                dat1 = (value>>8)&0x3f
                dat2 = value & 0xf0

                os.system("i2cset -y 0 0x0c %d %d" % (dat1,dat2))
            elif event.key==K_DOWN:
                print('DOWN')
                if temp_val <12 :
                    temp_val = temp_val
                else:
                    temp_val -= 10
                value = (temp_val<<4) & 0x3ff0
                dat1 = (value>>8)&0x3f
                dat2 = value & 0xf0
                os.system("i2cset -y 0 0x0c %d %d" % (dat1,dat2))

def runCamera():
    pygame.camera.init()
    display = pygame.display.set_mode(SIZE, 0)
    camera = pygame.camera.Camera(DEVICE, SIZE)
    camera.start()
    screen = pygame.surface.Surface(SIZE, 0, display)
    while True:
        screen = camera.get_image(screen)
        display.blit(screen, (0,0))
        pygame.display.flip()#only if the camera is upside down
        runFocus()
        #check if the user want to quit focusing 
        for event in pygame.event.get():
           if event.type == QUIT:
               camera.stop()
               pygame.quit()

if __name__ == "__main__":
   # t1 = threading.Thread(target=runFocus,args=("t1",))
   # t1.setDaemon(True)
   # t1.start()    
 runCamera()

I don't use threading anymore. It was not usefull. Moreover I couldn't use pygame key reading function while using it for camera preview.

I hope that comment will be usefull for guys who had the same issue, and perhaps for ArduCam itself.

photo capture

hi there~
in order to capture a photo,I define a function
image

There is no problem with compiling and running, but the size of the saved image is zero. Why? How do I modify this function?

Selecting camera A sometimes produces garbage

I use the code below with the multicam board revision 2.2, and while most pictures come out correctly, I occasionally get a bad picture like this:
pic-1584650521-1-reduced

This only happens with camera A. As the code continues with camera B and C, these work well.

Any ideas why? I do need full resolution, but don't care much about speed of execution. If more sleep() commands would help, that is fine...

code snippet:

` i2c = "/usr/sbin/i2cset -y 1 0x70 0x00 0x04"
os.system(i2c)
gp.output(7, False)
gp.output(11, False)
gp.output(12, True)
time.sleep(1)
with PiCamera() as camera:
camera.annotate_background = picamera.Color('black')
camera.annotate_text = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
camera.resolution = (3280,2464)
print("Starting camera 1 warmup preview")
camera.start_preview()
time.sleep(5)
print("Camera 1 Exposure Parameters: Speed: ", camera.exposure_speed, " AWB: ", camera.awb_gains);
speed = camera.exposure_speed;
awb = camera.awb_gains;
camera.exposure_mode = 'off'
camera.awb_mode = 'off'
camera.shutter_speed = speed
camera.awb_gains = awb
camera.capture("{0}-1.jpg".format(name))

i2c = "/usr/sbin/i2cset -y 1 0x70 0x00 0x05"
os.system(i2c)
gp.output(7, True)
gp.output(11, False)
gp.output(12, True)
time.sleep(1)
with PiCamera() as camera:
	camera.annotate_background = picamera.Color('black')
	camera.annotate_text = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
	camera.resolution = (3280,2464)
	camera.exposure_mode = 'off'
	camera.awb_mode = 'off'
	camera.shutter_speed = speed
	camera.awb_gains = awb
	print("Camera 2 Exposure Parameters: Speed: ", camera.exposure_speed, " AWB: ", camera.awb_gains);
	camera.capture("{0}-2.jpg".format(name))

i2c = "/usr/sbin/i2cset -y 1 0x70 0x00 0x06"
os.system(i2c)
time.sleep(1)
gp.output(7, False)
gp.output(11, True)
gp.output(12, False)
with PiCamera() as camera:
	camera.annotate_background = picamera.Color('black')
	camera.annotate_text = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
	camera.resolution = (3280,2464)
	camera.exposure_mode = 'off'
	camera.awb_mode = 'off'
	camera.shutter_speed = speed
	camera.awb_gains = awb
	print("Camera 3 Exposure Parameters: Speed: ", camera.exposure_speed, " AWB: ", camera.awb_gains);
	camera.capture("{0}-3.jpg".format(name))

`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.