B+ Camera is not detected (workaround available)


 
84 posts   Page 2 of 4   1, 2, 3, 4
by Art60 » Sun Aug 10, 2014 9:51 am
Hi all,
May I tell you my own story ?
CS mount camera module is well plugged into CSI connector, correctly enabled in raspi-config and though isn't detected on my B+ board
As I read here and there, everything should work.
I've been verifying raspi-blacklist.conf and none of the two lines spi or i2c are commented out.
A friend of mine which got both revB and revB+ boards confirms that his CS camera doesn't work either on RPi B+

What I had been testing is that the very first time raspistill runs, the camera LED blinks shortly then never again after.
Wandering around GPIO pin # assignment, I succeeded in lighting the camera LED by running the following Python file:
Code: Select all
#!/usr/bin/env python
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(41,GPIO.OUT,initial=True)
How come the CAM_GPIO signal moved to #41?
This doesn't help in running rapsistill either...
Running
Code: Select all
vcgencmd get_camera

still results in supported=1 detected=0

Does it help in finding a common solution?

Thank you for your inputs.
Rpi B+ rev 1.2
CS mount camera module
Raspbian
User avatar
Posts: 8
Joined: Sun Aug 10, 2014 9:20 am
Location: near Paris, France
by ShiftPlusOne » Mon Aug 11, 2014 9:30 am
Install wiringpi. http://wiringpi.com/download-and-install/
Create camerafix.sh with the following:
Code: Select all
#!/bin/bash
gpio -g mode 0 in
gpio -g mode 1 in
gpio -g mode 28 alt0
gpio -g mode 29 alt0

Run
Code: Select all
chmod +x camerafix.sh

Then running
Code: Select all
./camerafix.sh
will make the camera work again. Not the prettiest, but a workaround for now.

Edit: and of course there's a pythonese way to do it, Im just not of that persuasion.
Last edited by ShiftPlusOne on Mon Aug 11, 2014 11:10 am, edited 1 time in total.
Reason: typo
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 3817
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy
by ShiftPlusOne » Mon Aug 11, 2014 10:54 am
Upon further inspection just this should do it:
Code: Select all
gpio -g mode 0 in
gpio -g mode 1 in


Here's what the actual problem is https://github.com/raspberrypi/linux/bl ... 708.c#L112
The assumptions there are just wrong. Pinctrl should be used, but it's not available yet.

That module should not touch I2C0 at all (I2C1 in the case of rev1 boards).
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 3817
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy
by Art60 » Mon Aug 11, 2014 11:08 am
ShiftPlusOne wrote:(...) running ./camerafix.sh will make the camera work again. Not the pretties, but a workaround for now.

Hi,
Very interesting but this doesn't work for me, sorry.

Question: are your changes permanent?
Do I have something to do in order to get my system back to its previous state?

Thank you very much, anyway!
Rpi B+ rev 1.2
CS mount camera module
Raspbian
User avatar
Posts: 8
Joined: Sun Aug 10, 2014 9:20 am
Location: near Paris, France
by ShiftPlusOne » Mon Aug 11, 2014 11:14 am
Art60 wrote:
ShiftPlusOne wrote:(...) running ./camerafix.sh will make the camera work again. Not the pretties, but a workaround for now.

Hi,
Very interesting but this doesn't work for me, sorry.

Question: are your changes permanent?
Do I have something to do in order to get my system back to its previous state?

Thank you very much, anyway!


Did you restart before trying again?
The first time you try to use the camera, the firmware will detect what's attached and save it in memory. If nothing is detected the first time, then it won't ever be detected until you reboot.

The changes will stick until something else comes along and changes with pin functions or when you reboot. There's no real reason to return to the previous state, since it's invalid.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 3817
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy
by Art60 » Mon Aug 11, 2014 11:22 am
Following your suggestion, At I just had a
Code: Select all
sudo shutdown -r now
then a
Code: Select all
raspistill -v -o test.jpg
that led to an ENOMEM error.
Code: Select all
vcgencmd get_camera
displays
Code: Select all
supported=1 detected=0

I then tried to put the camera LED on first with my previous
Code: Select all
GPIO.setup(41,GPIO.OUT,initial=True)
with no luck either.

Any ideas?

Should I have run
Code: Select all
./camerafix.sh
each time I reboot?
Rpi B+ rev 1.2
CS mount camera module
Raspbian
User avatar
Posts: 8
Joined: Sun Aug 10, 2014 9:20 am
Location: near Paris, France
by ShiftPlusOne » Mon Aug 11, 2014 11:33 am
Oh, actually I missed important detail in your first post. This fix is to be able to use the I2C module and your camera at the same time. Your issue seems completly unrelated.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 3817
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy
by ShiftPlusOne » Mon Aug 11, 2014 11:35 am
Could you give the output of the following commands:
Code: Select all
cat /boot/config.txt
vcgencmd version
vcgencmd get_mem arm
vcgencmd get_mem gpu
cat /proc/cpuinfo
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 3817
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy
by Art60 » Mon Aug 11, 2014 11:45 am
Sorry, I thought my problem could be related to this one, that's why I wrote in the same thread.

For me to answer your question, I have to learn how to copy and paste within RPi and I'm a real newbie, please hold on a second...
Thx ;)
Rpi B+ rev 1.2
CS mount camera module
Raspbian
User avatar
Posts: 8
Joined: Sun Aug 10, 2014 9:20 am
Location: near Paris, France
by ShiftPlusOne » Mon Aug 11, 2014 11:56 am
Until you figure the rest out, could you tell me what the date you get back from vcgencmd version is?
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 3817
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy
by Art60 » Mon Aug 11, 2014 12:01 pm
ShiftPlusOne wrote:Could you give the output of the following commands:
Code: Select all
cat /boot/config.txt
vcgencmd version
vcgencmd get_mem arm
vcgencmd get_mem gpu
cat /proc/cpuinfo

Code: Select all
cat /boot/config.txt

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# for more options see http://elinux.org/RPi_config.txt

# NOOBS Auto-generated Settings:
hdmi_force_hotplug=1
config_hdmi_boost=4
overscan_left=24
overscan_right=24
overscan_top=16
overscan_bottom=16
disable_overscan=0
start_x=1
gpu_mem=128
Code: Select all
vcgencmd version

Jun 18 2014 18:43:44
Copyright (c) 2012 Broadcom
version 1a6f79b82240693dcdb9347b33ab16f656b5f067 (clean) (release)
Code: Select all
vcgencmd get_mem arm

arm=384M
Code: Select all
vcgencmd get_mem gpu

gpu=128M
Code: Select all
cat /proc/cpuinfo

processor   : 0
model name   : ARMv6-compatible processor rev 7 (v6l)
Features   : swp half thumb fastmult vfp edsp java tls
CPU implementer   : 0x41
CPU architecture: 7
CPU variant   : 0x0
CPU part   : 0xb76
CPU revision   : 7

Hardware   : BCM2708
Revision   : 0010
Serial      : 00000000e0af548d
Rpi B+ rev 1.2
CS mount camera module
Raspbian
User avatar
Posts: 8
Joined: Sun Aug 10, 2014 9:20 am
Location: near Paris, France
by ShiftPlusOne » Mon Aug 11, 2014 12:06 pm
Run sudo rpi-update, reboot and see if it works then.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 3817
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy
by Art60 » Mon Aug 11, 2014 12:08 pm
ShiftPlusOne wrote:Until you figure the rest out, could you tell me what the date you get back from vcgencmd version is?

The problem was I was running two separate machines and I couldn't figure out how I could copy & paste between them :lol:
Now I'm running a web browser inside the RPi, copy & pasting is so easier between terminal & browser windows ;)
Concerning the date, i had an update and upgrade this morning, I think I got the latest version available : Jun 18 2014
Code: Select all
sudo rpi-update
is running...
Thank you for your time and patience :)
Rpi B+ rev 1.2
CS mount camera module
Raspbian
User avatar
Posts: 8
Joined: Sun Aug 10, 2014 9:20 am
Location: near Paris, France
by Art60 » Mon Aug 11, 2014 12:30 pm
SOLVED :D
Immediatley after reboot, I may run
Code: Select all
vcgencmd get_camera
that gives
Code: Select all
supported=1 detected=1
I don't need to do anything else in order to have raspistill to work.
I don't know why I didn't go further with the possible updates.
Sorry for having polluted the original thread.
And thank you very very much!
Rpi B+ rev 1.2
CS mount camera module
Raspbian
User avatar
Posts: 8
Joined: Sun Aug 10, 2014 9:20 am
Location: near Paris, France
by ShiftPlusOne » Mon Aug 11, 2014 12:32 pm
No worries, have fun.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 3817
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy
by Gecko2903 » Mon Aug 11, 2014 1:37 pm
ShiftPlusOne wrote:Install wiringpi. http://wiringpi.com/download-and-install/
Create camerafix.sh with the following:
Code: Select all
#!/bin/bash
gpio -g mode 0 in
gpio -g mode 1 in
gpio -g mode 28 alt0
gpio -g mode 29 alt0

Run
Code: Select all
chmod +x camerafix.sh

Then running
Code: Select all
./camerafix.sh
will make the camera work again. Not the prettiest, but a workaround for now.

Edit: and of course there's a pythonese way to do it, Im just not of that persuasion.


So is this a solution to the mmal error issue - Received unexpected camera control callback event, 0x4f525245
Posts: 11
Joined: Sun Aug 10, 2014 6:28 pm
by ShiftPlusOne » Mon Aug 11, 2014 1:43 pm
Gecko2903 wrote:So is this a solution to the mmal error issue - Received unexpected camera control callback event, 0x4f525245

Nope, that issue was not mentioned in this thread at all.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 3817
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy
by k6rtm » Mon Aug 11, 2014 3:42 pm
Up and running with camera and I2C -- many thanks!
Posts: 16
Joined: Thu Sep 27, 2012 8:50 pm
by randName » Thu Aug 14, 2014 3:09 am
I'm a little confused; mine is the original problem (I2C & camera), and I'm not sure where should I be running camerafix.sh.

The modules are loaded way before login, and the error is already present, so I'm assuming it is anytime during login. However, vcgencmd still gives detected=0, and if I modprobe it still gives "operation not permitted". Rebooting just brings me back to square 1.

Is there a certain order of entries in /etc/modules?

(And yes, I have checked, my camera works fine with my B. It's just B+ and I2C)
Posts: 1
Joined: Thu Aug 14, 2014 2:57 am
by Art60 » Thu Aug 14, 2014 3:28 pm
Hi,

Sure you got the very latest drivers (rpi-update) ?
That's what was preventing me from running my PiCam...
Rpi B+ rev 1.2
CS mount camera module
Raspbian
User avatar
Posts: 8
Joined: Sun Aug 10, 2014 9:20 am
Location: near Paris, France
by ShiftPlusOne » Thu Aug 14, 2014 4:10 pm
You run camerafix any time after the i2c module is loaded, but before you run vcgencmd or try to access the camera.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 3817
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy
by RichShumaker » Thu Aug 14, 2014 5:27 pm
AndrewS wrote:
ShiftPlusOne wrote:I'm thinking there should be a camera Troubleshooting/FAQ thread which gives you a checklist of things to run through before starting a camera support thread and what information you should provide when you do. Not sure that I know enough to do that though.

Rather than create a specific thread, you could simply add more info to http://www.raspberrypi.org/documentatio ... /camera.md ? ;)

On the documentation page can users add to it?
I wanted to see some picture of the ribbon cable correctly and incorrectly seated and the correct direction of the cable installed correctly.
When the first camera ribbon cable install pictures were put up on the Pi blog I think I looked at them 20 times one day to make sure I did the connection correctly.
Thanks for all your help.
Rich Shumaker
User avatar
Posts: 131
Joined: Tue Jul 31, 2012 4:16 pm
Location: Sunny Southern CA near downtown LA
by RichShumaker » Thu Aug 14, 2014 5:33 pm
RichShumaker wrote:On the documentation page can users add to it?


Found the github page, d'oh!!!
https://github.com/raspberrypi/document ... /camera.md
I am still a github NOOB but I am learning and I will what I can.
Rich Shumaker
User avatar
Posts: 131
Joined: Tue Jul 31, 2012 4:16 pm
Location: Sunny Southern CA near downtown LA
by AndrewS » Fri Aug 15, 2014 12:21 pm
RichShumaker wrote:I wanted to see some picture of the ribbon cable correctly and incorrectly seated and the correct direction of the cable installed correctly.
When the first camera ribbon cable install pictures were put up on the Pi blog I think I looked at them 20 times one day to make sure I did the connection correctly.

http://www.raspberrypi.org/documentatio ... /camera.md and http://www.raspberrypi.org/help/camera-module-setup/ and http://www.raspberrypi.org/documentatio ... /README.md ;)
User avatar
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
by RichShumaker » Fri Aug 15, 2014 5:25 pm
AndrewS wrote:
RichShumaker wrote:I wanted to see some picture of the ribbon cable correctly and incorrectly seated and the correct direction of the cable installed correctly.
When the first camera ribbon cable install pictures were put up on the Pi blog I think I looked at them 20 times one day to make sure I did the connection correctly.

http://www.raspberrypi.org/documentatio ... /camera.md and http://www.raspberrypi.org/help/camera-module-setup/ and http://www.raspberrypi.org/documentatio ... /README.md ;)

I was discussing the troubleshooting page that has a verbal description of a visual problem.
From, http://www.raspberrypi.org/documentatio ... /camera.md
Are the ribbon connectors all firmly seated, and are they the right way round? They must be straight in their sockets.
<Add Image Here>

I just checked and all my Pi Cameras are installed and I can't easily take pictures of what I am talking about.
I will try to strip an install tonight and take pictures of 'common' connection issues I have had.
Being a github noob I didn't know how to add an inline image without hosting it and linking the image when embedding it.

Thanks again for your help with this.
Rich Shumaker
User avatar
Posts: 131
Joined: Tue Jul 31, 2012 4:16 pm
Location: Sunny Southern CA near downtown LA