1

I'm trying to run some code and it works with the Pi Camera and the Lepton FLIR camera, but the problem is that when I try to run the code I get a bunch of error messages ending with a line that says:

Camera is not enabled. Try running sudo raspi-config

I did that and enabled the camera and then rebooted, but I continue to get the same error message. Why is this happening and how can I fix it?

  • Is the picamera module connected correctly to the RPI? – Tes3awy Aug 5 '16 at 15:25
  • Yes, it will only go in one way so I'm sure. – Crystal Pritzker Aug 5 '16 at 15:32
  • have you installed picamera for Python version you are using? – Tes3awy Aug 5 '16 at 15:36
  • You should try raspistill quickly and see if that works, or if it says the same thing. Beware the cable attachment may be finicky, you have to bury the silver lines on the correct side at both ends. – goldilocks Aug 5 '16 at 15:44
  • I ran raspistill and it didn't give me an error message. It just showed me a bunch of documentation. – Crystal Pritzker Aug 5 '16 at 15:46
0

All raspi-config does is add a few lines to /boot/config.txt:

start_x=1
gpu_mem=128

Apparently the latter (128 MB) is the minimum required, and you will get a specific (memory related) error about that otherwise. This comes out of your available RAM.

So:

  • Check if those are there and not commented out with #, or superseded by other gpu_mem (there are a few forms of that, suffixed with with a number, e.g., gpu_mem_1024 -- there should only be one) or start_x values in the file.

  • Make sure you've rebooted since they were added.

  • Make sure your firmware and kernel are reasonably up to date:

    sudo apt update
    sudo apt upgrade 
    

    Will do it although it will update everything else at the same time, which you might as well do (I'm not sure what the exact package is). If you've never done that, you should have post install and it may take a few minutes. Alternately, you could use rpi-update (sudo apt install rpi-upate, then sudo rpi-update) to pull just the kernel, modules, and firmware but beware this puts you ahead of the Raspbian default and may be a minor gamble. It's never caused me any grief, but the former method (update the system completely via apt update then upgrade) is preferrable. You'll have to reboot after this too regardless of which technique you use.

If all that is done and the camera is properly connected, but raspistill doesn't work, something is busted.

  • I did the second two things you've listed, but I didn't fully understand what you mean. I ran nano /boot/config.txt and found the two lines you mentioned. They're not commented out but other lines in the file are commented out. Is that okay? I didn't fully understand what you were trying to say. – Crystal Pritzker Aug 8 '16 at 14:20
  • There's lots of stuff in that file that's commented out (including the actual comments), that's fine. But those lines should not be and should be what's shown above (gpu_mem could be higher but not lower). By "superseded" I meant make sure the lines are not listed (uncommented) more than once, and that you should beware of the fact that gpu_mem has a couple of other potential forms: github.com/raspberrypi/documentation/blob/master/configuration/… – goldilocks Aug 8 '16 at 14:33
  • If you haven't messed with that file or installed software that does, this should all be in order, just it does not hurt to double check if something isn't working right. An easy way to do that is grep start_x /boot/config.txt and grep gpu_mem /boot/config.txt. Remember, if it's part of a comment or commented out it doesn't matter. If all that's done and you are using a current kernel and firmware, raspistill should work. – goldilocks Aug 8 '16 at 14:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.