Raspberry pi camera not working


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


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


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


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
    git clone git://git.drogon.net/wiringPi
    cd ~/wiringPi
    git pull origin
    cd ~/wiringPi
    That will get WiringPi good to go

  3. Now run
    nano camerafix.sh
    Then paste

    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)

    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”
    -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?


will try this tomorrow thanks for the tutorial dude , ill feedback my results


didnt work for me :frowning:

Raspberry Pi Camera Problems
Index       : 4
Type        : Video Capture
Pixel Format: 'H264' (compressed)
Name        : H.264
	Size: Stepwise 32x32 - 2592x1944 with step 2/2

Is it possible to force a resolution? Should a feature request be added to support video resolution ranges?


To get my Raspicam to work (was a fresh install), i had to do following:
Update to the latest Version and reboot

sudo raspi-config
  • 5 - Interfacing Options Configure connections to peripherals
  • P1 - Camera Enable/Disable connection to the Raspberry Pi Camera
  • <yes>


Thanks for that. For some reason it must have been disabled because this fixed it. A bit weird as I built an identical cam and pi3 with Octoprint and it worked without needing to do that. I am trying Astro as Octoprint constantly looses comms with my CR10.


The OctoPi image might enable raspicam by default. We don’t because only a small portion of our users use it and enabling it reduces the amount of RAM memory available to the software.


Hi I was wondering if this has beed solved already? Im having the same problem, not possible to change to the highest res with pi cam v2.


I have Raspberry pi B+ with raspicam and the video streaming was working since Astrobox version 0.9(x) but the recent updates broke it.

After some debugging it appears the janus gateway is crashing with Segmentation fault and the web interface would display Unable to start the WebRTC system and you are left with a janus zombie process.

So I end up recompile my own janus gateway and now my video streaming is working even better than before. I am currently running Astrobox 0.12(5)

an easy way to check is to run command ‘ps -ef | grep janus’ and see if you have an zombie janus process with the AstroBox python as it’s parent after you fail to stream video.

I followed this guide to compile janus 0.2.6

Here is my steps to fix this.

$ sudo aptitude install libmicrohttpd-dev libjansson-dev libnice-dev libssl-dev libsrtp-dev libsofia-sip-ua-dev libglib2.0-dev libopus-dev libogg-dev libini-config-dev libcollection-dev pkg-config gengetopt libtool automake dh-autoreconf

$ sudo aptiude install lua5.3-dev libsrtp2-dev

$ wget https://github.com/meetecho/janus-gateway/archive/v0.2.6.tar.gz

$ tar zxvf v0.2.6.tar.gz

$ cd janus-gateway-0.2.6

$ sh autogen.sh

$ ./configure --disable-websockets --disable-data-channels --disable-rabbitmq --disable-docs --prefix=/opt/janus

$ make

$ sudo make install

$ sudo make configs

Next is to back up /usr/bin/janus, /etc/astrobox/janus/janus.cfg /etc/astrobox/janus/janus.cfg.local

$ sudo mv /usr/bin/janus /usr/bin/janus.org

$ sudo ln -s /opt/janus/bin/janus /usr/bin/

update the janus.cfg and janus.cfg.local to point plugins_folder, transports_folder and events_folder to /opt/janus/lib/janus folders respectively

un-comment log_to_file (as the logging is not disabled for this compile).

When I run the janus directly, there is no more Segmentation fault. and my video stream is working after rebooting the raspberry pi.


Did this work for the video stream through the Android app? I was able to get the video stream working through the web interface in Chrome but still doesn’t work via the mobile app.


I have not tried Android app but streaming for the monitor in my astroprint cloud account is still broken. So I assuming there is something wrong with the stun server function still.


By the way, it turns out the root cause of my issue is that the current available janus package from the astroprint repository (0.2.5-1) simple crash on my Raspberry Pi B+. It actually did not have anything to do with astroprint software. and even when I tried to downgrade, I could not found a different version janus package on astroprint repository that used to work.

Also, STUN server required use of websockets transport, but this was disabled from my initial compile so that’s why the remote monitor function does not work.

I tried to build again from the previous build directory by running

$ sudo apt update
$ sudo apt install libcurl4-openssl-dev libwebsockets-dev cmake
$ make clean
$./configure --disable-data-channels --disable-rabbitmq --disable-docs --prefix=/opt/janus
$ make
$ sudo make install
and now the remote monitor is also working.

P.S. when you upgrade astroprint software. it would also overwrite the janus.cfg and janus.cfg.local in /etc/astrobox/janus/ and break this fix. Make a copy of the working janus.cfg and janus.cfg.local and put it back. The only changes I had to make is the make sure the plugins_folder, transports_folder and events_folder are point to the right locations where you compiled and not the system ones (i.e. /opt/janus/lib/janus)


This fix the problem for me too.


Buenos dias, Daniel por casualidad hay alguna solucion al problema de la resolucion de la camara de raspberry seria muy bueno poder usarla en fullHD


Hi, I am also having issues with my USB camera.
I am getting this error when trying to stream the video:
dmesg output:
[ 104.722067] uvcvideo: Failed to query (130) UVC probe control : -32 (exp. 26).
[ 109.751523] uvcvideo: Failed to set UVC probe control : -110 (exp. 26).
I have the bcm2835_v4l2 driver loaded also.
Any ideas?


I am using Raspi Cam v1, and the camera is no longer recognized as present. I believe it was 0.16.2 that broke it. I did try raspi-config, disabling, re-enabling and reboot. That didn’t help.

I believe 0.15.0 worked, but don’t have a backup image of that. I’m trying to determine exactly what level broke it. Restoring to a backup of 0.14.0 fixes the camera. How do I update to something earlier than 0.16.2 without doing a clean re-flash? Settings/Software/Update only presents the latest level.


I am using 16.2 and haven’t been able to start a stream. I can record through ssh, but stream won’t start in Chrome or Firefox. Has anyone got it to work in 16.2?