Crowsnest is the Mainsail-crew webcam service (it replaces the old webcamd / mjpg-streamer). It streams with ustreamer, and Mainsail reads it at /webcam/.
cd ~ && git clone https://github.com/dw-0/kiauh.git # skip if you already have it ./kiauh/kiauh.sh
ls ~/crowsnest before installing it again.sudo apt install v4l-utils # if v4l2-ctl is missing v4l2-ctl --list-devices ls -l /dev/v4l/by-id/
The C270 shows up as something like usb-046d_0825_XXXXXXXX-video-index0. Use the by-id path ending in -video-index0, because /dev/video0 can change between reboots. You can also check what the camera supports with v4l2-ctl -d /dev/video0 --list-formats-ext.
In Mainsail open Machine → crowsnest.conf, or run nano ~/printer_data/config/crowsnest.conf:
[cam 1] mode: ustreamer enable_rtsp: false rtsp_port: 8554 port: 8080 device: /dev/v4l/by-id/usb-046d_0825_XXXXXXXX-video-index0 # your real path resolution: 1280x720 # or 640x480 for smoother, lighter streaming max_fps: 15 # the C270 does ~30 fps at 640x480, less at 720p # custom_flags: --allow-broken-frames # v4l2ctl: power_line_frequency=2 # 2 = 60 Hz (US); stops flicker
sudo systemctl restart crowsnest systemctl status crowsnest cat ~/printer_data/logs/crowsnest.log
Or restart it in Mainsail from the power/services menu: crowsnest → Restart.
C270/webcam/?action=stream/webcam/?action=snapshotTo test it directly, open http://<printer-ip>/webcam/?action=stream in a browser.
| Problem | Fix |
|---|---|
| Camera not detected / drops out | Use a different USB port (preferably directly on the Pi/CB1, not a hub), try a shorter cable, and check dmesg | tail for under-voltage or USB resets. Weak power supplies often cause this. |
| Low FPS / laggy | Lower to 640x480 and/or max_fps: 15. The C270 is USB 2.0 and slows down in low light, so add more light. Use the Adaptive MJPEG service in Mainsail. |
| Black or no stream | Check the device: path, then check crowsnest.log. Make sure no other webcam service (webcamd/mjpg-streamer) is using port 8080. |
| Flicker / banding | v4l2ctl: power_line_frequency=2 (60 Hz) |
| Crowsnest missing from Update Manager | Add the entry below to moonraker.conf, then restart Moonraker. |
[update_manager crowsnest] type: git_repo path: ~/crowsnest origin: https://github.com/mainsail-crew/crowsnest.git managed_services: crowsnest install_script: tools/pkglist.sh
Also make sure ~/printer_data/moonraker.asvc contains a crowsnest line so Moonraker can restart the service.