johnbradley / picameratraps

Raspberry Pi Camera Trap management software
MIT License
0 stars 0 forks source link

Avoid capture fails due to overlapping capture #4

Open johnbradley opened 1 year ago

johnbradley commented 1 year ago

I tried to setup cron to start capturing timelapse images at the beginning of each our for the next 60 minutes. Occasionally this failed with the following error:

[12:41:49.188858266] [16388]  INFO Camera camera_manager.cpp:297 libcamera v0.0.5+83-bde9b04f
[12:41:49.322237334] [16389] ERROR V4L2 v4l2_device.cpp:353 'imx708': Unable to set controls: Device or resource busy
[12:41:49.499334097] [16389]  INFO RPI vc4.cpp:437 Registered camera /base/soc/i2c0mux/i2c@1/imx708@1a to Unicam device /dev/media3 and ISP device /dev/media0
[12:41:49.499760094] [16389]  INFO RPI pipeline_base.cpp:1101 Using configuration file '/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml'
[12:41:49.510796017] [16388]  INFO Camera camera.cpp:840 Pipeline handler in use by another process
ERROR: *** failed to acquire camera /base/soc/i2c0mux/i2c@1/imx708@1a ***
johnbradley commented 1 year ago

Options: 1) set the time-lapse capture to run for the entire range desired so there is no chance of overlap. 2) give enough time between time-lapse capture commands to handle startup and cleanup by the libcamera-still command.