This post is related to Raspberry Pi camera randomly freezes / crashes SoC

I have exactly the same problem but my java app is continuously executing raspistill as a separate process. It reads the output stream and after that it executes again, but after 4 days it freezes. It always takes 4 days. To make sure that it is not problem with my app, I stop it and run the raspistill command manually (from the terminal). The LED goes red but the process never ends The problem appears on both my RPI 2Bs with different cameras (one is normal, second night) both version 1.3 and different ribbon cables. Only reboot of the RPi solves this problem.

One more point, when my app runs raspistill less often, then it fails after 7 days.

Just note, that I have performed update, upgrade...


my app runs command raspistill -o -v -w 1920 -h 1080 -n -drc off -ex sports -mm matrix -e jpg -ifx denoise -awb auto -t 1 -q 100. I am using only the terminal to access the RPi, and my app is running as a service (systemd). Loginng in and logging out does not help in this case as I connected more then once to an RPi which was in failed state (means that raspistill could not capture a picture). Then I rebooted it. To reproduce it again I have to wait 4 days.

What I want to try this weeked is to run raspistill command with timelapse (means raspistill will be executed only once by my app and will produce stream of .jpg pictures on its output). During reading of the output stream, I will have to distinguish between pictures but it should not be problem (.jpg pictures has some bytes at start and at the end).

Part of my java code is:

byte[] pictureData = null;
try (InputStream stream = p.getInputStream()) {
   pictureData = IOUtils.toByteArray(stream);
return pictureData;
  • Are you using a V1 or V2 board? Do you have two separate Pis, one with a night vision camera, and one with a normal camera? That's what it sounds like, but I'm not sure. Does rebooting solve it? What code are you using to take video? Also. your question is confusing. Please state clearly what your specific problem is and the circumstances in which it appears. – anonymoose Mar 18 '17 at 12:08
  • I am sorry, I have updated quetion – Tomas Bilek Mar 18 '17 at 14:12
  • Does logging out solve the problem? What is the specific command you run to make sure it's not your java app? – anonymoose Mar 18 '17 at 15:39
  • I have updated question, as my response was too long – Tomas Bilek Mar 19 '17 at 7:27
  • Can you provide more code? Trim it down to what's necessary, but I don't think it's possible to answer this without more information. What Java version are you using? Are you sure you have Pi 2Bs or is one of them a different model? – anonymoose Mar 20 '17 at 11:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.