User avatar
tedhale
Posts: 114
Joined: Thu Sep 20, 2012 4:52 pm
Location: Williamsburg, VA, USA
Contact: Website

Problem using 1-wire

Thu Mar 05, 2015 4:58 pm

I am having trouble using 1-wire devices on a few of my systems. Other systems have no problem.
The first clue that something was odd is that the "/sys/bus/w1/devices/w1_bus_master" file does not exist.

Yes, the driver modules are loaded as shown by lsmod
lsmod
Module Size Used by
w1_therm 3325 0
w1_gpio 4502 0
wire 31280 2 w1_gpio,w1_therm
cn 5756 1 wire
i2c_dev 6709 0
snd_bcm2835 21342 0
snd_pcm 93100 1 snd_bcm2835
snd_seq 61097 0
snd_seq_device 7209 1 snd_seq
snd_timer 23007 2 snd_pcm,snd_seq
snd 67211 5 snd_bcm2835,snd_timer,snd_pcm,snd_seq,snd_seq_device
uio_pdrv_genirq 3666 0
uio 9897 1 uio_pdrv_genirq

I noticed that on the systems that work, I get the following two lines during the boot process.

[ 10.812369] Driver for 1-wire Dallas network protocol.
[ 10.821869] w1-gpio w1-gpio: gpio pin 4, gpio pullup pin -1

But on the systems that don't work, I only see the first line.
This problem is occuring on models B, B+ and 2B.

I have updated using apt, and I just built a new system with the February Raspbian image. Still no luck.

Anyone have an idea what is going on?
- Ted B. Hale
http://raspberrypihobbyist.blogspot.com

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

Re: Problem using 1-wire

Thu Mar 05, 2015 5:27 pm

The latest systems (and upgrades) use Device Tree to handle hardware.

If you add

Code: Select all

dtoverlay=w1-gpio
To your config.txt, (and reboot) you will find that everything works again.

Documentation for this setting and others is in the /boot/overlays/README file.

User avatar
tedhale
Posts: 114
Joined: Thu Sep 20, 2012 4:52 pm
Location: Williamsburg, VA, USA
Contact: Website

Re: Problem using 1-wire

Thu Mar 05, 2015 10:25 pm

That fixed it. Thanks you very much.

I guess if I had been keeping up with my reading on the Pi, I would have already known this.

Thanks again.
- Ted B. Hale
http://raspberrypihobbyist.blogspot.com

Return to “Troubleshooting”