Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting the system date/time kills the camera! #527

Open
acu192 opened this issue Nov 6, 2018 · 2 comments
Open

Setting the system date/time kills the camera! #527

acu192 opened this issue Nov 6, 2018 · 2 comments

Comments

@acu192
Copy link

acu192 commented Nov 6, 2018

My stetup:

  • Raspberry Pi 3 Model B (not B+)
  • Raspbian Stretch Lite (build 2018-10-09)
  • Python 3.6
  • picamera 1.13

Steps to reproduce:

Step 1: Run this following script (in its own terminal, so you can see it when it dies)

from picamera import PiCamera
from picamera.array import PiRGBArray
import time

width, height = 320, 240

camera = PiCamera(resolution=(width, height), framerate=8)
array = PiRGBArray(camera, size=(width, height))

time.sleep(1.0)

for _ in camera.capture_continuous(array, format='rgb', use_video_port=True):
    frame = array.array
    array.truncate(0)
    print('Capture frame with shape', frame.shape)

camera.close()

Step 2: Run the following commands (in a different terminal, of course).

> sudo systemctl stop systemd-timesyncd.service    # otherwise the next command won't work
> sudo date -s "Tue Nov 6 02:41:35 UTC 2017"        # set to a time in the past
> sudo date -s "Tue Nov 6 02:41:35 UTC 2018"       # set the time back to "now"

You should see the python script from step 1 die now.

I suppose the timeout mechanism that picamera uses gets thrown off when the system time is changed.

Unfortunately I hit this error all the time (I only recently figured out it had to do with the time being set). Reason: On-boot I have a process spin up and start using the camera. Then my Pi gets Wifi access a few seconds later, and then the background service which queries the NTP server wakes up and gets the current time and sets it, and then the camera dies.

Btw, this library is great. If you give me a little direction, I'd be more than happy to help fix this bug. Thank you!

@acu192
Copy link
Author

acu192 commented Nov 6, 2018

Maybe the issue here (described above) is the underlying cause of this other issue: #242 ??

acu192 added a commit to MasterAI-Inc/libauto that referenced this issue Nov 6, 2018
See the bug described here: waveform80/picamera#527

And see the comment in the committed code.
@RDReavis
Copy link

RDReavis commented Jan 1, 2021

Confirmed that this is still an issue and impacts my project.

The firmware issue linked to #242 that might have resolved this, raspberrypi/firmware#609, appears to have been closed without a fix due to lack of further need from the user who opened the issue. Is the proper action to open a new firmware issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants