Could not retrieve snapshot URL, camera configuration not possible

Camera model
Original Raspberry Pi NOIR Camera Module V2

What is the problem?
I am not able to configure the webcam in the setup wizzard. Neither the stream nor the snapshot URL are working.

The error message:
Could not retrieve snapshot URL, please double check the URL

What did you already try to solve it?
I uninstalled Octopi and reinstalled it, but I always get the same error messages.
I've installed Octopi with this guide manually: Setting up OctoPrint on a Raspberry Pi running Raspbian or Raspberry Pi OS

Furthermore, I've various URLs, e.g.:

  • IP:PORT/webcam/?action=snap
  • IP:PORT/webcam/?action=snapshot
  • IP:PORT/webcam/action=snap
  • IP:PORT/webcam/action=snapshot
  • IP:PORT/webcam/
  • /webcam
  • /webcam/action=snap
  • ...

Logs (/var/log/webcamd.log, syslog, dmesg, ... no logs, no support)

2021-12-26 16:48:52,975 - octoprint.server.api - ERROR - Error while running a test GET request on IP:PORT/webcam/?action=snap
Traceback (most recent call last):
  File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/octoprint/server/api/__init__.py", line 634, in _test_url
    with requests.request(
  File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/requests/sessions.py", line 649, in send
    adapter = self.get_adapter(url=request.url)
  File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/requests/sessions.py", line 742, in get_adapter
    raise InvalidSchema("No connection adapters were found for {!r}".format(url))
requests.exceptions.InvalidSchema: No connection adapters were found for 'IP:PORT/webcam/?action=snap'

Error with http://...

Traceback (most recent call last):
  File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/octoprint/server/api/__init__.py", line 634, in _test_url
    with requests.request(
  File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/requests/adapters.py", line 529, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPConnectionPool(host='IP', port=PORT): Read timed out. (read timeout=5.0)

Traceback (most recent call last):
  File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/octoprint/server/api/__init__.py", line 634, in _test_url
    with requests.request(
  File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/home/pi/OctoPrint/venv/lib/python3.9/site-packages/requests/adapters.py", line 529, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPConnectionPool(host='IP', port=PORT): Read timed out. (read timeout=5.0)

Additional information about your setup (OctoPrint version, OctoPi version, ...)
I've installed Octopi with the official guide for manual installation.

Thank you in advance for any help.

Do any of these URLs work from your browser?

Presumably you have completed all the steps to run mjpg streamer and haproxy from that guide?

Thank you for your response!

I actually forgot to start the server for the stream. But while starting the server with the command for the original rpi camera I get an error message:

./mjpg_streamer -i "./input_raspicam.so -fps 5" -o "./output_http.so"
MJPG Streamer Version: git rev: 310b29f4a94c46652b20c4b7b6e5cf24e532af39
ERROR: could not find input plugin
       Perhaps you want to adjust the search path with:
       # export LD_LIBRARY_PATH=/path/to/plugin/folder
       dlopen: ./input_raspicam.so: cannot open shared object file: No such file or directory

I've tried to fix this problem with this guide, unfortunately without success. Another try was this fix from an issue (GitHub), with the error message, that the packages ti-tidl and mjpeg-streamer-opencv-python could not be found.

PS: The links don't work. Presumably because of the missing streaming server

Does it work if you run it with the variable at the beginning?

LD_LIBRARY_PATH=. ./mjpg_streamer -i "./input_raspicam.so -fps 5" -o "./output_http.so"

Sometimes that will mean that the installation failed somehow - and it didn't install all the plugins properly.

Unfortunately it doesn't work. Error message below.

mjpg_streamer -i "./input_raspicam.so -fps 5" -o "./output_http.so"
MJPG Streamer Version: git rev: 310b29f4a94c46652b20c4b7b6e5cf24e532af39
ERROR: could not find input plugin
       Perhaps you want to adjust the search path with:
       # export LD_LIBRARY_PATH=/path/to/plugin/folder
       dlopen: ./input_raspicam.so: cannot open shared object file: No such file or directory

I guess that something with the OS could be wrong (maybe a missing or broken package or something else), so I will try the installation of the mjpg-streamer on another linux OS and update my post afterwards.

Update: With a fresh install of the Raspberry Pi OS the problem could be fixed.

Ive used MotionEye on a 2nd RPI3b to offload the load on Octoprint (RPI4). Used an RPI Cam on the RPI4 for Extruder view. And motioneye on my RPI3b with an RPI Zoom cam as External Case.

In Haproxy i used for webcam2 instead the localhost adress, my ip adress of motioneye and the port. Mostly 8082.

Works great.