Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3443

Troubleshooting • Pi 4Bs Rather Sudden USB Camera Failures

$
0
0
I have three Pi 4Bs all running Buster. One is at my home the other two at a different location. All have virtually identical generic USB cameras. Each one captures an image once every two minutes, badges it and uploads to a web server. This has been operating quite well for four or five years. (Memory fails.)

The webcam code is simple:

Code:

/usr/bin/fswebcam -c $config
The config file:

Code:

## config file for fswebcamdevice /dev/v4l/by-id/usb-HD_Camera_Manufacturer_USB_2.0_Camera-video-index0resolution 1280x720no-bannerwebp 100skip 50frames 3save  /home/pi/webcam/webcam.webp
I have a software watchdog set up to reboot the Pi if it fails to capture an image for more than 600 seconds. That seems to always fix whatever caused the failure.

Unfortunately, and recently, all three Pies have started to trigger the watchdog reboot much more often than previously.

As part of the watchdog repair script I have it run: lsusb >> /home/pi/webcam/webcam.log

And this is the usual result just before reboot:

Code:

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hubBus 001 Device 005: ID 04a9:220e Canon, Inc. CanoScan N1240U/LiDE 30Bus 001 Device 004: ID 051d:0002 American Power Conversion Uninterruptible Power SupplyBus 001 Device 003: ID 05a3:9230 ARC International CameraBus 001 Device 002: ID 2109:3431 VIA Labs, Inc. HubBus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
So, the camera is still there, but fswebcam fails to connect.

Here's a fragment of the watchdog log:

Code:

Nov  5 07:21:24 raspsky watchdog[1099]: file /home/pi/webcam/webcam.webp was not changed in 670 seconds (more than 600)Nov  5 07:21:24 raspsky watchdog[1099]: Retry timed-out at 65 seconds for /home/pi/webcam/webcam.webp
A few questions:

• What could cause this cluster of failure on three different Pies, two of which are 450K from the other one?
• Is there a better way to use fswebcam to insure fewer failures?
• Is there a better solution than a watchdog reboot to repair the failures?

I am just beginning the long and arduous task of upgrading the three Pies to Bookworm, so I'd kind of like to resolve this issue before I get too far in to the upgrade process. (After about 20 hours over ten days I am about half done with Pi number one.)

Statistics: Posted by Ratsima — Tue Nov 05, 2024 5:09 am



Viewing all articles
Browse latest Browse all 3443

Trending Articles