Navigation

    Robolink logo
    • Register
    • Login
    • Search
    • [[global:header.categories]]
    • [[global:header.recent]]
    • [[global:header.tags]]
    • [[global:header.popular]]
    • [[global:header.users]]
    • [[global:header.groups]]
    As of September 2021, we have moved technical support to Robolink Help

    Welcome to the Robolink Community forum!

    You can post here to interact with others in the Robolink community. We're checking it weekly, and we'll respond to some messages. If you're looking for technical support, head over to Robolink Help.

    camera issue

    Zumi
    2
    9
    4374
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      haru last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • robolink_leila
        robolink_leila @haru last edited by

        @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.

        1 Reply Last reply Reply Quote 0
        • H
          haru last edited by

          @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.
          
          robolink_leila 1 Reply Last reply Reply Quote 0
          • robolink_leila
            robolink_leila @haru last edited by

            @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.

            1 Reply Last reply Reply Quote 0
            • H
              haru @haru last edited by

              @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.

              robolink_leila 1 Reply Last reply Reply Quote 0
              • H
                haru last edited by

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

                H 1 Reply Last reply Reply Quote 0
                • robolink_leila
                  robolink_leila @haru last edited by

                  @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

                  1 Reply Last reply Reply Quote 0
                  • H
                    haru last edited by

                    @robolink_leila ,
                    Thanks for the reply. I've checked it bad I couldn't find a problem. If you find it from images please let me know.

                    https://gyazo.com/7ead04bf8d04eef279b0c095b3476e98
                    https://gyazo.com/a7ca490d98c5389fe2ff113dd1ca7a61
                    https://gyazo.com/20a21cd01338274485dfd7e175408eda
                    https://gyazo.com/162ea1355ac425d02698481ad8758f43

                    robolink_leila 1 Reply Last reply Reply Quote 0
                    • robolink_leila
                      robolink_leila last edited by

                      @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!

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post