Webcam stream doesn't work the other day - mysterious webcam issue

What is the problem?
Yesterday I set up a new Raspberry Pi 3B+ with the recent Octoprint/Octopi image found on the official page and followed the installation guide just as usual (done this before...). After setting everything up and updating/upgrading octopi, Octoprint worked like a charm for ~5 prints and several hours, including a stable webcam stream from my Raspi Cam Rev 1.3 it's this one - Ebay Link.

Today everything worked again until out of a sudden the webcam stream stopped. Now I get image

...in the Octoprint UI and the endpoints (local/webcam/?action=snapshot, /webcam/?action=stream, local:8080), are reachable, but don't show any images (anyways, they don't timeout):

Am I doing something wrong?! As stated above, everything worked stable before!

What did you already try to solve it?
After restarting my system and checking all cable connections several times, I googled a while until i found this forum here. Then I used the search and checked other webcam issues, but it seems like nobody has posted on this issue yet.

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, octoprint.log, serial.log or output on terminal tab, ...)

OctoPrint version: 1.3.8 / OctoPi version: 0.15.0

$ vcgencmd get_camera
supported=1 detected=1
seems OK. :thinking:

$ pkill mjpg-streamer
...and wait for auto restart - no effect. :thinking:

$ systemctl status webcamd

   Loaded: loaded (/etc/init.d/webcamd; generated; vendor preset: enabled)
   Active: active (running) since Sun 2018-05-13 17:38:52 UTC; 6min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 308 ExecStart=/etc/init.d/webcamd start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/webcamd.service
           β”œβ”€390 /bin/bash /root/bin/webcamd
           └─427 ./mjpg_streamer -o output_http.so -w ./www-octopi -n -i input_raspicam.so -x 1296 -y 972 -fps 10 -quality

May 13 17:38:53 octopi mjpg_streamer[427]: MJPG-streamer [427]: resolution........: 1296 x 972
May 13 17:38:53 octopi mjpg_streamer[427]: MJPG-streamer [427]: camera parameters..............:
May 13 17:38:53 octopi mjpg_streamer[427]: MJPG-streamer [427]: www-folder-path......: ./www-octopi/
May 13 17:38:53 octopi mjpg_streamer[427]: MJPG-streamer [427]: HTTP TCP port........: 8080
May 13 17:38:53 octopi mjpg_streamer[427]: MJPG-streamer [427]: HTTP Listen Address..: (null)
May 13 17:38:53 octopi mjpg_streamer[427]: MJPG-streamer [427]: username:password....: disabled
May 13 17:38:53 octopi mjpg_streamer[427]: MJPG-streamer [427]: commands.............: disabled
May 13 17:38:53 octopi mjpg_streamer[427]: MJPG-streamer [427]: starting input plugin input_raspicam.so
May 13 17:38:53 octopi mjpg_streamer[427]: MJPG-streamer [427]: starting output plugin: output_http.so (ID: 00)
May 13 17:38:53 octopi mjpg_streamer[427]: MJPG-streamer [427]: Starting Camera

seems OK. :thinking:

Output of octoprint.log bootup:

2018-05-13 17:38:55,623 - octoprint.startup - INFO - ******************************************************************************
2018-05-13 17:38:55,623 - octoprint.startup - INFO - Starting OctoPrint 1.3.8
2018-05-13 17:38:55,624 - octoprint.startup - INFO - ******************************************************************************
2018-05-13 17:38:56,840 - octoprint.plugin.core - INFO - Loading plugins from /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins, /home/pi/.octoprint/plugins and installed plugin packages...
2018-05-13 17:38:59,073 - octoprint.plugin.core - INFO - Found 10 plugin(s) providing 10 mixin implementations, 4 hook handlers
2018-05-13 17:38:59,273 - octoprint.server.heartbeat - INFO - Starting server heartbeat, 900.0s interval
2018-05-13 17:38:59,318 - octoprint.server - INFO - Intermediary server started
2018-05-13 17:38:59,320 - octoprint.plugin.core - INFO - Loading plugins from /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins, /home/pi/.octoprint/plugins and installed plugin packages...
2018-05-13 17:38:59,858 - octoprint.plugin.core - INFO - Found 10 plugin(s) providing 10 mixin implementations, 4 hook handlers
2018-05-13 17:38:59,896 - octoprint.filemanager.storage - INFO - Initializing the file metadata for /home/pi/.octoprint/uploads...
2018-05-13 17:39:00,570 - octoprint.filemanager.storage - INFO - ... file metadata for /home/pi/.octoprint/uploads initialized successfully.
2018-05-13 17:39:00,634 - octoprint.plugins.softwareupdate - INFO - Loaded version cache from disk
2018-05-13 17:39:02,657 - octoprint.util.pip - INFO - Using "/home/pi/oprint/bin/python2 -m pip" as command to invoke pip
2018-05-13 17:39:04,068 - octoprint.util.pip - INFO - Version of pip is 10.0.1
2018-05-13 17:39:04,069 - octoprint.util.pip - INFO - pip installs to /home/pi/oprint/lib/python2.7/site-packages (writable -> yes), --user flag needed -> no, virtual env -> yes
2018-05-13 17:39:04,069 - octoprint.util.pip - INFO - ==> pip ok -> yes
2018-05-13 17:39:04,072 - octoprint.plugin.core - INFO - Initialized 10 plugin implementation(s)
2018-05-13 17:39:04,078 - octoprint.plugin.core - INFO - 10 plugin(s) registered with the system:
|  Announcement Plugin (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/announcements
|  Core Wizard (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/corewizard
|  CuraEngine (<= 15.04) (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/cura
|  Discovery (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/discovery
|  Logging (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/logging
|  OctoPi Support Plugin (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/octopi_support
|  Plugin Manager (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/pluginmanager
|  Printer Safety Check (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/printer_safety_check
|  Software Update (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/softwareupdate
|  Virtual Printer (bundled) = /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/virtual_printer
2018-05-13 17:39:04,097 - octoprint.environment - INFO - Detected environment is Python 2.7.13 under Linux (linux2). Details:
|  hardware:
|    cores: 4
|    freq: 1400.0
|    ram: 918192128
|  os:
|    id: linux
|    platform: linux2
|  plugins:
|    octopi_support:
|      model: unknown
|      revision: a020d3
|      version: 0.15.0
|  python:
|    pip: 10.0.1
|    version: 2.7.13
|    virtualenv: /home/pi/oprint
2018-05-13 17:39:04,106 - octoprint.server - INFO - Reset webasset folder /home/pi/.octoprint/generated/webassets...
2018-05-13 17:39:04,120 - octoprint.server - INFO - Reset webasset folder /home/pi/.octoprint/generated/.webassets-cache...
2018-05-13 17:39:04,407 - octoprint.server - INFO - Shutting down intermediary server...
2018-05-13 17:39:04,583 - octoprint.server - INFO - Intermediary server shut down
2018-05-13 17:39:04,587 - octoprint.events - INFO - Processing startup event, this is our first event
2018-05-13 17:39:04,588 - octoprint.events - INFO - Adding 0 events to queue that were held back before startup event
2018-05-13 17:39:04,591 - octoprint.filemanager - INFO - Adding backlog items from all storage types to analysis queue...
2018-05-13 17:39:04,621 - octoprint.filemanager - INFO - Added 0 items from storage type "local" to analysis queue
2018-05-13 17:39:04,734 - octoprint.plugins.discovery - INFO - Registered OctoPrint instance on octopi for _http._tcp
2018-05-13 17:39:04,744 - octoprint.plugins.discovery - INFO - Registered OctoPrint instance on octopi for _octoprint._tcp
2018-05-13 17:39:04,747 - octoprint.plugins.discovery - INFO - Registered OctoPrint instance on octopi for SSDP
2018-05-13 17:39:04,749 - octoprint.server - INFO - Listening on http://127.0.0.1:5000
2018-05-13 17:39:04,854 - octoprint.plugins.pluginmanager - INFO - Loaded plugin repository data from disk, was still valid
2018-05-13 17:39:04,884 - octoprint.util.connectivity_checker - INFO - Connectivity changed from offline to online
2018-05-13 17:39:05,001 - octoprint.plugins.pluginmanager - INFO - Loaded plugin repository data from disk, was still valid
2018-05-13 17:39:05,172 - octoprint.server.preemptive_cache - INFO - Preemptively caching / (ui _default) for {'query_string': 'l10n=de', 'path': '/', 'base_url': 'http://octopi.fritz.box/'}
2018-05-13 17:39:05,642 - octoprint.plugins.pluginmanager - INFO - Loaded notice data from disk, was still valid
2018-05-13 17:39:05,780 - octoprint.plugins.pluginmanager - INFO - Loaded notice data from disk, was still valid
2018-05-13 17:39:07,029 - octoprint.server.util.sockjs - INFO - New connection from client: 2001:16b8:20d7:dd00:287d:3a03:7810:cec7
2018-05-13 17:39:16,374 - octoprint.server.preemptive_cache - INFO - ... done in 11.20s
2018-05-13 17:39:16,374 - octoprint.server.preemptive_cache - INFO - Preemptively caching / (ui _default) for {'query_string': 'l10n=de', 'path': '/', 'base_url': 'http://192.168.188.34/'}
2018-05-13 17:39:20,513 - tornado.access - WARNING - 403 GET /plugin/announcements/channels (127.0.0.1) 11.71ms
2018-05-13 17:39:20,961 - tornado.access - WARNING - 403 GET /api/languages (127.0.0.1) 10.82ms
2018-05-13 17:39:21,000 - octoprint.server.preemptive_cache - INFO - ... done in 4.63s
2018-05-13 17:39:21,363 - tornado.access - WARNING - 403 GET /plugin/logging/ (127.0.0.1) 21.09ms

seems OK. :thinking:

Any help with this is greatly appreciated! Thank you!

p. s. I didn't try yet if this issue is reproducable with another fresh image / happens with another SD / another Raspi Cam.

Just curious... did you change the octopi's hostname from octopi.local to octopi.fritz.box?

You tried http://octopi.local:8080/?action=stream as well?

Also, did you check that the camera works on another RPi? It may have simply died. Depending on where you put it, the heat can get to them if they aren't enclosed (doesn't happen a lot, but they DO have operating ranges, and the top end is usually 85C unless you buy higher rated components, so if it was right by a stepper that gets hot or on a hot bed or near an extruder, it may have overheated).

Hi, no, I didn't cange the hostname (which is default 'octopi'). I can type octopi.local, octopi.fritz.box or the fixed IP my FritzBox router assigns to the Raspberry and will allways reach the Octoprint UI (these names are aliases for the IP). I don't think this is causing my issue.

Yep, it is the same here: Page keeps loading, no timeout, no image.
image

Unfortunately I'm missing a cable to connect my cam to a Raspi Zero W. Already ordered. So the answer to your question is: No, I didn't try if the camera(s) work on another pi. Anyways I checked with another camera now and it is exactly the same issue.

By the way, I think the camera hasn't died or any other hardware issue... The LED is working and as you can see from my information above, it seems like the camera was recognized correctly by the Raspi.
In the picture you can see my setup - the unit is not at all close to any source of heat or anything else that could have damaged the camera...

Okay, it worked... and then it stopped working. Assuming nothing was updated in between those two events and you didn't make any configuration changes to make audio work:

  1. We can probably rule out the drivers and editing things in /boot/config.txt for example
  2. We can probably rule out going into sudo raspi-config and toggling anything on or off

It seems unlikely that the camera just chose to die then. The most likely thing in this case would be the two ends of the cable. I think I would reconnect them to make sure and reboot.

The second likeliest thing might be something odd like the-microSD-is-almost-full.

Yes, I digged through these files/menus you mention, but I didn't change anything in between for audio (I didn't even know there was audio at all until now :-D). Will try it with a new image / new SD and see if the error occurs again.

Update 11/2018: Finally it turned out that the small ribbon cable connector on the camera board was disconnected. lol. Check this link for detailed error description and photos.