Help us understand the problem. What is going on with this article?

Raspberry Pi 4でkernelを更新してD435iを動かす

概要

D435iを使うために、kernelに含まれていないモジュールが必要になり、kernelの更新作業をしたので作業ログを書いておく。

ほとんど以下のissueに書かれていた手順を利用した。

参考

IntelRealSense/librealsense, "Announcement: Raspberry Pi 4 Model B with two USB 3 ports now available" #4272

環境

  • Raspberry Pi 4 model B 4GB
  • Raspbian Buster
  • kernelのバージョン: 4.19.97-v7l+(更新前)→4.19.102-v7l+(更新後)

kernelの更新が必要な条件

D435iを抜き差ししたとき、dmesgで確認すると、hid-sensor-hubではなく、hid-generalが使用されている。

作業ログ

/bootのバックアップ

sudo cp -r /boot /boot.backup

kernelの更新

sudo apt-get install build-essential bison flex bc git libncurses-dev libssl-dev libprotobuf-dev cmake libusb-1.0-0-dev
git clone -b rpi-4.19.y https://github.com/raspberrypi/linux.git --depth 1 rpi-4.19.y
cd rpi-4.19.y
wget https://raw.githubusercontent.com/Delicode/librealsense/master/scripts/realsense_raspberry4.patch
patch -p1 < realsense_raspberry4.patch
make bcm2711_defconfig
make menuconfig # set HID_SENSOR_HUB, HID_SENSOR_ACCEL_3D, HID_SENSOR_GYRO_3D, USB_VIDEO_CLASS, VIDEO_V4L2
make ARCH=arm -j4 zImage modules dtbs
sudo make ARCH=arm modules_install
sudo cp arch/arm/boot/dts/*.dtb /boot/
sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/
sudo cp arch/arm/boot/dts/overlays/README /boot/overlays/
sudo cp arch/arm/boot/zImage /boot/kernel7l.img

一度再起動して、

sudo modprobe videodev
sudo modprobe uvcvideo
sudo modprobe hid_sensor_accel_3d
sudo modprobe hid_sensor_gyro_3d

librealsenseのビルド・インストール

sudo apt install pkg-config freeglut3-dev libgtk-3-dev libglfw3-dev
git clone https://github.com/intelrealsense/librealsense
mkdir -p librealsense/build
cd librealsense/build
cmake ..
make -j4
sudo make install

udevの設定

sudo cp librealsense/config/99-realsense-libusb.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules
sudo udevadm trigger

動作確認

dmesgでhid-generalではなく、hid-sensor-hubが使用されていることを確認した。
rs-enumerate-devicesrealsense-viewerで動作を確認した。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした