Motion tries to use the old v4l2 camera interface, but Raspberry Pi OS Bookworm uses the libcamera interface.
You can get around that by starting motion with libcamerify which adds a translation layer to the interface.
Just put "libcamerify" in front of your motion command, like this:and motion should work.
You may need to install libcamera-tools with apt to get the libcamerify command.
If you have motion running as a service, you can add libcamerify to the service file. Copy /usr/lib/systemd/system/motion.service to /etc/systemd/system/motion.service and edit the ExecStart line like thisAs you're using a NoIR camera (the same as me), you'll also need to tell it to use the NoIR turning file using an environment variable.
Here's my full /etc/systemd/system/motion.conf which works for me on a Pi 2B and a 3A+, both with the NoIR V2 cameras.Incidentally, there is no "+" version of the Pi 2B.
You can get around that by starting motion with libcamerify which adds a translation layer to the interface.
Just put "libcamerify" in front of your motion command, like this:
Code:
rpdom@cam1:~ $ libcamerify motionYou may need to install libcamera-tools with apt to get the libcamerify command.
If you have motion running as a service, you can add libcamerify to the service file. Copy /usr/lib/systemd/system/motion.service to /etc/systemd/system/motion.service and edit the ExecStart line like this
Code:
ExecStart=/usr/bin/libcamerify /usr/bin/motionHere's my full /etc/systemd/system/motion.conf which works for me on a Pi 2B and a 3A+, both with the NoIR V2 cameras.
Code:
[Unit]Description=Motion detection video capture daemonDocumentation=man:motion(1)[Service]Type=simpleUser=motionEnvironment="LIBCAMERA_RPI_TUNING_FILE=/usr/share/libcamera/ipa/rpi/vc4/imx219_noir.json"ExecStart=/usr/bin/libcamerify /usr/bin/motion[Install]WantedBy=multi-user.targetStatistics: Posted by rpdom — Fri Mar 28, 2025 9:54 am