Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with Octopi on Raspberry Pi B+ and Pi Camera #31

Closed
carbuthn opened this issue Jul 26, 2014 · 30 comments
Closed

Problem with Octopi on Raspberry Pi B+ and Pi Camera #31

carbuthn opened this issue Jul 26, 2014 · 30 comments
Labels

Comments

@carbuthn
Copy link

Just purchased and waiting for Mini Kossel to come in. I purchased a Raspberry Pi B+ to drive it and downloaded Octopi image (6-20-14) from Github.

I installed a Pi camera and tried to run Raspistill to test camera but get error messages.

  • 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: Filed to run camera app. Please check for firmware updates.

The camera works with the normal Raspian image. I have not tried building form the raspian image, fairly new at programing in the Linux environment.

I have re- downloading the Octopi image, same results.

Do you have any suggestion?

Thanks for your time, and for the effort that you put into this software. It is appreciated. I look forward to trying Octopi out on a new printer.

Chuck

@guysoft
Copy link
Owner

guysoft commented Jul 26, 2014

  1. What power source are you using? Make sure its a good power supply and usb cable, thats the number 1 cause
  2. @foosel , have you tried the pi camera with the B+?

@carbuthn
Copy link
Author

I am using a 2 amp power supply with a working cable.

Using the same card, camera, cable and B+ raspberry pi it work correctly with the plain Raspian 6-20-14 image, if I down power swap to the Octopi image I get errors.

I did try it with a lab grade bench power supply, same problems.

Chuck

@foosel
Copy link
Collaborator

foosel commented Jul 27, 2014

@guysoft Yes, I did. LED didn't come on, but I got an image in OctoPrint and timelapsing worked too

@floville
Copy link

@carbuthn: have you enabled the pi cam in the basic config menu at first start? I think no, because your error message is: "camera component could not be enabled"

@guysoft
Copy link
Owner

guysoft commented Jul 27, 2014

@floville That is not required, OctoPi comes with camera enabled out of the box (this line takes care of it https://github.com/guysoft/OctoPi/blob/devel/src/chroot_script#L109)

@guysoft
Copy link
Owner

guysoft commented Jul 27, 2014

@carbuthn Have you rebooted a to make sure it keeps happening? In this forum post someone is reporting exactly these errors, and claims it happens because the camera or board are in a 'dodgy state', and rebooting fixed the issue: http://www.raspberrypi.org/forums/viewtopic.php?p=360945#p360945

@floville
Copy link

Ok, it´s my first experience with raspberry and linux, but i have the new raspberry b+ und with connected raspberry pi cam and it works fine with octopi 0.9.0.

Is it possible a connection error? the ribbon cable can be easily wrong assembled.

@guysoft
Copy link
Owner

guysoft commented Jul 28, 2014

@floville
I did not understand your last reply.

  1. You wrote "but I have a new raspberrypi b+" - that's 'but' is not contradicting anything in the sentence.
  2. Guessing the ribbon cable is at fault, or any hardware matter for that sake, is just a wild guess. @carbuthn wrote already the camera works on plain raspbian, ruling out most hardware problems, including the camera connection.

Please be more clear.

@floville
Copy link

@guysoft: Please take a little considerate, my english is not the best. I just wanted to say that it has nothing to do with the new pi b+.

@carbuthn
Copy link
Author

Thanks for the responses, I have a second B+ with different camera and power supply. I will download the Octopi image again to make sure that I get a good download and try it later tonight.

@guysoft
Copy link
Owner

guysoft commented Aug 10, 2014

Unless you have any updates, I am closing this

@carbuthn
Copy link
Author

I have 2 separate cards and cameras but haven’t been able to get the PI Camera to work. I must be doing something wrong. Will try again once my printer arrives. Thanks for the help.

Chuck

From: Guy Sheffer [mailto:notifications@github.com]
Sent: Sunday, August 10, 2014 9:56 AM
To: guysoft/OctoPi
Cc: carbuthn
Subject: Re: [OctoPi] Problem with Octopi on Raspberry Pi B+ and Pi Camera (#31)

Unless you have any updates, I am closing this


Reply to this email directly or view it on GitHub #31 (comment) . https://github.com/notifications/beacon/3123351__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyMzI5ODEzMiwiZGF0YSI6eyJpZCI6MzgwNzgwMjF9fQ==--667d969e16e45278a8c90f2d0d844feca99c96a0.gif

@guysoft guysoft added the bug label Aug 15, 2014
@Cribstone
Copy link

I have an PiCam and both RPi models and neither the camera or the serial port connection seems to work in the B+. Running dmesg confirms the USB is connected to ttyACM0, and I tried adding the user "pi" to the dialout etc... and nothing would work. When I used the MicroSD card from the B+ in an adapter, I was able to run the same image in the older RPi for which both the camera and serial connection worked without issue.

@jmpattillo
Copy link

Hello Guy,

Just wanted to add my voice to this. I'm having exactly the same problem as carbuthn. The camera module works just fine with latest Raspian image (tested using raspistill). However, when I instead load the lasted Octopi distro, I get the error messages listed above. I've tried both on a model B, and also a B+, and both have the same issue. I have a 2 amp power supply. The led on the camera module comes on (and it works on Raspian), so I don't think the problem is with the cable.

@guysoft
Copy link
Owner

guysoft commented Aug 28, 2014

Hey @jmpattillo and @carbuthn ,
I have two other things you can try.
It seems like someone reported a similar issue on Stack Exchange.

  1. You can try setting to memory from 128 to 256. And see if that helps.
    You can do this by changing gpu_mem=128 to gpu_mem=256 at /boot/config.txt
  2. You can add bcm2708.w1_gpio_pin=18 at the end of the line of boot.txt as shown in the stack exchange link.

Please update if that helps, if so we can introduce changes to the upcoming version of OctoPi.

@jmpattillo
Copy link

Hey @guysoft
Unfortunately, neither one of these solutions worked. A little bit more detail about how I tested this in case it will help. I first loaded Raspbian and Octopi (both 6-20 versions) on two different microSD cards (same brand and 4gb capacity). I confirmed that the camera was working by booting a B+ pi with Raspbian and taking a picture with raspistill from the command line. I then shutdown and switched to Octopi and repeated the same raspistill test. I got the same error sequence that @carbuthn mentioned. Other than the changes you suggested, the only other change I made was to expand the disk system on each card.

Thanks for you help. -John
P.S. I added the gpio pin change to the end of /boot/cmdline.txt I assumed that is what you meant.

@jmpattillo
Copy link

@guysoft I forgot to mention another possible clue. During the bootup of Octopi, the bootup verbose output "hangs" after the last line indicating the startup of mjpg_streamer:

DBG(/home/pi/mjpg_streamer/plugins/input_raspicam/input_raspicam.c, worker_thread(), 880): Starting video output

That line will just sit there. The login will not come up unless I hit Enter. This may be significant, or I could just be displaying my ignorance.

@guysoft
Copy link
Owner

guysoft commented Aug 28, 2014

@jmpattillo Did you try other solution of increasing the memory to 256? You will need to change part of the line at cmdline.txt

@jmpattillo
Copy link

@guysoft I changed the GPU memory to 256 by editing config.txt, and added bcm2708.w1_gpio_pin=18 to the end of cmdline.txt. I rebooted (of course), but neither solution worked. This seems pretty strange to me, exact same hardware and software, but different results. I would suspect that there is maybe something very strange wrong with my camera module, but @carbuthn indicated that he had tried two different camera modules.

@foosel
Copy link
Collaborator

foosel commented Aug 28, 2014

I'll see if I can reproduce this tomorrow. Just to make sure, used image is
OctoPi 0.9.0 (from june 20th)?

@jmpattillo
Copy link

Yes @foosel I used OctoPi 0.9.0 The raspbian image I used on the other card was also from June 20th. Thanks for your help.

@jmpattillo
Copy link

I figured it out I think. There is a conflict between mjpg_streamer and raspistill. I was using raspistill to test that my camera was properly installed. If I kill mjpg_streamer, the raspistill will work. mjpg_streamer then restarts itself after a couple of minutes.

Update: Yep, that was it. Everything works now. Sorry for the confusion, and thanks for the help.

@foosel
Copy link
Collaborator

foosel commented Aug 29, 2014

I was just going to post this I quickly whipped up (fresh install of vanilla octopi 0.9.0, B+ board and RaspiCam, all default settings, nothing modified at all) but apparently you found your issue ;)

In general: That camera is not something that can have shared access -- it's either the mjpg_streamer daemon that ships per default with OctoPi and gets automatically started on bootup, or it's something else like raspistill. If you run one, the other will fail. To test if your setup works, simply switch to the control tab in OctoPrint - it will show the camera's image if it could be properly detected, no need to fiddle around on the command line.

@guysoft I assume you can close this now since after rereading the initial issue up above it sounds like that is the same trap @carbuthn ran into.

@carbuthn
Copy link
Author

Thanks Guy, Gina & jmpattillo,

I will try this also as soon I find the right box of stuff (moving and everything is packed up). Sound like that should fix my setup as well. Will also change the memory setting and add bcm2708.w1_gpio_pin=18.

Chuck

From: Gina Häußge [mailto:notifications@github.com]
Sent: August 29, 2014 3:16 AM
To: guysoft/OctoPi
Cc: carbuthn
Subject: Re: [OctoPi] Problem with Octopi on Raspberry Pi B+ and Pi Camera (#31)

I was just going to post this https://www.youtube.com/watch?v=EIs7uMK-Ng0 I quickly whipped up (fresh install of vanilla octopi 0.9.0, B+ board and RaspiCam, all default settings, nothing modified at all) but apparently you found your issue ;)

In general: That camera is not something that can have shared access -- it's either the mjpg_streamer daemon that ships per default with OctoPi and gets automatically started on bootup, or it's something else like raspistill. If you run one, the other will fail. To test if your setup works, simply switch to the control tab in OctoPrint - it will show the camera's image if it could be properly detected, no need to fiddle around on the command line.

@guysoft https://github.com/guysoft I assume you can close this now since after rereading the initial issue up above it sounds like that is the same trap @carbuthn https://github.com/carbuthn ran into.


Reply to this email directly or view it on GitHub #31 (comment) .Image removed by sender.

@guysoft guysoft closed this as completed Aug 31, 2014
@nkdurrett
Copy link

@foosel what would be the next step if when you boot up the fresh install of octopi 0.10.0,switch to the control tab and do not have video. The red light on the raspberry camera is lit but i am getting no video.

@guysoft
Copy link
Owner

guysoft commented Nov 23, 2014

@nkdurrett Not sure about B+, but did you check your powers supply is 2A and you are using a GOOD usb cable (just because it says 2A on it does not mean it is). That tends to be the common problem.

@nkdurrett
Copy link

yeah ive checked all of that and i am still getting error messages. I have
been doing searches for over a week now and cant find a solution.

On Sun, Nov 23, 2014 at 2:59 AM, Guy Sheffer notifications@github.com
wrote:

@nkdurrett https://github.com/nkdurrett Not sure about B+, but did you
check your powers supply is 2A and you are using a GOOD usb cable (just
because it says 2A on it does not mean it is). That tends to be the common
problem.


Reply to this email directly or view it on GitHub
#31 (comment).

@AnHardt
Copy link

AnHardt commented Dec 1, 2014

There is a small connector between the actual camera and the PCB its
mounted on. Check this!
I have a housing for the camera what's permanently tilling this connector.

Am 23.11.2014 06:54, schrieb nkdurrett:

@foosel https://github.com/foosel what would be the next step if when
you boot up the fresh install of octopi 0.10.0,switch to the control tab
and do not have video. The red light on the raspberry camera is lit but
i am getting no video.


Reply to this email directly or view it on GitHub
#31 (comment).

@hanifizzudinrahman
Copy link

Hello brother, finally i can solve this problem after a lot of hours troubleshooting.

I already share it in my YouTube (https://youtu.be/on8UlkRvLok)

This problem only occur in camera raspberry pi V2.1 (IMX219) from Element14. But in camera raspberry pi V2.1 from OKdo, i don't get this error

So, the solution when error
"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"

You need some initialization with a works camera (me camera from OKdo).
So, the step is

  1. Plug your works camera to Raspberry Pi (me using Raspberry Pi 4B)
  2. Turn on your Raspberry Pi
  3. check vcgencmd get_camera to make sure your hardware is detected the camera
  4. capture image using raspistill -v and camera will capture the image
  5. Then replace the works camera with ENOSPC Error Camera (from Element14)
  6. then try to capture the image raspistill -v and the ENOSPC Error will not occur

Notes:

  • But, after the ENOSPC Error Camera works, and then you restart/shutdown the raspberry pi, the error will occur again :(

OS Raspberry Pi 4 Model B (4GB)

  • Linux raspberrypi 5.10.60-v7l+ #1449 SMP Wed Aug 25 15:00:44 BST 2021 armv7l GNU/Linux

@guysoft
Copy link
Owner

guysoft commented Sep 12, 2021

Hey @hanifizzudinrahman this issue is from 2014. The RaspberryPi 2.1 was released in 2016 source: https://www.raspberrypi.org/documentation/accessories/camera.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants