MJPG Streamer Error

Camera model
Raspberry Pi Camera Version 2.1

What is the problem?
When I run: ./mjpg_streamer -o "output_http.so -w ./www" -i "input_raspicam.so" ,
I get this as the output:

 i: fps.............: 5
 i: resolution........: 640 x 480
 i: camera parameters..............:

Sharpness 0, Contrast 0, Brightness 50
Saturation 0, ISO 0, Video Stabilisation No, Exposure compensation 0
Exposure Mode 'auto', AWB Mode 'auto', Image Effect 'none'
Metering Mode 'average', Colour Effect Enabled No with U = 128, V = 128
Rotation 0, hflip No, vflip No
ROI x 0.000000, y 0.000000, w 1.000000 h 1.000000
 o: www-folder-path......: ./www/
 o: HTTP TCP port........: 8080
 o: HTTP Listen Address..: (null)
 o: username:password....: disabled
 o: commands.............: enabled
 i: Starting Camera
bind: Address already in use
bind: Address already in use
 o: server_thread(): bind(8080) failed

What did you already try to solve it?
A day of random trouble shooting, sudo apt-get update, sudo apt-get upgrade. The Pi can see the camera when I do

vcgencmd get_camera

with the output of:

supported=1 detected=1

I apologise for any formatting, question asking and forum practice errors, I have tried my best and this is my first question on a forum so far, thank you!
If you require more information, please let me know and I can add it.

Are you using OctoPi or trying to install yourself?

Iโ€™m using the full Octoprint/OctoPi stack. I have already installed it and it has been working fine for the last few months on my Ultimaker. I just bought a camera and a cable and I'm setting it up for time lapses.

Iโ€™m starting to think that some other process is stealing itโ€ฆ
Do you have an idea in how I could identify and kill that process?

That means there is already something running that uses port 8080. That something is likely mjpg-streamer, which is already started by OctoPi by default. So the question is why are you starting it manually?

1 Like

Because on the Octoprint Interface, it just shows the Webcam Loading. I have reason to believe that my 2m long cable or the camera is just faulty. Do I have any way to test this other than buying a shorter cable?

In my opinion, 2m us way too long for an unshielded flat cable, especially with high-frequent electromagnetic noise coming from the stepper motors.

If mjpeg streamer is already running on port 8080, you cannot start another instance on the same port (using the same camera). So you would first have to stop the currently running mjpgstreamer instance. From the top of my head, you can do that with sudo service webcamd stop. But if you are just interested in the output of the mjpgstreamer service that is already running, you can check its logs in /var/logs/webcamd (again, from the top of my head, you may have to look around a bit).

Right. Will try that some time this week.
2m is too long you say? Would a 1m cable be better?

1m is better, but still long. If you want to have a camera with a long cable, use a USB webcam. Those cables have proper shielding and decent ones have some form of protection against magnetic interference (ie a ferrite core).