0

I am using a setup with three DS18B20 temperature sensors in a 3-wire setup (using a pullup resistor of 4.7 kOhm from data to 5v) on a raspi prototype shield. This works fine with a Raspi model B+ V1.2.

Now I am switching to a Raspi Pi 2 model B v1.1. The hardware connection as well as the GPIO hardware itself seems to be okay on the new board. I checked the GPIO pin 4 (default for 1-wire) through sysfs and verified that it can work as an output and as an input.

The old as well as the new board are run both under Raspbian.

What I tried so far:

First, I loaded w1-gpio using sudo modprobe w1-gpio (or alternatively through listing it in /etc/modules). Both ways it gets loaded (shown by lsmod). Additionally I loaded w1-therm the same way. However, the directory /sys/bus/w1/devices does not get populated indicating that the enumeration of the sensors does not work. There are no errors reported through dmesg. This behavior does not depend on enabling/disabling device-tree.

I gave it a second try using device-tree (enabled through raspi-config). I listed dtoverlay=w1-gpio,gpiopin=4,pullup=1 or just adding dtoverlay=w1-gpio. At the same time I removed any w1 entry from /etc/modules. After a reboot I noticed that w1-gpio was not loaded (not shown by lsmod). Again, dmesg gives no hints. Now I added dtdebug=on to /boot/config.txt and rebooted again. However, sudo vcdbg log msg gives no hints.

To be sure everything is up-to-date I upgraded the software and the firmware to the current level by

sudo apt-get update

sudo apt-get dist-upgrade

rpi-update

Now uname shows

Linux raspberrypi 4.4.48-v7+ #964

However this did not help.

One strange detail: after updating/upgrading the Pi the directory /boot/overlays contains additional entries. For example aside of w1-gpio-overlay.dtb there is now a w1-gpio.dtbo.

Now I am somewhat out of new ideas what to try next, but maybe someone can give me helpful information.

Thank you for any help.

Ed

1

If you are using the default 1-wire bus GPIO 4 all you need in /boot/config.txt is the entry

dtoverlay=w1-gpio

You may power from 5V but the data line pull-up should be to 3V3. You may have damaged the GPIO and/or the Pi by exposing a GPIO to more than 3V3.

  • I checked again the loading of w1-gpio through device-tree: the result is taht it is not loaded, i.e. lsmod does not list it. Also, when I check /sys/kernel/debug/gpio gpio pin 4 is not in use. Additionally inspecting the signal at GPIO pin 4 dies not show any acitivity. – Edul Feb 17 '17 at 15:56
  • Sorry for typos, the 5 min edit window cheated me. – Edul Feb 17 '17 at 16:03
  • While I agree that connecting the pull-up resistor to 5 V is unwise the GPIO port 4 ist not broken - I checked the input and output direction. – Edul Feb 17 '17 at 16:05
  • Manually loading of w1-gpio using modprobe works in that it can be seen by lsmod. But GPIO port 4 is not in use when checked through /sys/kernel/debug/gpio. Unclear why. Additionally, checking pin 4 by scope shows no activity. – Edul Feb 17 '17 at 16:07
  • @Edul If the software is okay that leaves the hardware. Hopefully a poor or loose connection rather than a duff device. Photo? – joan Feb 17 '17 at 16:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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