1

I have developed a system (Raspbian / Python) with detects someone's presence through a PIR sensor and records a 15' video with a Pi NoIR camera.

This is command I call to record the video:

Popen(["raspivid", "-w", "800", "-h", "600", "-t", "15000", "-o", fullpath, "-n", "-rot", "270"], stdout=PIPE, stderr=PIPE)

It works fine for a while, but after some hours the camera doesn't record anymore nor return any error. The problem is then just fixed when I restart my Raspberry Pi.

I tried taking a picture when the error occurred, but no success, meaning neither a picture nor a message error at all...

raspistill -o test.jpg

I checked the memory status (45%) and CPU usage as well (66%). So there are enough resources available... The RPi is also "well" powered since the red light stays on all the time (even when recording...)

It doesn't matter if I use the picamera library via Python or call raspivid via Popen.

My questions are: - What can I do to avoid the camera to stop working? - Is there a way to restart / reset the camera without having to restart the Pi?

Thanks

2
  • 1
    You say, "stops working", but what happens if you run raspistill -o test.jpg at that point? Is there no error but no picture? Maybe you should put some relevant code in here so someone can at least suggest a further strategy for debugging the issue.
    – goldilocks
    Jan 21, 2015 at 15:27
  • I will try and post it here
    – user22948
    Jan 21, 2015 at 20:48

1 Answer 1

1

Maybe the camera isn't getting enough power and disconnects for a split second... (this would explain why restarting is the only way to fix it... Since if you disconnect and then reconnect the ribbon cable while using the camera, you get the same effect and have to restart the Pi)

Try making sure the camera and pi are getting enough voltage while it's in use...

Use a power adapter with more than adequate amperage.

And for anyone using a USB camera instead of the Pi module, try using a powered USB hub to power the camera separately than the Pi.

I know this doesn't answer about how to reset. But it may prevent the issue altogether instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.