Search code examples
raspberry-pi

Pi camera: mmal:No data received from sensor


This question has been asked before but the solution did not solve my problem.

When I connect my Pi camera to my Raspberry Pi and use the command: raspistill -o image.jpg.

This gives an error:

mmal: No data received from sensor. Check all connections, including the Sunny one on the camera board.

All the connections are fine. I tried with two Pi cameras on two different Raspberry Pis but it still gives the same error. When I use the raspistill command then the red light of the camera goes on and I have also enabled camera on Pi via sudo raspi-config.

Please help.


Solution

  • I've had this issue too. I don't know if static electricity hurt the unit or if it happened in shipping. I've seen several behaviors to the 5MP version I purchased. First was putting it in the wrong port. Depending on your model you may just have it in the wrong port. Some people have claimed putting in the other port may fry the camera. I cannot confirm or deny that happens.

    I similarly would run this command and get messages like: mmal: mmal_vc_component_enable: failed to enable component: ENOSPC mmal: camera component couldn't be enabled mmal: main: Failed to create camera component mmal: Failed to run camera app. Please check for firmware updates Or the message you received.

    I attempted to run:

    1. apt-get update && sudo apt-get dost-upgrade
    2. sudo rpi-update

    I've even tweaked the module and blacklist to see what was up.

    pi@raspberrypi:~ $ raspistill -v -o image.jpg
    raspistill Camera App v1.3.8
    
    Width 2592, Height 1944, quality 85, filename image.jpg
    Time delay 5000, Raw no
    Thumbnail enabled Yes, width 64, height 48, quality 35
    Link to latest frame enabled  no
    Full resolution preview No
    Capture method : Single capture
    
    Preview Yes, Full screen Yes
    Preview window 0,0,1024,768
    Opacity 255
    Sharpness 0, Contrast 0, Brightness 50
    Saturation 0, ISO 0, Video Stabilisation No, Exposure compensation 0
    Exposure Mode 'auto', AWB Mode 'auto', Image Effect 'none'
    Metering Mode 'average', Colour Effect Enabled No with U = 128, V = 128
    Rotation 0, hflip No, vflip No
    ROI x 0.000000, y 0.000000, w 1.000000 h 1.000000
    Camera component done
    Encoder component done
    Starting component connection stage
    Connecting camera preview port to video render.
    Connecting camera stills port to encoder input port
    Opening output file image.jpg
    Enabling encoder output port
    Starting capture 0
    mmal: No data received from sensor. Check all connections, including the Sunny one on the camera board
    

    sudo raspi-config will let you ensure you enabled your camera, or use the Menu, Preferences to see if its enabled. Beyond that the red light doesn't seem to mean anything and it may require a replacement. I just ordered a 8MP one to see if it works.

    I also checked this command:

    pi@raspberrypi:~ $ vcgencmd get_camera
    supported=1 detected=1
    

    Update

    I got my 8MP camera in, and it worked. I am starting to think there was something just wrong with my 5MP camera. Few notes on the behaviors I got myself into. - if you do a sudo mod probe bcm2835-v412 it appears to mount the camera to /dev/video0. At this point you can no longer use raspistill/vid without getting the ENOSPC error I was getting. I had added that to work with motion so I could stream from the web.

    I've bounced around with a few projects now and haven't found much joy with the implementation, but at minimum the raspistill commands worked and I did get motion working, however I didn't want mjpeg and still need to sort out if h264 is an option.