Pi Camera Webcam Thing Something Something Fix

Pi Camera Webcam Thing Something Something Fix

f4mi

Recent Raspberry Pi OS releases rely on systemd to manage startup services.

The old method—adding commands to /etc/rc.local—is no longer fully supported, so we are going to create a dedicated systemd service instead.

Create the Gadget Script

nano ~/rpi-uvc-gadget.sh

Paste the long “UVC gadget” script from the original tutorial or blog post in it and then save the file, Then, make it executable and move it:

sudo chmod +x ~/rpi-uvc-gadget.sh
sudo mv ~/rpi-uvc-gadget.sh /usr/local/bin/rpi-uvc-gadget.sh

Create a Systemd Service

sudo nano /etc/systemd/system/uvc-gadget.service

Paste this inside:

Description=UVC Gadget Setup Service
After=sys-kernel-config.mount
Requires=sys-kernel-config.mount

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/local/bin/rpi-uvc-gadget.sh

[Install]
WantedBy=multi-user.target
Enable & start:sudo systemctl daemon-reload
sudo systemctl enable uvc-gadget.service
sudo systemctl start uvc-gadget.service

(Check if it works using systemctl status uvc-gadget.service.)

Reboot aaand test

sudo reboot
  1. Plug the Pi (via its data USB port) into your computer.
  2. Open a camera app and select “UVC Gadget” or whatever you named your webcam as in the script following the steps in the official guide as your webcam.

That’s it! You have a webcam now. Hopefully. I am not responsible from any fires anyway.

From great power come great Omegle responsibilities.

Have fun!

Report Page