Setting up multiple webcams in OctoPi the right way

Thank u! This is exactly as I was looking for! You're the man!

Hey, great guide!

Disclaimer: im a total noob with raspberry..

HW: Raspberry pi4 4gb ram, with 3A powersuply.

I tried it to get my octoprint working with 2 usb camera's
Camera #1: WebcamJPL Vision mini (stole it from gf after working from home was over)
Camera #2: Endoscope camera that it got from aliexpress a year ago

Tested both camera's on my mac and they work.

In Octoprint however the webcam works fine after putting octopi.txt to usb and removing the10fps part.

The enscope camera doesn't seem to work at all. I even get the " The webcam server is currently not running" screen.

lsusb with both cam's connected:

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 007: ID 0c45:636b Microdia
Bus 001 Device 003: ID 2c99:0002
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

lsusb with no cam's connected:

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 2c99:0002
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

lsusb with only webcam connected:

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 006: ID 0c45:636b Microdia
Bus 001 Device 003: ID 2c99:0002
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

lsusb with only endoscope cam connected:

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 2c99:0002
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

The ls /dev/v4l/by-id command gives me this:

pi@octopi:/boot $ ls /dev/v4l/by-id
usb-JPL_Vision_Mini_JPL_Vision_Mini_JPL_Vision_Mini-video-index0
usb-JPL_Vision_Mini_JPL_Vision_Mini_JPL_Vision_Mini-video-index1

So as far as i can see my endoscope camera is not getting recognized, the powersuply should strong enough.

Device paths:

pi@octopi:/boot $ v4l2-ctl --list-devices
bcm2835-codec-decode (platform:bcm2835-codec):
        /dev/video10
        /dev/video11
        /dev/video12

bcm2835-isp (platform:bcm2835-isp):
        /dev/video13
        /dev/video14
        /dev/video15
        /dev/video16

JPL Vision Mini: JPL Vision Min (usb-0000:01:00.0-1.3):
        /dev/video1
        /dev/video2

Cannot open device /dev/video0, exiting.

So i have no idea if this is the info you guys need to see or if i can give more information.
But any help is welcome.

EDIT: new generic endoscope (looks the same) solved the problem.. It's working now.

From the command outputs you've shown the endoscope isn't recognized. Perhaps it requires a specific driver to be used under linux. Also, another thing to see whether, or rather how the endoscope camera is recognized would be to unplug it, run dmesg -w, plug it in, and then pasting the output. You can then exit dmesg by pressing ctrl+c.

Thanks for your help, i thought the same, but I am new to raspberry and have no idea how the drivers work.

I didnt see anything happening if i put the endoscope camera in so i asume THIS is what you wanted to see?

Actually I made a typo in the command I've given you, it should have been dmesg -W (uppercase W instead of lowercase), could you retry with this command, and post the output here? With the output you've given it's hard to find out what happens, sorry to make you do this twice...

No you had it right the first time, -W doesnt work and -h tells me -w is follow. when i plug my endoscope in it doesnt do anything. With my webcam it is giving me information I expected.
edit:
I ordered an other endoscoop camera, to see if that one works.

distribution differences, I'm used to Fedora, not Raspberry Pi OS or Debian...

i feel completely useless ATM for the life of me i can not find the http options is it just an add in on orginal script?

@Charlie_Powell wrote

You may try:

/webcam/?action=stream

No http or else, just that line.

Not sure if I understand the question - are you looking for the camera_http_options configuration?

yes, it doesnt seem to be in the /boot/octopi.conf.d/webcam2.txt

Did you delete it? It would have been in the original file. Presumably all the rest of the lines are there?

You can add it back as shown.

no never deleted it just isnt there I tried adding it back in under the camera usb option but this is what my config file looks like

Have you scrolled any further down in the file?

talk about a huge facepalm oof thank you, sorry for bothering you. Ive been trying to code a pokedex for my boy and must have read to many lines of code to remember to hit page down.

1 Like

I am using Octopi v0.18.

After following the instructions for setting up a raspicam and a usb cam,

  • The default /webcam stream cant work.
  • 8081 port meant for usb: becomes raspicam. I am able to see snapshot but not a video stream.
  • UsbCam (Some cheap webcam) meant for 8081 port cant be found. I tried lsusb and it could detect my usbcam.

I've read some comments above and a few of us has this issue too but I couldnt find any solutions for this. Does anyone have any solutions for this or must I be using a better usb webcam?

Hello, I have raspi and usb camera (logi 930) and I'm getting this in my messeges when I restart webcamd:

Nov 18 16:44:35 octopi root: Starting USB webcam
Nov 18 16:44:35 octopi MJPG-streamer [1060]: starting application
Nov 18 16:44:35 octopi MJPG-streamer [1060]: MJPG Streamer Version: git rev: 501f6362c5afddcfb41055f97ae484252c85c912
Nov 18 16:44:35 octopi MJPG-streamer [1060]: Using V4L2 device.: /dev/video0
Nov 18 16:44:35 octopi MJPG-streamer [1060]: Desired Resolution: 640 x 480
Nov 18 16:44:35 octopi MJPG-streamer [1060]: Frames Per Second.: 10
Nov 18 16:44:35 octopi MJPG-streamer [1060]: Format............: JPEG
Nov 18 16:44:35 octopi MJPG-streamer [1060]: TV-Norm...........: DEFAULT
Nov 18 16:44:35 octopi MJPG-streamer [1060]: www-folder-path......: ./www-octopi/
Nov 18 16:44:35 octopi MJPG-streamer [1060]: HTTP TCP port........: 8080
Nov 18 16:44:35 octopi MJPG-streamer [1060]: HTTP Listen Address..: (null)
Nov 18 16:44:35 octopi MJPG-streamer [1060]: username:password....: disabled
Nov 18 16:44:35 octopi MJPG-streamer [1060]: commands.............: disabled
Nov 18 16:44:35 octopi MJPG-streamer [1060]: starting input plugin input_uvc.so
Nov 18 16:44:35 octopi MJPG-streamer [1060]: starting output plugin: output_http.so (ID: 00)
Nov 18 16:44:36 octopi root: Starting USB webcam
Nov 18 16:44:36 octopi MJPG-streamer [1077]: starting application
Nov 18 16:44:36 octopi MJPG-streamer [1077]: MJPG Streamer Version: git rev: 501f6362c5afddcfb41055f97ae484252c85c912
Nov 18 16:44:36 octopi MJPG-streamer [1077]: Using V4L2 device.: /dev/video1
Nov 18 16:44:36 octopi MJPG-streamer [1077]: Desired Resolution: 640 x 480
Nov 18 16:44:36 octopi MJPG-streamer [1077]: Frames Per Second.: 10
Nov 18 16:44:36 octopi MJPG-streamer [1077]: Format............: JPEG
Nov 18 16:44:36 octopi MJPG-streamer [1077]: TV-Norm...........: DEFAULT
Nov 18 16:44:36 octopi MJPG-streamer [1077]: www-folder-path......: ./www-octopi/
Nov 18 16:44:36 octopi MJPG-streamer [1077]: HTTP TCP port........: 8080
Nov 18 16:44:36 octopi MJPG-streamer [1077]: HTTP Listen Address..: (null)
Nov 18 16:44:36 octopi MJPG-streamer [1077]: username:password....: disabled
Nov 18 16:44:36 octopi MJPG-streamer [1077]: commands.............: disabled
Nov 18 16:44:36 octopi MJPG-streamer [1077]: starting input plugin input_uvc.so
Nov 18 16:44:36 octopi MJPG-streamer [1077]: starting output plugin: output_http.so (ID: 00)
Nov 18 16:44:36 octopi MJPG-streamer [1077]: server_thread(): bind(8080) failed

I never get both ports listening (8080 and 8081)

Configs:

camera=raspi
camera_raspi_options="-ev 0 -x 640 -y 480 -fps 30 -awb off --awbgainR 0.95 --awbgainB 1.2 -ex -quality 80 -sa 20 -drc low"
camera_http_options="-n -p 8080"
camera=usb
camera_usb_options="-r 1920x1080 -f 25 -q 95
camera_http_options="-n -p 8081"

Any pointers maybe?

It doesn't look like it's picking up the config for either of your configuration files. Are you able to post the full file from /var/log/webcamd.log?

Hi Charlie, thanks....mmm there is no webcamd.log:

root@octopi:~# ls -la /var/log/webcamd*
ls: cannot access '/var/log/webcamd*': No such file or directory

I noticed that whatever I do it always defaults to raspi cam even if I use camera=usb in the /boot/octopi.txt
EDIT: sorry this last thing is not true....I'm a bit confused already with all the alterations and various attemmpts...
Both cams work on their own...

Have you tried putting quotes around it like camera="usb" or camera="raspi"?