connecting a picam v2 to raspberry pi 4
using navio2 img
i was testing my picam and successfully streamed to a browser, and everytime i put the raspberrypi address in a browser followed by:8081, i see the camera streaming.
when trying to use mjpg_streamer -o “output_http.so -w ./www” -i “input_raspicam.so”
i get the following error bind: Address already in use mmal: mmal_vc_component_enable: failed to enable component: ENOSPC camera couldn’t be enabled]
So it was working, but then it wasn’t? That is odd! When it was streaming to a browser, you were doing this with mjpg_streamer right?
When you get that error, let’s see what other program may be running on port 8080 (the port mjpg_streamer is trying to forward images to).
Run the command:
sudo netstat -ltnup | grep 8080
And if there is a program running on port 8080, this is likely the reason why you are receiving the error. It may even be that the first run of mjpg_streamer was still somehow running in the background, blocking you from calling it again.
It appears your ‘motion’ program is using both ports 8080 and 8081 per your screenshot.
Your original screenshot of attempting to run mjpg_streamer shows it’s trying to use port 8080. If port 8080 is already in use by your ‘motion’ program, mjpg_streamer will not work.
I wouldn’t get too hung up on this mjpg_streamer issue. So if your ‘motion’ program shows you the camera feed, I wouldn’t put much time into trying to get mjpg_streamer to work. Just as long as you have some way to see the camera feed you should be good to go.