Raspberry pi camera not working


#1

This is on the raspberry pi 1 B with the v2 official pi camera. It says no camera detected, but I have had it working on raspbian using raspistill -o image.jpg. USB camera works like a dream, but on the raspberry pi 1, it has two USB ports so one for the printer and one for the wifi adapter and no room for the USB camera, which is why I need to use the raspberry pi camera. I have tried increasing the memory split from 64 to 128, no difference. I have tried octoprint, same issue. When I found out that you can run astroprint without a hotspot (https://astroprint.zendesk.com/hc/en-us/articles/207866186-Can-I-configure-the-Raspberry-Pi-network-myself-) I thought why not use astroprint? but to my dismay, still no working camera. Please help.


#2

What’s the result of:

sudo lsmod

Do you see the bcm2835_v4l2 driver in there?


#3
Module                  Size  Used by
cfg80211              525742  0
rfkill                 21373  1 cfg80211
bcm2835_gpiomem         3791  0
fixed                   3029  0
uio_pdrv_genirq         3718  0
uio                    10166  1 uio_pdrv_genirq
v4l2_common             6285  0
videobuf2_vmalloc       5849  0
videobuf2_memops        1939  1 videobuf2_vmalloc
videobuf2_v4l2         16841  0
videobuf2_core         31781  1 videobuf2_v4l2
videodev              177702  3 v4l2_common,videobuf2_core,videobuf2_v4l2
media                  28994  1 videodev
ipv6                  384468  20

Can’t see exactly bcm2835_v4l2 driver but there are some similar things but I don’t know if they’re the right things.


#4

That’s the problem. What image did you flash ?


#5

The problem is that the raspberry pi camera is not being detected and astroprint image is AstroBox-rpi-0_10_9-20170907.


#6

Yes, it’s not being detected because we only support V4L2 compatible cameras. The Rpi Camera needs an additional driver (bcm2835_v4l2) to be compatible. It’s possible that the latest image which is the one you mentioned doesn’t include it by default. We’ll fix that on the next image. In the meantime, you can install it yourself:

  1. Edit the file /etc/modules
  2. add bcm2835-v4l2 to the end of it
  3. save & reboot

#7

When I opened that file to edit it (sudo nano /etc/modules) It appears to have bcm2835-v4l2 on the end of it already:

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

bcm2835-v4l2

#8

Yes, that’s the way it should be but wanted to make sure it was there in yours. I wonder if the last version of raspbian removed the driver all together… I need to investigate more.


#9

Friend check here also maybe it helps you: https://www.raspberrypi.org/forums/viewtopic.php?t=84000


#10

I’m on an RPi3, and I just bought a V2 camera on the naive assumption that AstroPrint supported it (given the glaring “Camera” icon). I even printed a new RPi case to mount on my printer.

Oh, the Disappointment.

I haven’t paid a dime for any of your services, so my annoyance is largely inconsequential. However, it appears form the discussion that this is some kind of driver problem that could be fixed with an update. I just installed the latest AstroPrint update, so I’m assuming that update did not include a fix for this or the fix did not address my particular issue.

Has there been any movement on this bug?


#11

Sorry about that. We have focused on USB cameras more as they’re more versatile and have cheaper options.

At the moment we’re busy getting the AstroBox touch ready and all other issues are taking a back seat. We will retake this in the coming year once the AstroBox touch and a few other priorities are out of the way.

Thanks for using AstroPrint and Happy New Year


#12

I also have a RaspPi III, and a V2 camera.
Before the latest update I was able to select 1920x1080 resolution, now Astroprint denies me this option, and only allows 720p stating my camera doesn’t support HD - which is not correct of course.


#13

What version did you previously have?


#14

it’s seems the startup procedure is not correct for astroprint to control the raspi cam
we have the same problem even if enable the raspi camera from rapsi-config
but got it work with the following sequence :-1:

from astroprint

  1. select rapi camera
  2. go to video stream < ---- must not work
  3. select snapshot and take photo <---- can take picture from raspi-cam
  4. select stream again, it will work :smile:
  5. if not, select usb camera and repeat step 2

this is my case on Pi3, with different version of raspi-camera


#15

Ah, one sec. if the camera takes photos but no video we also need to look at webrtc compatibility. What browser are trying to see th video on?


#16

im also having problem with the Raspberry Pi NoIR Camera Module V2 the camera works just when i select 1080p it says that this resolution isnt supported by your camera and it is. 720P works but not 1080P on the newest release.


#17

It would be related to how the camera reports its supported modes. What does running this command output:

v4l2-ctl --list-formats-ext -d /dev/video0

#18

Type : Video Capture
Pixel Format: 'UYVY’
Name : UYVY 4:2:2
Size: Stepwise 32x32 - 3280x2464 with step 2/2

    Index       : 9
    Type        : Video Capture
    Pixel Format: 'NV12'
    Name        : Y/CbCr 4:2:0
            Size: Stepwise 32x32 - 3280x2464 with step 2/2

    Index       : 10
    Type        : Video Capture
    Pixel Format: 'BGR3'
    Name        : 24-bit BGR 8-8-8
            Size: Stepwise 32x32 - 3280x2464 with step 2/2

    Index       : 11
    Type        : Video Capture
    Pixel Format: 'YV12'
    Name        : Planar YVU 4:2:0
            Size: Stepwise 32x32 - 3280x2464 with step 2/2

    Index       : 12

#20

Ugh! it’s giving a range… We’ll need to make changes to support this.


#21

It seems as if a completely different issue has taken control of this issue, so i’m going to try and gain back the original issue.

That did help me a lot. I’m going to make a step by step guide on how to get the webcam stream from raspi cam working.

  1. Install astroprint as you would normally

  2. Run
    sudo apt-get update
    sudo apt-get install git-core
    cd
    git clone git://git.drogon.net/wiringPi
    cd ~/wiringPi
    git pull origin
    cd ~/wiringPi
    ./build
    That will get WiringPi good to go

  3. Now run
    nano camerafix.sh
    Then paste

    #!/bin/bash
    gpio -g mode 0 in
    gpio -g mode 1 in
    gpio -g mode 28 alt0
    gpio -g mode 29 alt0

    or (I havn’t tested this one yet)

    #!/bin/bash
    gpio -g mode 0 in
    gpio -g mode 1 in

    Then press Contol+X then Y then Enter

  4. Now you run chmod +x camerafix.sh and then go to the web interface camera page and you will see that there is now a nice blue button that says ‘Start Streaming Video’ !

  5. I think you need to do this every time you start it up so now to make it run at startup, run sudo nano /etc/rc.local and at the line just above exit 0 put the command from number 4 there so it should look like this:

    -#
    -# By default this script does nothing.

    -# Print the IP address
    -_IP=$(hostname -I) || true
    -if [ “$_IP” ]; then
    -printf “My IP address is %s\n” “$_IP”
    -fi
    -chmod +x camerafix.sh
    -exit 0

    Then press Contol+X then Y then Enter

I have done this and it 100% works. Don’t know how it would be possible to fix in the software itself. Also, how can I make a timelapse?