Pi 5 USB camera not working

Because of all the updates I've been doing and just wanting the latest and greatest, I got a Pi 5 8Gig, a new LCD and the latest image (V37).  Setup was clean and easy this time, other than having to add a few things in startup for the LCD, and everything is working good, except the camera.

I can add a camera and see the installed ports but they are all greyed out and not selectable.  I've tried everything I could find on google and some of those things made the camera go away entirely, but I finally got them back, but the camera port is still not selectable.  Anything I missed to get the camera selectable?

sudo /usr/local/Repetier-Setup/bin/startAllCams
Start from directory /usr/local/Repetier-Setup/bin
Testing for active webcams in /dev/v4l/by-path/*
Best resolution: 640 x 480 at 25
./watchedCam 8080 /dev/video0 25 640x480

Comments

  • Greyed out means when testing if camera is currently reachable fails. Reason is cams get added once seen and stay and this way you have it easier to select the running version.

    Please see if
    ps aux | grep mjpg
    shows something like
    root      6493  0.1  0.2  28072  8876 pts/5    Sl   Feb26   9:01 /usr/local/bin/mjpg_streamer -i /usr/local/lib/mjpg-streamer/input_uvc.so -d /dev/video1 --fps 30 -q 85 -r 640x480  -o /usr/local/lib/mjpg-streamer/output_http.so -p 8080 -w /usr/local/share/mjpg-streamer/www

    that indicates it is running. And if so call it again after a few seconds to see if first number (pid, here 6493) changes. If so it means the software crashes or stops for some reasons also camera was detected. Check syslog for possible reasons
    tail -200 /var/log/syslog

  • just ran it and got this:

    root     24152  0.0  0.0   2392  1648 ?        D    10:36   0:00 /usr/local/bin/mjpg_streamer -i /usr/local/lib/mjpg-streamer/input_uvc.so -d /dev/video0 --fps 25 -q 85 -r 640x480  -o /usr/local/lib/mjpg-streamer/output_http.so -p 8080 -w /usr/local/share/mjpg-streamer/www

    Ran it again and got this:

    root     24406  0.0  0.0   2392  1648 ?        D    10:37   0:00 /usr/local/bin/mjpg_streamer -i /usr/local/lib/mjpg-streamer/input_uvc.so -d /dev/video0 --fps 25 -q 85 -r 640x480  -o /usr/local/lib/mjpg-streamer/output_http.so -p 8080 -w /usr/local/share/mjpg-streamer/www
  • Just what I thought. The watcher restarts if streamer fails, but here it seems to be problem making it crash. So please check the syslog for indications on why the streamer stops after starting. It logs everything into that log file.
  • Ok I found a cheap USB camera in a drawer and it works.  Look like that one may be defective or just not compatible.  I have new cables coming for my Pi camera tomorrow since the onbord camera plug on the Pi 4 and Pi 5 are different.  The camera is supposed to work, but need a different cable (22 pin to 16 pin I believe).

    Thanks again :)
  • Yes pi 5 has a narrow CSI cable now. Just be aware that they use software compression (so higher cpu usage but works) but I improved the streamer a bit and it worked even with 2 pi cams on my test pi 5:-)
  • Repetier said:
    Yes pi 5 has a narrow CSI cable now. Just be aware that they use software compression (so higher cpu usage but works) but I improved the streamer a bit and it worked even with 2 pi cams on my test pi 5:-)
    I finally got my cables and installed them.  After 30-60 seconds it all turns green colors.  Tried 2 different cables and it does the same thing.  If I got to printer settings and restart webcam server and refresh my screen it goes normal again but then in 30-60 seconds it green again.  Does not do this with my Pi 4.
  • Whcih Pi Cam do you have? I have tested successfullt with pi cam 2 and 3. Is this a longer cable? Might be communication issues causing the stream to bail out until it is restarted. As a test make sure the cable does not come to close to any othe cables/electroncs and see if it works longer.
  • It is a UC-420 Pi camera.  Not sure anything past that.  It is so old I cannot even find it in my Amazon history lol.  It turns green even with a 6" cable which is not near long enough.  My old Pi 4 with this camera went through a 6" cable to an HDMI adapter to the top of the printer to another HDMI adapter to a 3" cable to the Pi camera with no issues at all.  Does the Pi 5 just need a better camera?  Should I just buy a high quality USB?
  • Since pi cams use currently software encoding, any usb cam with mjpg support would use less cpu and make less problems. That said, pi 5 has enough power to do a few fps with pi cam and mine works stable, but the new cables have cables more narrow so maybe more prone to communication issues, but I'm not sure about that. I'm no electronic guy, just a programmer.
  • I understand.  I try to know a little about everything, but that just makes me ask more questions lol.  I will try messing with some settings and if I still can't fix it I will order a new USB cam.  I put klipper on my Ender 5+ so I swapped the original screen with a 4.3" LCD with the Pi on the back.  Taking this thing apart to jack with the camera cables is so inconvenient, but I liked my Pi cam.  Now to find one I can easily mount on my 2020 frame.
Sign In or Register to comment.