Skip to content Skip to sidebar Skip to footer

Raspberry Pi Camera. Out Of Resources

Trying to launch my camera with motion sensor. Works fine like this: import RPi.GPIO as GPIO import time import picamera import datetime import os def getFileName(): return da

Solution 1:

I know this is an old question but I just wanted to post my solution to the Out of resources error in case it can save someone time and effort.

The problem for me was that I was initializing the camera module is two Python files at the same time (a script with a while loop that took a picture when motion was detected and another script that took a picture on demand).

As per the documentation: https://picamera.readthedocs.io/en/release-1.13/faq.html#camera-locks-up-with-multiprocessing you must ensure that only a single process creates an instance of PiCamera at one time.

My solution was simply to move initializing the camera module inside a function and call .close() after taking the picture to free up the process ready to be used by the next script that calls it.

Post a Comment for "Raspberry Pi Camera. Out Of Resources"