Camera stops working after canceling print job

Camera model Logitech 1080p Pro Stream Webcam

What is the problem?
I upgraded my raspberry pi to the new Octopi 17 (and python 3)
When I canceled a print job there was an error in Octoprint indicating an error with the timelapse

What did you already try to solve it?
Rebooting the raspberry pi solves it but I've had it fail with the camera during prints at various times. I never had this issue with the older octopi 14 and python 2.

Logs (/var/log/webcamd.log, syslog, dmesg, ... no logs, no support)
Here are some of the log info:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/timelapse.py", line 644, in _perform_capture
    verify=self._snapshot_validate_ssl)
  File "/home/pi/oprint/lib/python3.7/site-packages/requests/api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/requests/sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/requests/sessions.py", line 643, in send
    r = adapter.send(request, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/requests/adapters.py", line 529, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPConnectionPool(host='127.0.0.1', port=8080): Read timed out. (read timeout=5)
2020-09-16 20:03:22,280 - octoprint.timelapse - ERROR - Could not capture image /home/pi/.octoprint/timelapse/tmp/LTAZ6_RetractionTest_LargeRetraction_20200916200046-0.jpg from http://127.0.0.1:8080/?action=snapshot
Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/urllib3/connectionpool.py", line 426, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/home/pi/oprint/lib/python3.7/site-packages/urllib3/connectionpool.py", line 421, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/lib/python3.7/http/client.py", line 1336, in getresponse
    response.begin()
  File "/usr/lib/python3.7/http/client.py", line 306, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.7/http/client.py", line 267, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/lib/python3.7/socket.py", line 589, in readinto
    return self._sock.recv_into(b)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/home/pi/oprint/lib/python3.7/site-packages/urllib3/connectionpool.py", line 727, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/home/pi/oprint/lib/python3.7/site-packages/urllib3/util/retry.py", line 403, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/home/pi/oprint/lib/python3.7/site-packages/urllib3/packages/six.py", line 735, in reraise
    raise value
  File "/home/pi/oprint/lib/python3.7/site-packages/urllib3/connectionpool.py", line 677, in urlopen
    chunked=chunked,
  File "/home/pi/oprint/lib/python3.7/site-packages/urllib3/connectionpool.py", line 428, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
  File "/home/pi/oprint/lib/python3.7/site-packages/urllib3/connectionpool.py", line 336, in _raise_timeout
    self, url, "Read timed out. (read timeout=%s)" % timeout_value
urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='127.0.0.1', port=8080): Read timed out. (read timeout=5)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/timelapse.py", line 644, in _perform_capture
    verify=self._snapshot_validate_ssl)
  File "/home/pi/oprint/lib/python3.7/site-packages/requests/api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/requests/sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/requests/sessions.py", line 643, in send
    r = adapter.send(request, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/requests/adapters.py", line 529, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPConnectionPool(host='127.0.0.1', port=8080): Read timed out. (read timeout=5)
2020-09-16 20:04:28,741 - octoprint.timelapse - ERROR - Could not capture image /home/pi/.octoprint/timelapse/tmp/LTAZ6_RetractionTest_LargeRetraction_20200916200046-0.jpg from http://127.0.0.1:8080/?action=snapshot
Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/urllib3/connectionpool.py", line 426, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/home/pi/oprint/lib/python3.7/site-packages/urllib3/connectionpool.py", line 421, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/lib/python3.7/http/client.py", line 1336, in getresponse
    response.begin()
  File "/usr/lib/python3.7/http/client.py", line 306, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.7/http/client.py", line 267, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/lib/python3.7/socket.py", line 589, in readinto
    return self._sock.recv_into(b)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/home/pi/oprint/lib/python3.7/site-packages/urllib3/connectionpool.py", line 727, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/home/pi/oprint/lib/python3.7/site-packages/urllib3/util/retry.py", line 403, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/home/pi/oprint/lib/python3.7/site-packages/urllib3/packages/six.py", line 735, in reraise
    raise value
  File "/home/pi/oprint/lib/python3.7/site-packages/urllib3/connectionpool.py", line 677, in urlopen
    chunked=chunked,
  File "/home/pi/oprint/lib/python3.7/site-packages/urllib3/connectionpool.py", line 428, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
  File "/home/pi/oprint/lib/python3.7/site-packages/urllib3/connectionpool.py", line 336, in _raise_timeout
    self, url, "Read timed out. (read timeout=%s)" % timeout_value
urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='127.0.0.1', port=8080): Read timed out. (read timeout=5)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/timelapse.py", line 644, in _perform_capture
    verify=self._snapshot_validate_ssl)
  File "/home/pi/oprint/lib/python3.7/site-packages/requests/api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/requests/sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/requests/sessions.py", line 643, in send
    r = adapter.send(request, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/requests/adapters.py", line 529, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPConnectionPool(host='127.0.0.1', port=8080): Read timed out. (read timeout=5)
2020-09-16 20:05:06,738 - octoprint.server.util.sockjs - INFO - Client connection closed: ::ffff:192.168.1.6
2020-09-16 20:05:49,469 - octoprint.server.util.flask - INFO - Passively logging in user pldugan from ::ffff:192.168.1.2
2020-09-16 20:05:49,471 - octoprint.access.users - INFO - Logged in user: pldugan
2020-09-16 20:05:49,637 - octoprint.server.util.sockjs - INFO - Client connection closed: ::ffff:192.168.1.2
2020-09-16 20:05:53,671 - octoprint.server.util.sockjs - INFO - New connection from client: ::ffff:192.168.1.6
2020-09-16 20:05:54,352 - octoprint.server.util.flask - INFO - Passively logging in user pldugan from ::ffff:192.168.1.6
2020-09-16 20:05:54,353 - octoprint.access.users - INFO - Logged in user: pldugan
2020-09-16 20:05:55,509 - octoprint.server.util.sockjs - INFO - New connection from client: ::ffff:192.168.1.2
2020-09-16 20:05:55,523 - octoprint.server.util.sockjs - INFO - User pldugan logged in on the socket from client ::ffff:192.168.1.6
2020-09-16 20:05:55,635 - octoprint.server.util.flask - INFO - Passively logging in user pldugan from ::ffff:192.168.1.2
2020-09-16 20:05:55,636 - octoprint.access.users - INFO - Logged in user: pldugan
2020-09-16 20:05:57,200 - octoprint.server.util.sockjs - INFO - User pldugan logged in on the socket from client ::ffff:192.168.1.2
2020-09-16 20:06:48,631 - octoprint.server.util.sockjs - INFO - Client connection closed: ::ffff:192.168.1.2
2020-09-16 20:10:32,377 - octoprint.server.heartbeat - INFO - Server heartbeat <3
2020-09-16 20:10:44,348 - octoprint.plugins.tracking - INFO - Sent tracking event ping, payload: {'octoprint_uptime': 8112}
2020-09-16 20:12:36,723 - octoprint.server.util.sockjs - INFO - Client connection closed: ::ffff:192.168.1.6
2020-09-16 20:25:32,378 - octoprint.server.heartbeat - INFO - Server heartbeat <3
2020-09-16 20:25:44,351 - octoprint.plugins.tracking - INFO - Sent tracking event ping, payload: {'octoprint_uptime': 9012}
2020-09-16 20:32:17,037 - octoprint.timelapse - ERROR - Could not capture image /home/pi/.octoprint/timelapse/tmp/LTAZ6_RetractionTest_LargeRetraction_20200916200046-0.jpg from http://127.0.0.1:8080/?action=snapshot
Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/urllib3/connectionpool.py", line 426, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/home/pi/oprint/lib/python3.7/site-packages/urllib3/connectionpool.py", line 421, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/lib/python3.7/http/client.py", line 1336, in getresponse
    response.begin()
  File "/usr/lib/python3.7/http/client.py", line 306, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.7/http/client.py", line 267, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/lib/python3.7/socket.py", line 589, in readinto
    return self._sock.recv_into(b)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/home/pi/oprint/lib/python3.7/site-packages/urllib3/connectionpool.py", line 727, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/home/pi/oprint/lib/python3.7/site-packages/urllib3/util/retry.py", line 403, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/home/pi/oprint/lib/python3.7/site-packages/urllib3/packages/six.py", line 735, in reraise
    raise value
  File "/home/pi/oprint/lib/python3.7/site-packages/urllib3/connectionpool.py", line 677, in urlopen
    chunked=chunked,
  File "/home/pi/oprint/lib/python3.7/site-packages/urllib3/connectionpool.py", line 428, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
  File "/home/pi/oprint/lib/python3.7/site-packages/urllib3/connectionpool.py", line 336, in _raise_timeout
    self, url, "Read timed out. (read timeout=%s)" % timeout_value
urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='127.0.0.1', port=8080): Read timed out. (read timeout=5)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/timelapse.py", line 644, in _perform_capture
    verify=self._snapshot_validate_ssl)
  File "/home/pi/oprint/lib/python3.7/site-packages/requests/api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/requests/sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/requests/sessions.py", line 643, in send
    r = adapter.send(request, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/requests/adapters.py", line 529, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPConnectionPool(host='127.0.0.1', port=8080): Read timed out. (read timeout=5)
2020-09-16 20:36:57,500 - octoprint.server.util.flask - INFO - Passively logging in user pldugan from ::ffff:192.168.1.2
2020-09-16 20:36:57,501 - octoprint.access.users - INFO - Logged in user: pldugan
2020-09-16 20:37:01,489 - octoprint.server.util.sockjs - INFO - New connection from client: ::ffff:192.168.1.2
2020-09-16 20:37:01,584 - octoprint.server.util.flask - INFO - Passively logging in user pldugan from ::ffff:192.168.1.2
2020-09-16 20:37:01,585 - octoprint.access.users - INFO - Logged in user: pldugan
2020-09-16 20:37:03,095 - octoprint.server.util.sockjs - INFO - User pldugan logged in on the socket from client ::ffff:192.168.1.2

Additional information about your setup (OctoPrint version, OctoPi version, ...)
Octoprint 14.2 & OctoPi 17 Python 3octoprint.log (565.2 KB)

Does it work when the print finishes?

No. The led light goes out and does not come back on. After rebooting light comes back on and I can view the scene.

I don't see a real reason why that happens.

One thing that could affect the usb connection to your camera is inconsistent power.
I would try this, it doesn't take long and you can't do anything wrong.

I will give that a try. I never had any issues like this with the previous version of Octopi (14.0) I've got a separate micro sd with my older Octopi/Octoprint so I can always fall back to that if I can't resolve this but I would rather move forward. The instructions don't make it clear which USB plug should be modified. I assume this would be the usb to the camera from the raspberry pi.

Modified the USB cable to the camera simply made the camera not work at all. I guess I will try the cable to the printer next.

Doing the same thing to the printer cable made it unable to be connected.

I guess the logs provided no clues to the reason.

Yeah the printers usb cable.
Meh some printers need the 5V line for the connection :confused:

let's see if there is anything in your webcamd.log (click here logs)

I'm not sure how to copy that file to my PC. I can't see it under the logging listing and there is a description for it being at: /var/log/webcamd.log ( I can't even find that folder anywhere )
I can use Putty from my PC to get to a command line for the raspberry. How does one go about getting that to the PC?

Use WinSCP
it's like a file browser for ssh.


This is a screen capture of the folder on the pi. I do not see a webcamd.log.
Is there some setting I need to change to enable the webcam logging?

Well no answers. I guess its back to the older version that worked correctly.