Logitech C270 switches from /dev/video0 to /dev/video1

Camera model
Logitech C270

What is the problem?
Webcam switches randomly from /dev/video0 to /dev/video1

What did you already try to solve it?
reboot Pi several times, tried to edit scripts

Logs (/var/log/webcamd.log, syslog, dmesg, ... no logs, no support)
I am new to Rasberyy, so I dont know how to collect logs

Additional information about your setup (OctoPrint version, OctoPi version, ...)
OctoPrint 1.4.0

Hello forum members,

I am very new to Raspberry and Linux, for that reason, I can not offer logs files as I dont know how to collect the ones which are needed for my problem.

I have installed Octoprint on my Raspberry 3 and connected a Logitech C270 camera to it. Everything worked perfect, but since I upgraded my Octoprint Version to 1.4.0, I can not get the camera working. It randomly switches from /dev/video0 to /dev/video1 and my webcamDaemon script always needs to be the camera on /dev/video0.

Tried to set parameters in octopi.txt like "-d /dev/video1", but also without success.

I would be very happy, if someone with more experience could help me with that problem.

Many thanks and best regards,
Tim

Try clicking on any one of the four links that say "logs" in your post.

There is help in the post editor: Just select the text area you want to format and click </> in the icon bar above the editor area Official Site

Hello foosel,

here is the octoprint logfile and syslog logfile.
I don´h have any webcamd.log file.

Actually my webcam is listed on /dev/video0, but still I can´t get any stream running.

Best regards,
Tim

syslog_octoprint-log.zip (9.3 KB)

It's located at a different place than octoprint.log and friends, /var/log/webcamd.log.

Hi foosel,

I checked that path and there is no webcamd.log.

I have installed averything using that link long time ago:
https://www.paass.net/2018-07-23-octoprint-auf-dem-raspberry-pi-3-teil-2

I am starting the webcam with following commands:
su - octoprint -c "/home/octoprint/scripts/webcam start"

In this path, I also have a file called webcamDaemon.....but no log file also.

Best regards and thanks for your help,
Tim

Hi foosel,

gerade noch mal die Cam von USB getrennt, Pi rebootet und gewartet.
Danach in einen anderen USB-Port als vorher gesteckt und nun läuft der Stream auch.

Die Cam ist unter /dev/video0 erreichbar.

Trotzdem habe ich jetzt die RaspiCam bestellt und werde auf diese umschwenken.

Besten Dank und viele Grüße,
Tim

octofarmInstallEN.pdf.zip (330,3 KB)
octofarmInstallGER.pdf.zip (332,0 KB)

(I call my multiprinter solution not octofarm anymore because there were allready many projects called octofarm and i don't want to be sued.)

point 2.7 and following describes how you can write udev rules which should maybe fix your problem

1 Like

Thank you very much for your help.
As far as I know, the webcam scripts are all configured for /dev/video0 to start.

Do you know, in wehich scripts, I have to change the device name from /dev/video0 to /dev/"symlink-name" to get my mjpeg-streamer to run correctly?

Hey foosel,

sorry for my german reply.....I have no idea, what I was thinking that time! :slight_smile:

That text means, that I have rebooted my Raspberry and suddenly my camera was again available on /dev/video0 and worked then.

Unfortunately, I have the same problem again.
I was thinking about creating symlinks, but I dont know, in which scripts, I have to replace /dev/video0 with the symlink name to get my camera and mjpeg-streamer to work.

Thanks again for your help,
Tim

puh on octopi i have no glue.
Only used octopi just a few times.
but if i remember correctly /etc/rc.d/webcamd or something like that / should be written on the octoprint documentation

On my own rig, the Smoothieboard and the PyBoard change places all the time in the device tree. Creating udev rules (as discussed earlier) is the best way to tackle this "musical chairs" problem.

I have created an udev rule named 90-z-logitech-c270.rules in /etc/udev/rules.d:

Logitech C270 USB Webcam

SUBSYSTEM=="video4linux", SUBSYSTEM=="usb", ATTR{idVendor}=="0x046d", ATTRS{idProdict}=="0x0825", SYMLINK+="video0"

Still no success......the webcam always shows up as /dev/video1

I have rebooted several times and also unplugged and plugged the webcam several times.

Do I have a mistake in the syntax?

Br,
Tim

I would remove

and yes if you use the standard names as videoX and it is already taken it doesn't work.
That's normal and expected.

SUBSYSTEM=="video4linux", SUBSYSTEM=="usb", ATTR{idVendor}=="0x046d", ATTRS{idProdict}=="0x0825", SYMLINK+="video0"
  1. Don't try to create a symlink (alias) for a device which might be actually issued, video0 is something Raspbian would like to control. Instead, use hans or luke or something unique like logitech.
  2. You have mispelled ATTRS above by making it singular, so obviously this won't work.
SUBSYSTEM=="usb", ATTRS{idVendor}=="0x046d", ATTRS{idProdict}=="0x0825", SYMLINK+="logitech"

Once booted, do an ls -lt /dev and look for it near the top as /dev/logitech. Any configuration files would then need to point to this rather than whatever it was before.

yeah or a

sudo udevadm trigger 

to test without reboot

1 Like

What if you don't have that log either?