2

I've got a DS18B20 Temperature Probe connected to my Pi but it can't seem to detect it.

I run:

sudo modprobe w1-gpio
sudo modprobe w1-therm

and then go to cd /sys/bus/w1/devices and do ls and it shows the file as empty.

I know its not a problem with the sensor wiring or anything physical as I have 2 sensors and 2 Pi's and both sensors work fine on one of the Pi's. Also I note that there isn't a w1_bus_master1 listed which there should be even with no sensor connected.

The problem seems to have been since I reinstalled Wheezy on the Pi (due to issues in other stuff I was doing) as before that, it worked fine so I feel like i've simply missed some download/upgrade I need for it to work that i did originally and have now forgotten. I've run plenty of apt-get updates and upgrades but have had no luck.

Anyone have any ideas?

3
  • Does raspberrypi.stackexchange.com/questions/27073/… apply?
    – joan
    Feb 9, 2015 at 18:12
  • Yes it does, I added the w1-gpio line to config.txt and its finally picking up the sensor. Thank you so much, you just made my day.
    – Kersakov
    Feb 9, 2015 at 18:27
  • I have the same problem but adding the lines to /boot/config.txt did not do the trick... does anyone have an idea what else I could try?
    – user44418
    Apr 5, 2016 at 12:27

2 Answers 2

3

Added the line:

dtoverlay=w1-gpio-pullup,gpiopin=x (where x is my gpio pin)

to /boot/config.txt as suggested in the comment.

0

If you have a newer version of Wheezy, DO NOT enable "Device Tree" in the Configuration program! I find that it cause all kinds of havoc with you Pis' hardware.

Doing so, you WON'T have to add the line mentioned above.

2
  • What havoc, what is this answer based on, can you cite reference? Mar 9, 2015 at 2:55
  • While the "havoc" statement may be a bit undefined, turning the device tree off actually fixed my problem! I don't know if I toggled that on manually some time ago, and did not reboot for some weeks until I forgot that it was that RPI which I enabled the Device Tree for, but this answer really saved my butt from doing ugly hard and software debugging.
    – Daniel F
    Mar 13, 2015 at 17:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.