Problems with Motioneye on Dietpi using v4l2 cameras at all

Creating an issue

Required Information

  • DietPi version | cat /boot/dietpi/.version
    G_DIETPI_VERSION_CORE=8
    G_DIETPI_VERSION_SUB=18
    G_DIETPI_VERSION_RC=2
    G_GITBRANCH=‘master’
    G_GITOWNER=‘MichaIng’
    G_LIVE_PATCH_STATUS[0]=‘not applicable’
  • Distro version | echo $G_DISTRO_NAME $G_RASPBIAN
    bookworm 0
  • Kernel version | uname -a
    Linux MotionEyeTwo 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux
  • Architecture | dpkg --print-architecture
    arm64
  • SBC model | echo $G_HW_MODEL_NAME or (EG: RPi3)
    RPi 4 Model B (aarch64)
  • Power supply used | (EG: 5V 1A RAVpower)
    Does not change anything, i’ve tried various
  • SD card used | (EG: SanDisk ultra)
    SAN Disk Max Endurance (the white ones) 32 GB

Additional Information (if applicable)

  • Software title | MotionEye
  • Was the software title installed freshly or updated/migrated?
    Yes, freshly installed
  • Can this issue be replicated on a fresh installation of DietPi?
    Yes

Steps to reproduce

1.) Login to Motioneye
2.) Try to configure a V4L2 Camera

Expected behaviour

The camera should light up

Actual behaviour

The does not show anything in the webinterface

Extra details

sudo journalctl -u motioneye
Jun 30 15:24:34 MotionEyeTwo motion[2781]: [1:ml1:Camera1] [ERR] [VID] v4l2_device_capability: Device does not support capturing.
Jun 30 15:24:34 MotionEyeTwo motion[2781]: [1:ml1:Camera1] [ERR] [VID] vid_start: V4L2 device failed to open
Jun 30 15:24:34 MotionEyeTwo motion[2781]: [1:ml1:Camera1] [WRN] [ALL] motion_init: Could not fetch initial image from camera
Jun 30 15:24:34 MotionEyeTwo motion[2781]: [1:ml1:Camera1] [WRN] [ALL] motion_init: Motion continues using width and height from config file(s)
Jun 30 15:24:40 MotionEyeTwo motion[2781]: [1:ml1:Camera1] [WRN] [ALL] mlp_retry: Retrying until successful connection with camera
Jun 30 15:24:40 MotionEyeTwo motion[2781]: [1:ml1:Camera1] [ERR] [VID] v4l2_device_capability: Device does not support capturing.
Jun 30 15:24:40 MotionEyeTwo motion[2781]: [1:ml1:Camera1] [ERR] [VID] vid_start: V4L2 device failed to open
Jun 30 15:24:50 MotionEyeTwo motion[2781]: [1:ml1:Camera1] [WRN] [ALL] mlp_retry: Retrying until successful connection with camera
Jun 30 15:24:50 MotionEyeTwo motion[2781]: [1:ml1:Camera1] [ERR] [VID] v4l2_device_capability: Device does not support capturing.
Jun 30 15:24:50 MotionEyeTwo motion[2781]: [1:ml1:Camera1] [ERR] [VID] vid_start: V4L2 device failed to open

→ If i try that on a fresh install of motioneyeos it works like a charm…

What kind of cam do you use? An USB cam or the camera module?

A noname camera module from Amazon:

probably asking the question on MotionEye Github would be an option Issues · motioneye-project/motioneye · GitHub

You may have had the same issue I had. I don’t know why, but motioneye creates a conf file that defaults to video10. Change this to video0 in the motion.conf file. This has always worked for me.

Video device (e.g. /dev/video0) to be used for capturing.

video_device /dev/video0

Since one of the recent RPi Linux versions where KMS became the default on RPi OS and the legacy camera driver has been replaced with libcamera, there are generally some known issues or difficulties wir RPi camera modules.

When installed via dietpi-software, the legacy camera driver should be enabled already. You can verify via dietpi-config.

Could you try to add it as RPi DSI camera in motionEye instead of as V4L2 camera? This works generally work, only with the RPi camera module 3 it seems to not work anymore.