Webcam not showing

Hi!
So, I've never had the webcam working.

I'm running OctoPrint on a Ubuntu LXC via Proxmox.
My lsusb on the Ubuntu LXC:

Bus 004 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 04f2:b2eb Chicony Electronics Co., Ltd Integrated Camera
Bus 001 Device 004: ID 0a5c:21e6 Broadcom Corp. BCM20702 Bluetooth 4.0 [ThinkPad]
Bus 001 Device 003: ID 147e:2020 Upek TouchChip Fingerprint Coprocessor (WBF advanced mode)
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 003: ID 12d1:4321 Huawei Technologies Co., Ltd. UVC Camera
Bus 002 Device 002: ID 1a86:7523 QinHeng Electronics CH340 serial converter
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I have both the laptops embedded webcam and another USB webcam (which I know works) connected via USB.

When loading the webcam plugin and selecting either webcam from the list, I got an error about v4l2-ctl missing. So I installed that, via:

sudo apt-get install v4l-utils

But now, no cameras are available to select in this list:

How can I get this working? Let me know what other details I need to provide.
Cheers

This is not a standard setup - how did you do it? OctoPrint doesn't do the webcam streaming itself and so you need to also setup some kind of streaming software. If you used a script like octoprint_deploy it has an option to install the webcam streaming as well for example.

Hi Charlie,

Indeed it's not a standard setup... oops.
I followed this: https://asokolsky.github.io/proxmox/octoprint.html
But that seems to not be available. It was the same/similar to: Controlling your 3D Printer with Proxmox – Virtualize Everything
It was a little tricky to get the USB passed through, but got there in the end!

When I was trying to fix this issue I came across octoprint_deploy, so I might give that a go in lieu of getting it sorted as is.
I'll look into the scripts within octoprint_deploy and see if it can give me the details I need.

Yeah, the second guide you linked has no mention of installing the webcam streaming, just OctoPrint and nothing more. That's why it won't work, you need to also install some kind of streaming software. All the options on OctoPrint.org - Download & Setup OctoPrint should have that included.

So! I highly recommend going down the octoprint_deploy route, using a VM, not a LXC. It was so much easier.
Some issues:

  1. complete the installation in one go, don't return to it later after the TTY session has closed.
  2. had some issues with detecting my printer - best to manually select the dev/ & baud rate.
  3. had some issues detecting my camera - needed to do it manually

All worked out in the end, and pretty quick!

1 Like

You just need to set up lxc pass through properly to get it working. You need to pass through ports and permissions. Can you share your current lxc configuration using β€œlxc config show ”

You need to add the video port using something similar to this:


lxc config device add cr6 video0 unix-char source=/dev/video4 path=/dev/video0 required=false gid=44

The source needs to match what you have on the host. Share what you have and I can help you get it working.

I created a shell script to make the port setup process a little easier with prompts and hints of what to use.

FYI, LXC does not work with udev rules, so I do not recommend using it with octoprint_deploy.