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

capture timeout #432

Open
z-afshar opened this issue Aug 11, 2017 · 8 comments

Comments

@z-afshar
Copy link

@z-afshar z-afshar commented Aug 11, 2017

Hello,
I just bought 5 megapixel OV5647 camera, and enable it through raspi-config
the camera works well with raspistill and raspivid utilities and takes images and videos well,
but when I use the picamera module to capture pictures it shows me an error after capture command:

#!/usr/bin/python
from time import sleep
from picamera import PiCamera

camera = PiCamera()
camera.resolution = (1024, 768)
camera.start_preview()
sleep(2)
camera.capture('foo.jpg')

Traceback (most recent call last): File "./test-camera1.py", line 11, in <module> camera.capture('foo.jpg') File "/usr/local/lib/python2.7/dist-packages/picamera/camera.py", line 1423, in capture 'Timed out waiting for capture to end') picamera.exc.PiCameraRuntimeError: Timed out waiting for capture to end

I'm stuck on this step with picamera module, please help, thanks

@simonek0007

This comment has been minimized.

Copy link

@simonek0007 simonek0007 commented Sep 17, 2017

Hi,
did you solve the problem? I have the same situation.

@waveform80

This comment has been minimized.

Copy link
Owner

@waveform80 waveform80 commented Sep 18, 2017

@z-afshar @simonek0007 what environment are you running from? The script works happily for me from the Python command line, and from IDLE but I've recently seen something similar on SO and I'm wondering if you two are using something else which is doing something odd with threading?

@simonek0007

This comment has been minimized.

Copy link

@simonek0007 simonek0007 commented Sep 19, 2017

Hi, I formatted the SD card and install Raspbian from the beginning. I have Raspberry PI Desktop version. Below you can find the steps which I made:

  1. sudo -apt-get update
  2. sudo apt-get install python-picamera python3-picamera
  3. sudo apt-get upgrade
  4. uname -a Linux Raspberrypi 4.9.41-v7+ #1023
  5. sudo reboot
  6. run the script (python3 script) for capture the image after capture the image i can only restart the python shell. The led in camera is lighting all the time.
  7. In python 3.5.3 Shell choose "Debug" and "Debugger" then I run the script and run it step by step. till error appear: :182:_get_module_lock() KeyError:'picamera' After that the image is capture and I can see it on the LCD, but the LED is still lighting. I need to press CTRL+F6 to reset the python shell, then LED is turn off. In Python Shell window I got error message: Timed out waiting for capture to end. picxamera.exc.PiCameraRunTimeError. The image is saved on the SD, but when I try to open error message appear: There is no data.
    Please see pictures of error below.
    20170919_135355
    20170919_134602
    20170919_134045
    cameraled
@simonek0007

This comment has been minimized.

Copy link

@simonek0007 simonek0007 commented Sep 30, 2017

Any help?

@Patataman

This comment has been minimized.

Copy link

@Patataman Patataman commented Nov 10, 2017

I have mostly the same problem with the Camera V2 on Python2.7 and Raspberry Pi 3.
raspistill works perfectly, but when I try the simplest code with PiCamera, it's always a timeout.

The script is this (the same in the docs):

from time import sleep
from picamera import PiCamera

camera = PiCamera()
camera.resolution = (1024, 768)
camera.start_preview()
# Camera warm-up time
sleep(2)
camera.capture('foo.jpg')

And I have the 1.13 version installed. I tried with bigger sleeps (5 and 10 secs), but same result.

EDIT: I can't capture a photo but I can record a video. ¯_(ツ)_/¯

EDIT 2: Solved using the argument "use_video_port" with True. Any way, I still think this isn't the right way to do it, but at least it work :_)

camera = PiCamera()
camera.resolution = (1024, 768)
camera.capture('foo.jpg', use_video_port=True)
@sunilkumarit

This comment has been minimized.

Copy link

@sunilkumarit sunilkumarit commented Jun 23, 2018

Thank U
It is helpful

@RognanCr

This comment has been minimized.

Copy link

@RognanCr RognanCr commented Oct 23, 2018

Hi,
I have the same issue. The problem is that i can not use still_port through python. Raspistill utility works fine but any code in python which operates on still_port throws error : capture Timeout (e.g. sensor_mode = 2-3) even if you set CAPTURE.TIME to whatever.

So i think there must be problem with communication between python and still_port. I am not sure if it's global problem (i use camera WAVESHARE 11297). Soon i will try another camera.

When you set use_video_port = True you capture image through video_port so it makes sense that it works but you have much lower resolution.

For my application is necessary to use still_port.

@RognanCr

This comment has been minimized.

Copy link

@RognanCr RognanCr commented Oct 29, 2018

Ok, update.

So i've bought official picamera V2 and it's working how it supposed to.

I've read about people having the same issue. No solution works. Most people don't specify the type of the camera so it is hard to tell which type does not work (in my case "RPi Camera (D) 5Mpix REV 2.1 (Waveshare 11297)").

Of Course it only matters if you want to use still_port through this python interfaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.