MX8 Basler Camera

From Variscite Wiki
DART-MX8M-PLUS Basler Camera using CEP

Introduction

The following instructions will allow you to add CEP (Camera Enablement Package) support for the Basler MIPI camera to your Yocto images.
This will allow you to stream images/video from a Basler camera(s) connected to a Variscite evaluation kit.

Available Basler cameras

Download Variscite Yocto BSP

Please follow Build Yocto from source code.
Execute steps 1-4.3 to download the BSP sources, but don't start bitbake yet.

Download and install Basler meta layers

$ git clone https://github.com/varigit/meta-basler-imx8 -b 1.2.0.12-imx8mp-5.4.70-2.3.0 ../sources/meta-basler-imx8
$ git clone https://github.com/varigit/meta-basler-tools -b 1.2.0.12-imx8mp-5.4.70-2.3.0 ../sources/meta-basler-tools

Customize configuration files

Customize bblayers.conf

Add the following lines to conf/bblayers.conf under your Yocto build directory:

BBLAYERS += " ${BSPDIR}/sources/meta-basler-imx8 "
BBLAYERS += " ${BSPDIR}/sources/meta-basler-tools/meta-basler-common "

Customize local.conf

Add the following to conf/local.conf under your Yocto build directory:

IMAGE_INSTALL_append = " \
	basler-camera-driver \
	pylon \
	python3-pypylon \
	gentl-producer \
	kernel-module-isp-vvcam \
	imx8mp-modprobe-config \
	basler-camera \
	isp-imx \
	xauth \
"
PREFERRED_VERSION_isp-imx                 = "4.2.2.8+basler"
PREFERRED_VERSION_basler-camera           = "4.2.2.8+basler"
PREFERRED_VERSION_kernel-module-isp-vvcam = "4.2.2.8+basler"

Build Yocto image

Continue following Build Yocto from source code from where you left off, to bitbake and install an image.

Running Basler camera application

Run the following commands at the shell prompt:

$ export DISPLAY=:0.0
$ /usr/bin/pylon

Using the pypylon Python 3 interface to Basler camera

This interface lets you configure the camera and acquire video and images from a Python application. You can also type commands in an interactive Python session. All software needed is already installed in the Yocto image generated following instructions on this page.
For more information and sample code refer to the pypylon page on Github.
Before starting Python run the following command at the shell prompt:

$ export GENICAM_GENTL64_PATH=/opt/dart-bcon-mipi/lib

Running GStreamer

The following commands apply to VCAM-AR0821B (daA3840-mc) only.
Run the following command at the shell prompt:

$ gst-launch-1.0 -v v4l2src device=/dev/video0 ! waylandsink sync=false

Prebuilt recovery SD card image

A prebuilt recovery SD card image with Basler camera support can be downloaded from:
dart-mx8mp-basler-cep-1.2.0.12-recovery-sd.v21.img.gz