fritztx
Posts: 4
Joined: Sat Jan 21, 2017 3:07 am

[solved]Pi Zero not seeing camera module

Sat Jan 21, 2017 3:26 am

Am hoping for help to determine error here. First let me say I am completely new to the pi. Am trying to do some DIY astrophotography with the pi zero and the v2.1 camera. Bought pi zero, cable and board thru reputable online retailer(Adafruit) and have followed a few different tutorials to get it the pi zero up and running. When i plug in the camera and try the demo from here:
from picamera import PiCamera
from time import sleep

camera = PiCamera()

camera.start_preview()
sleep(10)
camera.stop_preview()
I get this:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/picamera/camera.py", line 522, in _init_camera
prefix="Failed to create camera component")
File "/usr/lib/python3/dist-packages/picamera/exc.py", line 191, in mmal_check
raise PiCameraMMALError(status, prefix)
picamera.exc.PiCameraMMALError: Failed to create camera component: Out of memory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/pi/camera.py", line 4, in <module>
camera = PiCamera()
File "/usr/lib/python3/dist-packages/picamera/camera.py", line 488, in __init__
self.STEREO_MODES[stereo_mode], stereo_decimate)
File "/usr/lib/python3/dist-packages/picamera/camera.py", line 526, in _init_camera
"Camera is not enabled. Try running 'sudo raspi-config' "
picamera.exc.PiCameraError: Camera is not enabled. Try running 'sudo raspi-config' and ensure that the camera has been enabled.
>>>

I bought a second pi and camera for thinking it could be a bad board, or that i zapped the camera with static, still get above error. Added the "force_board_rev=0x00093" to no avail. Any help is greatly appreciated.
FritzTX
Last edited by fritztx on Wed Jan 25, 2017 6:07 pm, edited 1 time in total.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8926
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Pi Zero not seeing camera module? Please read.

Sat Jan 21, 2017 8:36 am

fritztx wrote:Am hoping for help to determine error here. First let me say I am completely new to the pi. Am trying to do some DIY astrophotography with the pi zero and the v2.1 camera. Bought pi zero, cable and board thru reputable online retailer(Adafruit) and have followed a few different tutorials to get it the pi zero up and running. When i plug in the camera and try the demo from here:
from picamera import PiCamera
from time import sleep

camera = PiCamera()

camera.start_preview()
sleep(10)
camera.stop_preview()
I get this:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/picamera/camera.py", line 522, in _init_camera
prefix="Failed to create camera component")
File "/usr/lib/python3/dist-packages/picamera/exc.py", line 191, in mmal_check
raise PiCameraMMALError(status, prefix)
picamera.exc.PiCameraMMALError: Failed to create camera component: Out of memory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/pi/camera.py", line 4, in <module>
camera = PiCamera()
File "/usr/lib/python3/dist-packages/picamera/camera.py", line 488, in __init__
self.STEREO_MODES[stereo_mode], stereo_decimate)
File "/usr/lib/python3/dist-packages/picamera/camera.py", line 526, in _init_camera
"Camera is not enabled. Try running 'sudo raspi-config' "
picamera.exc.PiCameraError: Camera is not enabled. Try running 'sudo raspi-config' and ensure that the camera has been enabled.
>>>

I bought a second pi and camera for thinking it could be a bad board, or that i zapped the camera with static, still get above error. Added the "force_board_rev=0x00093" to no avail. Any help is greatly appreciated.
FritzTX
The first post in this thread is pretty explicit in the symptoms of this error
If you have problems, please initially try:

Code: Select all

    vcgencmd otp_dump |grep ^30
if you get back the result "30:00000000", then I'm afraid your board falls into this category, and I'd also expect to see "cat /proc/cpuinfo | grep Revision" return 000F which is an original Pi B and used as a default.
If that is not the result you get, then force_board_rev is totally irrelevant - start a new thread.

Code: Select all

vcgencmd get_camera
is the command you really want to confirm if the camera can be seen by the GPU. If it is detected=1 but you get that error in Python then you probably haven't enabled the camera in raspi-config.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

texy
Forum Moderator
Forum Moderator
Posts: 5161
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Pi Zero not seeing camera module

Sat Jan 21, 2017 12:03 pm

Split from original thread and new thread created.
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

fritztx
Posts: 4
Joined: Sat Jan 21, 2017 3:07 am

Re: Pi Zero not seeing camera module

Sat Jan 21, 2017 8:07 pm

I should have let you know more - i read the sticky, am running Jessie Lite.
I tried the :
vcgencmd otp_dump |grep ^30
got this:
30:00920093
I enabled camera in gui, it shows enabled (radio button filled in) when i review it, but in terminal, can't seem to enable camera. I tab over <enable> and hit enter, (tried space bar too), but when I go back in, <disable> is highlighted.
And vcgencmd get_camera shows:
supported=0 detected=0
??
I still don't understand why "supported=0" is not 1.
Again I do appreciate the help and am trying to do my 'due diligence' before posting (read several posts in this forum, trying the various posted fixes before needing more help)


thx, fritztx

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Pi Zero not seeing camera module

Sat Jan 21, 2017 8:13 pm

Check you've got

Code: Select all

gpu_mem=128
start_x=1
in the active /boot/config.txt
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
rpdom
Posts: 17173
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Pi Zero not seeing camera module

Sat Jan 21, 2017 8:16 pm

Have you made any other configuration changes to the /boot/config.txt file?

I ask because I was having problems with I2C configuration recently. I enabled it via raspi-config, but it still didn't work. After a few minutes pondering I realise that was because I had added some tags for certain Pis using the [0xserial_number] format and hadn't put a [all] tag on the end. raspi-config added the I2C option to the end of the file, which meant it would only work on the Pi with the last matching serial number.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8926
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Pi Zero not seeing camera module

Sat Jan 21, 2017 8:32 pm

How old is your image? The camera configuration was only added for the Zero in April 2016, so if your image is before that then it will report supported=0
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

fritztx
Posts: 4
Joined: Sat Jan 21, 2017 3:07 am

Re: Pi Zero not seeing camera module

Sun Jan 22, 2017 3:35 pm

DougieLawson:
i checked and gpumem=128 & start_x=1

rpdom:
i added the "force_board_rev_0x00093" per a previous thread, but that may be moot.

6by9:
i purchased a preloaded micro sd with the Jessie Lite image from Adafruit. it returns this:
Linux version 4.1.19+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #858 Tue Mar 15 15:52:03 GMT 2016

If i read this right, this image is from March 2016, and I need an image after April. So i should just burn another image, with the current updated version?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8926
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Pi Zero not seeing camera module

Sun Jan 22, 2017 4:03 pm

fritztx wrote:6by9:
i purchased a preloaded micro sd with the Jessie Lite image from Adafruit. it returns this:
Linux version 4.1.19+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #858 Tue Mar 15 15:52:03 GMT 2016

If i read this right, this image is from March 2016, and I need an image after April. So i should just burn another image, with the current updated version?
Yup, that would be why. Although you may also be able to get away with "sudo apt-get update" "sudo apt-get upgrade" (or is it dist-upgrade? I never can remember as I don't use it) to update everything on your current card instead.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

fritztx
Posts: 4
Joined: Sat Jan 21, 2017 3:07 am

Re: Pi Zero not seeing camera module

Mon Jan 23, 2017 2:13 am

Yep, that was it, older image of Jessie. Got current/new image and all is fine. Since I purchased it so recently, I assumed it would be more current than it was but you know what assuming does...
A HUGE THANKS for all who offered help to this turned-out-to-be-trivial problem. Good news is I now have a second pi Zero and camera for ...
FritzTX

Return to “Camera board”