How to use the camera module on a Raspberry Pi 3 running Fedora 29?
Pretty simple. Upgrade the system.
Enable the camera module by adding this line in
/boot/efi/config.txt, then reboot.
Once rebooted, load this module
sudo modprobe bcm2835-v4l2
Check if the device is in place.
ls -l /dev/video*
You can load the module at boot time (need improvement)
echo bcm2835-v4l2 > /etc/modules-load.d/bcm2835-v4l2.conf
Include your user in the video group, in order to avoid root or sudo
usermod -a -G video $USER
Let’s install some software (please note: there are a lot of dependencies here)
dnf install gstreamer1 gstreamer1-plugins-good v4l-utils fswebcam
In order to test the camera, we can take a picture with fswebcam
fswebcam -d /dev/video0 -r 640x480 --jpeg 85 test.jpg
In order to test streaming, we can use gstreamer
On the Raspberry Pi
gst-launch-1.0 -v v4l2src ! \ "image/jpeg,width=320,height=240,framerate=30/1" ! \ rtpjpegpay ! \ udpsink host=DST_IP port=5002
And on your PC (the DST_IP)
gst-launch-1.0 -e -v udpsrc port=5002 ! \ application/x-rtp, encoding-name=JPEG, payload=26 ! \ rtpjpegdepay ! \ jpegdec ! \ autovideosink
Last note: I didn’t use an official RPi camera, but a camera bought for less than 10 euros on a famous e-commerce web site. However also the official camera was reported to work.