BPI R2 USB or Else Camera Sugession

(Yusuf Bülbül) #1

Hello. I have a BPI R2. And I want to make image processing with OpenCv library of C++ on Linux Ubuntu. Can anyone give me a recommended USB camera name for this operation.

Thanks && Regards Yusuf.

(Yusuf Bülbül) #2

Isn’t there anyone give me an any suggestions?

(Frank W.) #3

i think you can use any camara which has kernel support yet…

maybe http://www.linux-usb.org/USB-guide/x370.html is a start. try googling for camera supported by linux-kernel…this is nothing board-specific…

as far as i know you use better an usb-camera than one for DSI-Port (currently bad supported)

(Yusuf Bülbül) #4

Thanks for your answer and benefit info.

(Yusuf Bülbül) #5


I am using BPI-R2 on 4.4.70 kernel and Ubuntu. I want to use A4Tech standart usb camera on BPI but, BPI is not recognize the Usb cam.

lsusb output is;

Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 005: ID 0ac8:c40a Z-Star Microelectronics Corp. 
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Z-Star should be USB Camera. Also, Any /dev/video* device folder doesn’t exist. But, When I plug the usb cam to RPI, I can use usb cam.

What should I do?

(Frank W.) #6

If it works on rpi,you can look,which kernel Module /driver is used an compile this into 4.4.70 kernel

dmesg and lsmod will be your friend

(gary) #7

I think CONFIG_USB_VIDEO_CLASS and CONFIG_USB_GSPCA should be enabled to support your USB camera.

(Yusuf Bülbül) #8

What is the directory of CONFIG_USB_VIDEO_CLASS and CONFIG_USB_GSPCA or where can I edit these?

(gary) #9

The driver for USB camera is in folder drivers/media/usb, we should add related configuration in arch/arm/configs/mt7623n_evb_bpi_defconfig and then rebuilt kernel.

(Yusuf Bülbül) #10

Sorry. I can’t find mt7623n_evb_bpi_deconfig for kernel 4.14 in this link; https://github.com/frank-w/BPI-R2-4.14

Can you send me a sample kernel for BPI-R2 link?

(Frank W.) #11

Which kernel do you want to use? Above you’ve wrote 4.4.70 here the source is https://github.com/BPI-SINOVOIP/BPI-R2-bsp

Change it in defconfig or using build.sh an option 4

In 4.14 using “build.sh config” for menuconfig

(Yusuf Bülbül) #12

Actually I will use USB cam and SPI port of BPI-R2. Thats why, I think, I should 4.14 kernel. But, I can’t find a way activate the USB Cam Driver on 4.14.

On Rasberry Pi; when I plug the USB cam, The dmesg messages are following;

[58883.555662] input: A4 TECH USB2.0 PC Camera J as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0/input/input0
[58883.555795] usbcore: registered new interface driver uvcvideo
[58883.555798] USB Video Class driver (1.1.1)

Bu when I plug USB Cam to BPI-R2, I Can’t see similar dmesg messages.

(Frank W.) #13

I think first you need usb-input and usb-camera-support. Currently i have only enabled usb2serial and mass storage class

(Yusuf Bülbül) #14

Which kernel Should I use for usb-input and usb camera support? In the Kernel 4.4.7 mentioned file “arch/arm/configs/mt7623n_evb_bpi_defconfig” there is no CONFIG_USB_VIDEO_CLASS and CONFIG_USB_GSPCA options. Should I add these on file?

(Frank W.) #15

It is easier using menuconfig (build.sh option 4 in 4.4 and “build.sh config” in my 4.14) to add these and if it works adding them optionally to defconfig.

You can search in menuconfig with / and get infos of selected option (name in .config/defconfig) with ?

Defconfig is a default config for a platform. Users normally only working in .config in kernel-root

(Yusuf Bülbül) #16

Thanks For all of your helps.

(Frank W.) #17

have you got it working?

regarding to your dmesg i think you need that:

Symbol: USB_VIDEO_CLASS [=n]

maybe also USB_CONFIGFS_F_UVC [=n] (Depends on: USB_SUPPORT [=y] && USB_GADGET [=n] && USB_CONFIGFS [=n])

(Yusuf Bülbül) #18

I am building kernel again now. I activated USB_VIDEO_CLASS_INPUT_EVDEV and USB_VIDEO_CLASS from build option 4. I will turn back here after tried. Thanks.

(Yusuf Bülbül) #19

Sorry, I am a new on this.

I build the kernel on BPI-R2 with ./build.sh option 3(Only Kernel) How Can I install it to system? Any Kernel folder is not created after building.

(Frank W.) #20

np, i’m also no expert at this :wink: simply learning by doing

first use option 6 (update files for SD) after option 3 then you can look in the SD-folder…you have 2 folders BPI-BOOT and BPI-ROOT

in the first you have under some subfolders the uImage-file…the kernel itself this must be as the top-folder says on the BPI-BOOT-Partiton in same directory as under SD (BPI-BOOT/bananapi/bpi-r2/linux/uImage) same for BPI-ROOT with modules (BPI-ROOT/lib/modules/4.4.70-BPI-R2-Kernel/)

easy to say…the content of BPI-Boot must be copied to BPI-Boot-partition of SD-Card and BPI-Root-content to BPI-root-partition

i said something about the directory-structure so you can backup the uImage-file and the folder containing your old modules. so if something goes wrong you can restore it