Zuifer
Posts: 10
Joined: Mon Apr 16, 2018 11:02 pm

Fixed my zero w system lockups when using the camera

Fri May 04, 2018 7:54 pm

Hello,

I like to share some experience i made regarding the stability issues i had with my zero w and various programs which use the camera.

In the beginning of using my zero w and the camera for streaming via raspivid and vlc i experience various system freezes. After a while after streaming the system stops. Streaming stops and i can't log into the system.

When i use ffmpeg to capture the stream while streaming, the system crashed even faster.

Most of the time kernel oops occured and the logs never gave me information which let me identify the problem.

Same with Rpi Cam Control. When i start record or use motion detection, the system will freeze after while.

I used Raspian lite. So i tested it with fresh install without and with update && upgrade. No change.
Distro.upgrade. Nope. Latest kernel and firmware. Nope.

I changed the Memory split. Nothing. I changed the power source. Got some with enough power and one with volt/ampere display. Nothing. And at this time i only tried to get a stable rtsp streaming, because i gave more or less up and saw the raspberry zero w only as streaming device.

I tried all the above programs with a pi 2b and they were always stable. So i thought it had to be a zero w problem. But the ram or the processing power could not be the problem. All the parameters were ok and i tested the system with 100% cpu usage and it never crashed like this.

So far my story. And now the good ending.
I thought mmmh stability ...stability, volt Volt!. More Power!!!
So i changed the config.txt and added:
over_voltage=4
force_turbo=1

and now it runs stable. Everything Rpi cam control, streaming while recording. Runs for 4 Days.
So i don't know why. My changes are increasing the volts and to increase to 1000mhz which should involve an increasing of the voltage too.
So i stay with a happy mmmh.

Is this a common problem and fix with the zero w or is it just my board?

Greetings

dashrb
Posts: 5
Joined: Tue May 08, 2018 1:59 am

Re: Fixed my zero w system lockups when using the camera

Thu May 10, 2018 1:12 am

I too am searching for a problem to the new instability I'm experiencing with the Zero W's. I like what I read here, but see https://www.raspberrypi.org/documentati ... locking.md

There is a small table showing that for the pi zero, the default setting for over_voltage is 6. So did you effectively lower the voltage?
However, with my Zero W's, I ran:
% sudo vcgencmd get_config over_voltage
over_voltage=0

So I don't know what to believe.

Therefore, I'll try adding your 2 settings and see how it goes on mine. :-)

dashrb
Posts: 5
Joined: Tue May 08, 2018 1:59 am

Re: Fixed my zero w system lockups when using the camera

Sun May 20, 2018 1:18 am

Upon further reflection, I decided to only change one thing at a time. So I only applied the line "over_voltage=6" (based on the link in my previous post). I did NOT apply the force_turbo setting.

My zero's have been stable for almost 2 weeks so far!

dashrb
Posts: 5
Joined: Tue May 08, 2018 1:59 am

Re: Fixed my zero w system lockups when using the camera

Sun Jun 24, 2018 7:47 pm

No, not really. They still crash occasionally. :cry:
I heard RUMINT that the additional voltage flags are ignored unless overclocking is also enabled.

AdrianM
Posts: 24
Joined: Sun Mar 27, 2016 12:50 pm

Re: Fixed my zero w system lockups when using the camera

Wed Aug 29, 2018 10:33 am

I know four months have passed since the last post in this thread but I think the information in this topic is valuable and have some observations to add of my own.

I've also been struggling to get reliable operation of a Pi Zero + camera setup as a security camera using RPi Cam Web Interface. The system would only run for part of a day with various crashes/watchdog resets. It was a kernel oops that finally led me to this topic.

I had eliminated PSU problems as a potential cause as the Pi is powered from a 12V->5V 3A switch-mode regulator located right next to the PCB. I added a 220uF low-Z capacitor in parallel with the 5V O/P just for good measure. My scope confirms a 5.05V supply at the DC input with well under 50mV of noise.

While the OP in this topic refers to a Pi Zero W, mine is without on-board WiFi but I also re-located the WiFi USB dongle to the outside of the metal security camera case as I previously had it behind the front window near the camera and wondered if EMI might be an issue.

Despite this the frequent lock-ups persisted. But having seen this topic, I followed the suggestion to increase core voltage and force turbo on and the system has now behaved perfectly for several days so far. Even if my luck breaks, the changes clearly have a significant bearing on the problem

The over_voltage parameter for the Zero seems to cause a bit of confusion as it is documented that it defaults to 6. This default aready results in a standard supply of 1.2V + 0.025V * 6 = 1.35V and the maximum the voltage regulator subsytem can provide is 1.4V therefore:

Code: Select all

over_voltage=2
- applies the maximum. Higher values just silently clip to 1.4V
However, I'm not convinced that upping the core voltage is what is making the difference to the camera issues.

As I understand the relevant history here, the CPU fab was enhanced to permit significant over-clocking of the Pi Zero and the default core voltage is increased to be already in place for this. I'm thinking that the instability could instead be due to the dynamic changes in clock speed when turbo mode is not forced on.

To test this I've restored the default core voltage and just left:

Code: Select all

force_turbo=1
Could it be that things go wrong with the camera interface when a dynamic clock speed changes takes place? Some more time with this setting in force might tell.

itsmedoofer
Posts: 356
Joined: Wed Sep 25, 2013 8:43 am

Re: Fixed my zero w system lockups when using the camera

Wed Aug 29, 2018 12:01 pm

Hi,

I have a ZeroW mounted on a ZeroView camera mount suck on my living room window, its powered from a prehistoric 1A Siemens phone charger on 2M of flex and I clock up weeks of up-time, the only lockups I have encountered are where the camera flex has moved a bit.

My install is based in the "lite" package and for this application I don't overclock at all, I have 5 days up at the moment after a reboot to finish of an update... I run the excellent RPi Cam Web Interface.

Code: Select all

[email protected]:~ $ uptime
 12:50:20 up 5 days, 15:52,  1 user,  load average: 0.54, 0.37, 0.31
I had another Zero running as a VPN server, I had this over-clocked with the following, with this setup it was very sensitive to the type of SD card, with older class 4 cards it would either lock up or corrupt the card within a day, class 10 seemed to work OK...

Code: Select all

arm_freq=1100
gpu_freq=500
core_freq=500
sdram_freq=500
sdram_schmoo=0x02000020
over_voltage=6 
sdram_over_voltage=2


May not help you but thought I would chip in....

AdrianM
Posts: 24
Joined: Sun Mar 27, 2016 12:50 pm

Re: Fixed my zero w system lockups when using the camera

Wed Aug 29, 2018 2:54 pm

Hi itsmedoofer, that's interesting - what kind of SD card do you have in the Camera Pi? Mine has a 32Gb SanDisk Extreme pro class 10

I can now see that my pet theory about the dynamic clocking alone being a remedy wasn't correct. It crashed out with a kernel oops after just four hours at the default core voltage. Back to 1.4V and turbo forced on to see how long it goes for now. :roll:

itsmedoofer
Posts: 356
Joined: Wed Sep 25, 2013 8:43 am

Re: Fixed my zero w system lockups when using the camera

Wed Aug 29, 2018 7:16 pm

Hi,

Not sure to be honest, it came from 7DayShop but what brand I couldnt say, I took a pic if that helps, all I can really say is it class 10.

If there is nothing sensitive I would be happy to try your image here...
Attachments
20180829_190644 (Medium).jpg
20180829_190644 (Medium).jpg (89.48 KiB) Viewed 5959 times

AdrianM
Posts: 24
Joined: Sun Mar 27, 2016 12:50 pm

Re: Fixed my zero w system lockups when using the camera

Thu Aug 30, 2018 8:59 am

Thanks for the offer to try out my image but I have another zero+camera that I'm about to test against a clone and a fresh install.
Anyway, since restoring the core to 1.4V along with turbo forced on, it's back to working perfectly again.
One permutation I've yet to try is leaving the core at 1.4V but turning off force turbo.

kajan001
Posts: 16
Joined: Wed Feb 13, 2019 7:15 am

Re: Fixed my zero w system lockups when using the camera

Mon Feb 18, 2019 8:08 pm

Hi!

AdrianM and Zuifer, did you continue to run your Pis with over_voltage and force_turbo without any problems?

I had freezing issues with Pikrellcam and applied your suggestion, so far it has been running for 4 days without any problem.

I am wondering if it really does run the cpu at overclocking speeds as no changes has been made to ARM, GPU speeds?

kajan001
Posts: 16
Joined: Wed Feb 13, 2019 7:15 am

Re: Fixed my zero w system lockups when using the camera

Sun Mar 10, 2019 9:11 am

Ok, ran the pi ZeroW with pikrellcam as described above. Worked without interuption for 10 days.

I then removed the force_turbo=1 and used only over_voltage, and the pi has been running flawlessly for a week.

kajan001
Posts: 16
Joined: Wed Feb 13, 2019 7:15 am

Re: Fixed my zero w system lockups when using the camera

Fri Mar 22, 2019 7:03 am

Still running after 3 weeks!

I added only the over_voltage

I had issues with the pi freezing in another location but I narrowed that down to some wifi issues.
I have an old router and for some reason using port 82 and pikrellcam made the pi freeze whenever i tried using the web interface.
Solved by using a different port

QSKONE
Posts: 2
Joined: Tue May 07, 2019 3:05 pm

Re: Fixed my zero w system lockups when using the camera

Mon May 13, 2019 12:50 pm

Hi , How can I edit over_voltage when run on MotioneyeOS?
Thanks

kajan001
Posts: 16
Joined: Wed Feb 13, 2019 7:15 am

Re: Fixed my zero w system lockups when using the camera

Tue Jun 04, 2019 2:07 pm

@QSKONE
MotioneyeOS is an standalone OS so you can use all the normal terminal commands and files you find the normal Raspbian.
Ask CCrisan at the motioneyeOS hub.
I used to have the same issue with motioneye but switched to pikrellcam because it had the sound recording feature before I found this post.
I had major issues with the PI0w freezing for me but the overvoltage seem to have fixed it.

La-te
Posts: 1
Joined: Sat Jun 29, 2019 4:21 pm

Re: Fixed my zero w system lockups when using the camera

Sat Jun 29, 2019 4:26 pm

Code: Select all

over_voltage=2
seems to fix this issue to me. I've seen this issue discussed on couple of forums and apparently it is quite wide spread. Some have mitigated the issue by setting the processor speed to 950 MHz.

Are you aware of anyone not affected with this exact H dot version and camera? Has anyone seen any official statement from The Raspberry Pi Foundation and actual recommended fix?

EZKernel
Posts: 19
Joined: Sat May 25, 2019 4:39 pm

Re: Fixed my zero w system lockups when using the camera

Mon Jul 01, 2019 4:05 pm

Hi boys, let me tell you my story - I am having an RPi grow a whole bunch of plants for me, expensive ones right.... It controls a relay, sensors, logs data and even waters them....

I started with a pi zero w but no matter what I did when the kernel tried to communicate with the sensors during when a picture was taken it would panic and crash the whole system.... Can't have it killing my plants.

So I'll leave this here...
https://unix.stackexchange.com/question ... -cpu-usage

nice settings didn't work for me.
cpu limiting works, but still crashes just a 1000 times less frequently

Ideal solution is what I did.... get off the zero w and get on a multiprocessor 64 bit sbc. tell the linux kernel to not allocate anything to 1,2,3 (in the case of a 4core syst and yes cores start at 0).

Then in python tell it to specifically use said core you want for the process. core 2,3 for camera and ffmpeg.

Sorry for this awful answer

PiWatcher
Posts: 1
Joined: Wed Jul 10, 2019 8:40 pm

Re: Fixed my zero w system lockups when using the camera

Wed Jul 10, 2019 8:44 pm

La-te wrote:
Sat Jun 29, 2019 4:26 pm

Code: Select all

over_voltage=2
seems to fix this issue to me. I've seen this issue discussed on couple of forums and apparently it is quite wide spread. Some have mitigated the issue by setting the processor speed to 950 MHz.

Are you aware of anyone not affected with this exact H dot version and camera? Has anyone seen any official statement from The Raspberry Pi Foundation and actual recommended fix?
According to the documentation, wouldn't setting the over_voltage to 8 provide 1.4V? From https://www.raspberrypi.org/documentati ... locking.md I found this information:


over_voltage CPU/GPU core voltage adjustment. [-16,8] equates to [0.8V,1.4V] with 0.025V steps. In other words, specifying -16 will give 0.8V as the GPU/core voltage, and specifying 8 will give 1.4V. For defaults see table below. Values above 6 are only allowed when force_turbo is specified: this sets the warranty bit if over_voltage_* is also set.

alnaseh
Posts: 60
Joined: Thu Jun 23, 2016 5:12 am

Re: Fixed my zero w system lockups when using the camera

Mon Aug 12, 2019 11:45 am

I will share my experience as well, i have been facing all kinds of crashes using the camera and opencv. I tried alomost everything but the processor is just weak enough. On the other one thing helps a lot, reducing the priority of my processes. Yes not increasing but decreasing to the minimum using nice - n 19. I guess with this it is not affecting any core os functions.

franvajo
Posts: 5
Joined: Tue Nov 28, 2017 10:08 am

Re: Fixed my zero w system lockups when using the camera

Fri Aug 16, 2019 10:30 am

Hi everybody,

I also want to share my experience on this issue.

I experienced the lockup when performing consecutive image captures with raspistill (latest version) on 8 different boards. The lockup seems to occur randomly in iterations smaller than 100. As already stated, setting over_voltage=2 fixes the issue.
PiWatcher wrote: According to the documentation, wouldn't setting the over_voltage to 8 provide 1.4V? From https://www.raspberrypi.org/documentati ... locking.md I found this information:
over_voltage CPU/GPU core voltage adjustment. [-16,8] equates to [0.8V,1.4V] with 0.025V steps. In other words, specifying -16 will give 0.8V as the GPU/core voltage, and specifying 8 will give 1.4V. For defaults see table below. Values above 6 are only allowed when force_turbo is specified: this sets the warranty bit if over_voltage_* is also set.
On the Pi Zero W the default value for the core voltage is already 1.35V. This corresponds to over_voltage=0 in the current firmware. The maximum value is 1.4V and setting over_voltage > 2 has no effect.

I tested all eight Pis for stability with the following script:

Code: Select all

#!/bin/bash

rm temp.log
touch temp.log

for i in {0..1000}
do
  DATESTR=$(date +'%Y-%m-%d_%H-%M-%S')
  echo "$i $DATESTR"
  ./raspistill -w 3280 -h 2464 -t 100 -r -n -ss 1750 -awb off -awbg 1.5,1.2 -ag 8 -dg 1 -q 100 -o cam.jpg
  temp=`vcgencmd measure_temp`
  echo $temp >> temp.log
  echo $temp

  if [ $? -ne 0 ]; then
    echo "Error raspistill"
  fi
done
All Pi ran through without crashing. The maximum core temperature measured is 59°C (inside a housing without any cooling).

G4DPF
Posts: 6
Joined: Thu Mar 23, 2017 6:18 pm

Re: Fixed my zero w system lockups when using the camera

Wed Sep 11, 2019 3:31 am

Thanks for all the posts here which I found when trying to solve the freezing issue I have with RPi Cam control with a new PiZero W
I have previously used the zero without onboard wifi without any issues. My issues have come about when I am using the Pi Zero W

I will update whether changing works for me

Thanks for all the posts
Iain

G4DPF
Posts: 6
Joined: Thu Mar 23, 2017 6:18 pm

Re: Fixed my zero w system lockups when using the camera

Fri Sep 13, 2019 6:38 am

The over_voltage=4 force_turbo=1 mod to config.txt fixed it for me.
Thanks for posting the solution.
I don't understand why it worked but it does and I am extremely grateful
Thanks Iain

Return to “Camera board”