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¶
- VCAM-AR1335B (daA4200-30mci): supported
- VCAM-AR0821B (daA3840-30mc): supported
- VCAM-AR0521B (daA2500-60mc): not supported
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.3.1.27-imx8mp-5.10.72-2.2.1 ../sources/meta-basler-imx8
$ git clone https://github.com/varigit/meta-basler-tools -b 1.3.1.27-imx8mp-5.10.72-2.2.1 ../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 = " \
pylon \
python3-pypylon \
gentl-producer \
xauth \
kernel-module-basler-camera \
"
IMAGE_INSTALL_append_mx8mp = " \
imx8mp-modprobe-config \
kernel-module-isp-vvcam \
isp-imx \
basler-camera \
"
PREFERRED_VERSION_isp-imx = "4.2.2.14+basler"
PREFERRED_VERSION_basler-camera = "4.2.2.14+basler"
PREFERRED_VERSION_kernel-module-isp-vvcam = "4.2.2.14+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:
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:
Running GStreamer¶
The following commands apply to VCAM-AR0821B (daA3840-mc) only.
Run the following commands at the shell prompt:
- 1920x1080@30fps:
# gst-launch-1.0 -v v4l2src device=/dev/video0 ! "video/x-raw,format=YUY2,width=1920,height=1080" ! waylandsink sync=false
- 3840x2160@30fps:
# gst-launch-1.0 -v v4l2src device=/dev/video0 ! "video/x-raw,format=YUY2,width=3840,height=2160" ! waylandsink sync=false
Switching between different Basler cameras¶
The Yocto image built supports the
VCAM-AR1335B (daA4200-30mci)
camera by default.
In order to use the VCAM-AR0821B (daA3840-mc)
or the VCAM-AR0521B (daA2500-60mc)
camera you need to run the following commands at the shell prompt:
# cd /boot
# ln -fs imx8mp-var-dart-dt8mcustomboard-basler-isp0.dtb imx8mp-var-dart-dt8mcustomboard.dtb
# ln -fs imx8mp-var-dart-dt8mcustomboard-legacy-basler-isp0.dtb imx8mp-var-dart-dt8mcustomboard-legacy.dtb
# ln -fs imx8mp-var-som-symphony-basler-isp0.dtb imx8mp-var-som-symphony.dtb
To switch back run the following commands at the shell prompt:
# cd /boot
# ln -fs imx8mp-var-dart-dt8mcustomboard-basler-isi0.dtb imx8mp-var-dart-dt8mcustomboard.dtb
# ln -fs imx8mp-var-dart-dt8mcustomboard-legacy-basler-isi0.dtb imx8mp-var-dart-dt8mcustomboard-legacy.dtb
# ln -fs imx8mp-var-som-symphony-basler-isi0.dtb imx8mp-var-som-symphony.dtb
The above changes become effective after reboot.
Prebuilt recovery SD card image¶
A prebuilt recovery SD card image with Basler camera support can be downloaded from:
mx8mp__yocto-hardknott-5.10.72_2.2.1-v1.1__basler-cep.img.gz