camera issue



  • Hi, I received my Zumi yesterday and assembly went fine but when I run the code on jupyter notebook it shows camera error like as below.

    PiCameraMMALError: Failed to create MMAL component b'vc.ril.camera': Out of memory.During handling of the above exception, another exception occurred:

    PiCameraError: Camera is not enabled. Try running 'sudo raspi-config' and ensure that the camera has been enabled.


  • administrators

    @haru ,

    Please check that the camera cable is connected to the RaspberryPi. Sometimes it can become disconnected. On the camera itself, the cable may also pop off. Gently push these back into place and try again. Let me know if you have any more questions!




  • administrators

    @haru There is a smaller ribbon cable that's right underneath the camera that is harder to see called the "Sunny" connector. This one can be easily missed because it may look connected. See the attached photos to see what I mean.

    0_1566349725622_camera view.jpg

    0_1566349817201_open_camera.jpg

    0_1566349735646_close_camera.jpg



  • @robolink_leila ,
    Great, let me check it later. Thank you for your help!



  • @robolink_leila ,

    I've tried to check the connector and I got another error as below.

    PiCameraMMALError: Failed to create MMAL component b'vc.ril.camera': Out of memory

    PiCameraError: Camera is not enabled. Try running 'sudo raspi-config' and ensure that the camera has been enabled.


  • administrators

    @haru May I see your code? If you open the camera stream with camera.start_camera() and try to open it again before running camera.close(), you will get an "out of memory" or "out of resources" error.



  • @robolink_leila sure, I am using "1.1 Color Classification.ipynb"

    Here is step 1, it looks good to me.

    Pi Zero I2C is available
    Gyro offset file already exists.
    Verified Pi Zero is the same
    Gyroscope previously calibrated
    

    Here is step 2

    Starting PiCamera
    ---------------------------------------------------------------------------
    PiCameraMMALError                         Traceback (most recent call last)
    /usr/lib/python3/dist-packages/picamera/camera.py in _init_camera(self, num, stereo_mode, stereo_decimate)
        455         try:
    --> 456             self._camera = mo.MMALCamera()
        457         except PiCameraMMALError as e:
    
    /usr/lib/python3/dist-packages/picamera/mmalobj.py in __init__(self)
       2278         global FIX_RGB_BGR_ORDER
    -> 2279         super(MMALCamera, self).__init__()
       2280         if PARAM_TYPES[mmal.MMAL_PARAMETER_ANNOTATE] is None:
    
    /usr/lib/python3/dist-packages/picamera/mmalobj.py in __init__(self)
        632             mmal.mmal_component_create(self.component_type, self._component),
    --> 633             prefix="Failed to create MMAL component %s" % self.component_type)
        634         if self._component[0].input_num != len(self.opaque_input_subformats):
    
    /usr/lib/python3/dist-packages/picamera/exc.py in mmal_check(status, prefix)
        183     if status != mmal.MMAL_SUCCESS:
    --> 184         raise PiCameraMMALError(status, prefix)
        185 
    
    PiCameraMMALError: Failed to create MMAL component b'vc.ril.camera': Out of memory
    
    During handling of the above exception, another exception occurred:
    
    PiCameraError                             Traceback (most recent call last)
    <ipython-input-2-77ba1fc37069> in <module>
    ----> 1 camera.start_camera()
          2 
          3 try:
          4     knn = ColorClassifier()
          5     train = knn.set_values()
    
    /usr/local/lib/python3.5/dist-packages/zumi/util/camera.py in start_camera(self)
         39             self.close()
         40         print('Starting PiCamera')
    ---> 41         self.camera = PiCamera()  # PiCamera gets resolution (height, width)
         42         self.camera.resolution = self.resolution
         43         self.camera.framerate = self.framerate
    
    /usr/lib/python3/dist-packages/picamera/camera.py in __init__(self, camera_num, stereo_mode, stereo_decimate, resolution, framerate, sensor_mode, led_pin, clock_mode, framerate_range)
        429             raise PiCameraValueError('Invalid clock mode: %s' % clock_mode)
        430         try:
    --> 431             self._init_camera(camera_num, stereo_mode, stereo_decimate)
        432             self._configure_camera(sensor_mode, framerate, resolution, clock_mode)
        433             self._init_preview()
    
    /usr/lib/python3/dist-packages/picamera/camera.py in _init_camera(self, num, stereo_mode, stereo_decimate)
        458             if e.status == mmal.MMAL_ENOMEM:
        459                 raise PiCameraError(
    --> 460                     "Camera is not enabled. Try running 'sudo raspi-config' "
        461                     "and ensure that the camera has been enabled.")
        462             else:
    
    PiCameraError: Camera is not enabled. Try running 'sudo raspi-config' and ensure that the camera has been enabled.
    

  • administrators

    @haru If you are sure that the cable is connected on both ends (including the "Sunny" connector"), you may need to go into the terminal and manually enable the camera.
    To open the terminal, you can follow step 3 from the beginning of this tutorial. Once you open the terminal, there is no need to create a new directory. Type the command sudo raspi-config and you will see the configuration menu for the RaspberryPi. From the options list, select "Interfacing Opotions". From that menu, select "Camera" and make sure to enable it. The system will ask you to reboot. Log in again and try the code. If you need more explanations or something is still not working, let us know and we can set up a support call.


Log in to reply
 

Looks like your connection to Robolink community was lost, please wait while we try to reconnect.