TenderLoins
Posts: 12
Joined: Tue May 29, 2012 11:48 am

DS18B20 + Camera module; modprobe breaks camera

Wed Nov 27, 2013 3:43 pm

Using this tutorial http://learn.adafruit.com/adafruits-ras ... ng/ds18b20, I hooked up a DS182B0 sensor to my rpi and I can read from it successfully.

I had raspistill running on a loop previously, and also collected the temperature from the rpi, then I ran rpi-update, something strange happened and I figured I'd just format everything and start again.

Now I do the following:

Code: Select all

[email protected]:~# raspistill -o /mnt/server/images/image9.jpg <--- works and saves image
[email protected]:~# sudo modprobe w1-gpio
[email protected]:~# raspistill -o /mnt/server/images/image9.jpg
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

[email protected]:~#
If I restart, I can use raspistill all day long, until I run modprobe. Anyone know whats going on?

TenderLoins
Posts: 12
Joined: Tue May 29, 2012 11:48 am

Re: DS18B20 + Camera module; modprobe breaks camera

Thu Nov 28, 2013 8:59 am

Verbose output:

Code: Select all

[email protected]:~# raspistill -v -o /mnt/server/images/image912.jpg

raspistill Camera App v1.3.5

Width 2592, Height 1944, quality 85, filename /mnt/server/images/image912.jpg
Time delay 5000, Raw no
Thumbnail enabled Yes, width 64, height 48, quality 35
Link to latest frame enabled  no
Full resolution preview No
Capture method : Single capture

Preview Yes, Full screen Yes
Preview window 0,0,1024,768
Opacity 255
Sharpness 0, Contrast 0, Brightness 50
Saturation 0, ISO 0, Video Stabilisation No, Exposure compensation 0
Exposure Mode 'auto', AWB Mode 'auto', Image Effect 'none'
Metering Mode 'average', Colour Effect Enabled No with U = 128, V = 128
Rotation 0, hflip No, vflip No
ROI x 0.000000, y 0.000000, w 1.000000 h 1.000000
Camera component done
Encoder component done
Starting component connection stage
Connecting camera preview port to video render.
Connecting camera stills port to encoder input port
Opening output file /mnt/server/images/image912.jpg
Enabling encoder output port
Starting capture 0
Finished capture 0
Closing down
Close down completed, all components disconnected, disabled and destroyed

[email protected]:~# modprobe w1-gpio
[email protected]:~# modprobe w1-therm
[email protected]:~# raspistill -v -o /mnt/server/images/image9123.jpg

raspistill Camera App v1.3.5

Width 2592, Height 1944, quality 85, filename /mnt/server/images/image9123.jpg
Time delay 5000, Raw no
Thumbnail enabled Yes, width 64, height 48, quality 35
Link to latest frame enabled  no
Full resolution preview No
Capture method : Single capture

Preview Yes, Full screen Yes
Preview window 0,0,1024,768
Opacity 255
Sharpness 0, Contrast 0, Brightness 50
Saturation 0, ISO 0, Video Stabilisation No, Exposure compensation 0
Exposure Mode 'auto', AWB Mode 'auto', Image Effect 'none'
Metering Mode 'average', Colour Effect Enabled No with U = 128, V = 128
Rotation 0, hflip No, vflip No
ROI x 0.000000, y 0.000000, w 1.000000 h 1.000000
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


jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23874
Joined: Sat Jul 30, 2011 7:41 pm

Re: DS18B20 + Camera module; modprobe breaks camera

Thu Nov 28, 2013 9:29 am

Looks like something is using one of the GPIO's used for the camera. Can you file a bug report on github please (although probably the driver for the HW you have added will need to be changed).
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

User avatar
theoriginalxbrav
Posts: 41
Joined: Sun May 12, 2013 7:16 pm

Re: DS18B20 + Camera module; modprobe breaks camera

Sun Dec 01, 2013 9:53 pm

I can confirm this issue. It is due to the camera sharing GPIO 4 with the 1-Wire devices. Is there any way to change the w1-gpio config's pin?
Projects:
Raspberry Pi Weather Camera and weeWX: http://reboot.us.com/local-weather/
Daily Timelapses: https://www.youtube.com/playlist?list=PLi1er5S-VzV8d2t21zT0U_aBInl1_Ojkf

midnight1111
Posts: 20
Joined: Sun Apr 07, 2013 4:13 am

Re: DS18B20 + Camera module; modprobe breaks camera

Tue Dec 10, 2013 3:22 am

I am having the same problem. I have the RP with the HD camera. Any help is appreciated.


[email protected] ~ $ !rasp
raspivid -n -t 2000 -vf -b 2000000 -fps 25 -o - > out
[email protected] ~ $ cat out
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

[email protected] ~ $ raspconifg
-bash: raspconifg: command not found
[email protected] ~ $ raspi-config
Script must be run as root. Try 'sudo raspi-config'
[email protected] ~ $ sudo raspi-config
[email protected] ~ $ raspivid -v

raspivid Camera App v1.2

Width 1920, Height 1080, filename (null)
bitrate 17000000, framerate 30, time delay 5000
Preview Yes, Full screen Yes
Preview window 0,0,1024,768
Opacity 255
Sharpness 0, Contrast 0, Brightness 50
Saturation 0, ISO 400, Video Stabilisation No, Exposure compensation 0
Exposure Mode 'auto', AWB Mode 'auto', Image Effect 'none'
Metering Mode 'average', Colour Effect Enabled No with U = 128, V = 128
Rotation 0, hflip No, vflip No
ROI x 0.000000, y 0.000000, w 1.000000 h 1.000000
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


[email protected] ~ $ !rasp
raspivid -n -t 2000 -vf -b 2000000 -fps 25 -o - > out
[email protected] ~ $ cat out
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

[email protected] ~ $ raspconifg
-bash: raspconifg: command not found
[email protected] ~ $ raspi-config
Script must be run as root. Try 'sudo raspi-config'
[email protected] ~ $ sudo raspi-config
[email protected] ~ $ raspivid -v

raspivid Camera App v1.2

Width 1920, Height 1080, filename (null)
bitrate 17000000, framerate 30, time delay 5000
Preview Yes, Full screen Yes
Preview window 0,0,1024,768
Opacity 255
Sharpness 0, Contrast 0, Brightness 50
Saturation 0, ISO 400, Video Stabilisation No, Exposure compensation 0
Exposure Mode 'auto', AWB Mode 'auto', Image Effect 'none'
Metering Mode 'average', Colour Effect Enabled No with U = 128, V = 128
Rotation 0, hflip No, vflip No
ROI x 0.000000, y 0.000000, w 1.000000 h 1.000000
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

michaeljvdh
Posts: 11
Joined: Thu Dec 12, 2013 7:04 pm

Re: DS18B20 + Camera module; modprobe breaks camera

Thu Dec 12, 2013 7:23 pm

I am having the exact same issue.

Im using a temperature probe ds18b20 on GPIO4, luckily I did not automate "modprobe w1-gpio" I was in the process of first testing a few things before I automated this .. by chance I bought the camera and just happen to have been working on reading my temperature probe and testing the camera at the same time when I noticed that running "modprobe w1-gpio" was crashing the camera !!!

Im quite desperate to get this resolved, as I have a demo to deliver soon .. and having it in this handicapped state is not going to bring much glory to the pi. HELP.

User avatar
3lackhawk
Posts: 3
Joined: Thu Jan 03, 2013 7:16 am
Location: Hungary

Re: DS18B20 + Camera module; modprobe breaks camera

Fri Dec 13, 2013 5:59 pm

Same too.

My config is Pi model A+Cam module+DHT11sensor
First I set up to get temperature which is unstable (I have an another Pi where this sensor worked perfectly) sometimes get value sometimes not.
After that I set up motion and get same result, not working...

Get this error:
[0] [ERR] [ALL] [Dec 13 16:33:21] main: Thread 1 - Watchdog timeout, trying to do a graceful restart
[0] [ERR] [ALL] [Dec 13 16:34:21] main: Thread 1 - Watchdog timeout, did NOT restart graceful,killing it!

I found this topic and realized it is common problem.
I wanted to see my working cam that is why I try to disable all unnecessary modules like sound and i2c etc.
I put the following into /etc/modprobe.d/blacklist:
blacklist snd-bcm2835
blacklist i2c-bcm2708

Reboot and motion+cam got work at the first time! :)
I tried to get tempereature and work too! ;)
It is unstable still but work....
[email protected]:/opt/motion# /root/DHT.out 11 4
[email protected]:/opt/motion# /root/DHT.out 11 4
[email protected]:/opt/motion# /root/DHT.out 11 4
OK 17 [email protected]pi:/opt/motion# /root/DHT.out 11 4
[email protected]:/opt/motion# /root/DHT.out 11 4
OK 17 [email protected]:/opt/motion# /root/DHT.out 11 4
OK 17 [email protected]:/opt/motion# /root/DHT.out 11 4
[email protected]:/opt/motion# /root/DHT.out 11 4
OK 17 [email protected]:/opt/motion# /root/DHT.out 11 4
OK 17 [email protected]:/opt/motion# /root/DHT.out 11 4
OK 17 [email protected]:/opt/motion# /root/DHT.out 11 4
[email protected]:/opt/motion# /root/DHT.out 11 4
[email protected]:/opt/motion# /root/DHT.out 11 4


I need to test more together I try to figure out why not get data sometimes from DHT11 :?:

starcraft04
Posts: 27
Joined: Wed Mar 06, 2013 3:50 pm

Re: DS18B20 + Camera module; modprobe breaks camera

Sat Dec 14, 2013 9:47 am

Hi all,

I have the exact same issue. Has anyone written a bug report yet? If not, how can I do that, I ve never done it before.

Thanks,

John.

Thicko_1970
Posts: 24
Joined: Thu Jan 03, 2013 12:32 am
Location: Hawick

Re: DS18B20 + Camera module; modprobe breaks camera

Sat Dec 14, 2013 12:32 pm

This is strange, because I am using this sensor and running motion MMAL at the same time. It works flawlessly for me.

I notice that in dmesg, I see "w1_master_driver w1_bus_master1: Family 28 for 28.0000053a951e.55 is not registered.". However, the sensor is happily working. I have set up a Cron job to sample the temperature every 5 minutes and append it to a text file and all seems well.

The dmesg output would perhaps indicate that something is going on, that can cause a conflict in some cases.

michaeljvdh
Posts: 11
Joined: Thu Dec 12, 2013 7:04 pm

Re: DS18B20 + Camera module; modprobe breaks camera

Sat Dec 14, 2013 8:44 pm

What I don't understand is why the camera would have anything to do with GPIO pin 4.

Also from a standard stock install and doing the following breaks the cam.
$ sudo modprobe w1-gpio
$ sudo modprobe w1-therm

In fact it's just when you run mod probe w1-gpio ... Immediately after that if you try to take a picture form raspistill it fails and the camera just locks up with red led burning.

Anyone know how to UNDO modprobe w1-gpio ... Was thinking of only initializing it before my temperature measurement then unloading ... I don't know ... I really would love it to work concurrently.

User avatar
rpdom
Posts: 15371
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: DS18B20 + Camera module; modprobe breaks camera

Sat Dec 14, 2013 10:01 pm

michaeljvdh wrote:Anyone know how to UNDO modprobe w1-gpio
sudo modprobe -r w1-gpio

or

sudo rmmod w1-gpio

You might also need to remove the w1-therm, wire and cn modules too.

starcraft04
Posts: 27
Joined: Wed Mar 06, 2013 3:50 pm

Re: DS18B20 + Camera module; modprobe breaks camera

Sat Dec 14, 2013 11:01 pm

Hi,

I just stried this but it is not working, same error even after unloading the module.

The only thing to make the camera work again is a reboot :(.

michaeljvdh
Posts: 11
Joined: Thu Dec 12, 2013 7:04 pm

Re: DS18B20 + Camera module; modprobe breaks camera

Sun Dec 15, 2013 4:12 am

Yeah Starcraft04 ... I just tested ... Same problem. I'm at a ski resort and should be concentrating on relaxing ... Only no one understands how relaxing electronics can be :)

Looking around on the net I found a few references saying it was working in an older kernel ... Unfortunately my first Pi is the latest .. And have no means for comparison.

Wonder if this is a memory addressing problem ... What annoys me is I went for the pi cam instead of the usb models to so I would have NO problems :) anyway hope someone comes up with a new idea.

Since they both work independently 1wire and the camera .. With both connected it has to be a resource clash.

gmartl79
Posts: 1
Joined: Sun Dec 15, 2013 3:27 pm

Re: DS18B20 + Camera module; modprobe breaks camera

Sun Dec 15, 2013 3:31 pm

Hi there,

does anybody know if there is any progress with this issue. I just ran into the same problem.
Was trying to have a PIR motion detection cam which is also logging the temperature.

Seemed to work quite ok for some time. Since the last sudo apt-get update, every time i call sudo modprobe w1-gpio in my script, the camera module stops working until reboot.

Quite annoying... so desperately looking for help! :)

cheers,
martl

dkossman
Posts: 27
Joined: Tue Dec 25, 2012 12:35 am
Location: Los Angeles, California

Re: DS18B20 + Camera module; modprobe breaks camera

Fri Dec 20, 2013 5:47 pm

Same problem here - also using a couple of 1-wire temperature probes on GPIO7 (BCM GPIO4). It was all working fine up until a couple months ago, but must have broken in one of the updates.

If anyone finds a solution, please let us know...

thanks!

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5340
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: DS18B20 + Camera module; modprobe breaks camera

Sat Dec 21, 2013 1:11 pm

There is a workaround posted here:
https://github.com/raspberrypi/linux/issues/435

michaeljvdh
Posts: 11
Joined: Thu Dec 12, 2013 7:04 pm

Re: DS18B20 + Camera module; modprobe breaks camera

Sun Dec 22, 2013 4:54 pm

Tried this all last night no go for me. Does anyone have experience in logging a formal ticket with the crowd who develop the kernel.

starcraft04
Posts: 27
Joined: Wed Mar 06, 2013 3:50 pm

Re: DS18B20 + Camera module; modprobe breaks camera

Tue Dec 31, 2013 2:43 pm

Hi all,

IT WORKS !!!!

I managed to get it working on version 23+ by doing from url:
https://github.com/raspberrypi/linux/issues/435

but you have to do what is at the end:
[email protected] / $ cat /boot/config.txt
gpu_mem=128
[email protected] / $ cat /etc/modules
# /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.
# Parameters can be specified after the module name.

w1-therm
w1-gpio pullup=1
i2c-dev
i2c-bcm2708
spi-bcm2708
snd-bcm2835

[email protected] / $ cat /etc/modprobe.d/raspi-blacklist.conf
# blacklist spi and i2c by default (many users don't need them)

blacklist spi-bcm2708
blacklist i2c-bcm2708
[email protected] / $

And with that, I can use everything again...

michaeljvdh
Posts: 11
Joined: Thu Dec 12, 2013 7:04 pm

Re: DS18B20 + Camera module; modprobe breaks camera

Tue Dec 31, 2013 3:17 pm

Starcraft04 I'll try this again as you have I'll let you know. Thanks I might have done something silly being impatient with the problem.

Thanks man.

User avatar
theoriginalxbrav
Posts: 41
Joined: Sun May 12, 2013 7:16 pm

Re: DS18B20 + Camera module; modprobe breaks camera

Tue Dec 31, 2013 5:18 pm

Gents,

I believe you've found the solution! The camera seems to be struggling with closing the connection, but(see below) I'm not encountering the ENOSPC error anymore. See below:

Code: Select all

[email protected]:~# cd /sys/bus/w1/devices
[email protected]:/sys/bus/w1/devices# ls
28-00000484df4e  28-000004857c08  28-0000048e17a2  w1_bus_master1
28-00000484eb98  28-000004858afc  28-0000048e5899
[email protected]:/sys/bus/w1/devices# raspistill -v

raspistill Camera App v1.3.5

Width 2592, Height 1944, quality 85, filename (null)
Time delay 5000, Raw no
Thumbnail enabled Yes, width 64, height 48, quality 35
Link to latest frame enabled  no
Full resolution preview No
Capture method : Single capture

Preview Yes, Full screen Yes
Preview window 0,0,1024,768
Opacity 255
Sharpness 0, Contrast 0, Brightness 50
Saturation 0, ISO 0, Video Stabilisation No, Exposure compensation 0
Exposure Mode 'auto', AWB Mode 'auto', Image Effect 'none'
Metering Mode 'average', Colour Effect Enabled No with U = 128, V = 128
Rotation 0, hflip No, vflip No
ROI x 0.000000, y 0.000000, w 1.000000 h 1.000000
Camera component done
Encoder component done
Starting component connection stage
Connecting camera preview port to video render.
Connecting camera stills port to encoder input port
Closing down
The closing delay may just be due to my cron job conflicting with my console commands.

*EDIT*

Yep, conflict with the cron job. Works great!
Projects:
Raspberry Pi Weather Camera and weeWX: http://reboot.us.com/local-weather/
Daily Timelapses: https://www.youtube.com/playlist?list=PLi1er5S-VzV8d2t21zT0U_aBInl1_Ojkf

michaeljvdh
Posts: 11
Joined: Thu Dec 12, 2013 7:04 pm

Re: DS18B20 + Camera module; modprobe breaks camera

Wed Jan 01, 2014 4:08 am

YEEEEEEEHaaaaaaaaaa working for me too. I see Starcraft04 you didn't add w1-therm for those using thermometer.

Anyway apart from opening blacklist here is my /etc/modules

w1-gpio
w1-gpio pullup=1
i2c-dev
i2c-bcm2708
spi-bcm2708
snd-bcm2835
w1-therm

dpenezic
Posts: 99
Joined: Sat Dec 22, 2012 2:36 pm

Re: DS18B20 + Camera module; modprobe breaks camera

Wed Jan 01, 2014 11:30 am

Hi,

i dont understand way you call w1-gpio 2x ?

Regards,
Dubravko Penezic
michaeljvdh wrote:YEEEEEEEHaaaaaaaaaa working for me too. I see Starcraft04 you didn't add w1-therm for those using thermometer.

Anyway apart from opening blacklist here is my /etc/modules

w1-gpio
w1-gpio pullup=1
i2c-dev
i2c-bcm2708
spi-bcm2708
snd-bcm2835
w1-therm

michaeljvdh
Posts: 11
Joined: Thu Dec 12, 2013 7:04 pm

Re: DS18B20 + Camera module; modprobe breaks camera

Wed Jan 01, 2014 4:59 pm

Guys my apologies I meant to hash that out ...
Enter only one w1-gpio instance like this.

w1-gpio pull-up=1

If you did enter it twice it causes no problem.

Sorry.

dpenezic
Posts: 99
Joined: Sat Dec 22, 2012 2:36 pm

Re: DS18B20 + Camera module; modprobe breaks camera

Wed Jan 01, 2014 9:10 pm

Hi,
it is O.K. --- i just wonder if that is some fix .

My only issue is fact that i dont have camera to test all of that in real ... but i will try to help (I read some of comment and see information about memory issue) ... soon i will read all thread and maybe found/suggest some solution.
Regards,
Dubravko Penezic
michaeljvdh wrote:Guys my apologies I meant to hash that out ...
Enter only one w1-gpio instance like this.

w1-gpio pull-up=1

If you did enter it twice it causes no problem.

Sorry.

User avatar
theoriginalxbrav
Posts: 41
Joined: Sun May 12, 2013 7:16 pm

Re: DS18B20 + Camera module; modprobe breaks camera

Wed Jan 01, 2014 10:05 pm

Memory is fine as long as your split is adequate (I'd say do a 384/128 split for CPU/GPU).

Here's my config for future reference. I changed my 1-wire pin to GPIO 18. Also, I can confirm it works both with raspistill and w1-therm simultaneously.

/boot/cmdline.txt:

Code: Select all

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait bcm2708.w1_gpio_pin=18
/etc/modules:

Code: Select all

# /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.
# Parameters can be specified after the module name.

w1-therm
w1-gpio pullup=1
i2c-dev
i2c-bcm2708
spi-bcm2708
snd-bcm2835
cuse
Back-to-back execution of running raspistill, followed by reading raw values of /sys/bus/w1/devices/28-XXXXXXXXXXXX/w1_slave:

Code: Select all

[email protected]:/home/scripts# raspistill -v

raspistill Camera App v1.3.5

Width 2592, Height 1944, quality 85, filename (null)
Time delay 5000, Raw no
Thumbnail enabled Yes, width 64, height 48, quality 35
Link to latest frame enabled  no
Full resolution preview No
Capture method : Single capture

Preview Yes, Full screen Yes
Preview window 0,0,1024,768
Opacity 255
Sharpness 0, Contrast 0, Brightness 50
Saturation 0, ISO 0, Video Stabilisation No, Exposure compensation 0
Exposure Mode 'auto', AWB Mode 'auto', Image Effect 'none'
Metering Mode 'average', Colour Effect Enabled No with U = 128, V = 128
Rotation 0, hflip No, vflip No
ROI x 0.000000, y 0.000000, w 1.000000 h 1.000000
Camera component done
Encoder component done
Starting component connection stage
Connecting camera preview port to video render.
Connecting camera stills port to encoder input port
Closing down
Close down completed, all components disconnected, disabled and destroyed

[email protected]:/home/scripts# ./temperature.sh
Temperature1: 3250
Temperature2: -3687
Temperature3: -3812
Temperature4: 2937
Temperature5: -3687
Temperature6: 3312
[email protected]:/home/scripts#
Raspbian Version:

Code: Select all

Linux raspberry-node05 3.10.25+ #616 PREEMPT Mon Dec 23 18:13:02 GMT 2013 armv6l GNU/Linux
Projects:
Raspberry Pi Weather Camera and weeWX: http://reboot.us.com/local-weather/
Daily Timelapses: https://www.youtube.com/playlist?list=PLi1er5S-VzV8d2t21zT0U_aBInl1_Ojkf

Return to “Troubleshooting”